aboutsummaryrefslogtreecommitdiff
path: root/build.gradle.kts
blob: 43f60dc65eac95f84621818d4660c7f39d1ad669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
plugins {
    java
    id("net.minecraftforge.gradle.forge")
    id("org.spongepowered.mixin")
    kotlin("jvm")
}

version = "1.2.0"
group = "gq.malwarefight.nosession"

val kotlinVersion = "1.8.21"
val shade: Configuration by configurations.creating
configurations {
    val compile by creating {
        extendsFrom(shade)
    }
    implementation.get().extendsFrom(compile)
}

minecraft {
    version = "1.8.9-11.15.1.2318-1.8.9"
    runDir = "run"
    mappings = "stable_22" //mappings for 1.8.9
    makeObfSourceJar = false //disable creation of sources jar
}


repositories {
    maven("https://repo.spongepowered.org/maven/")
    maven("https://maven.minecraftforge.net/")
    mavenCentral()
}

dependencies {
    compileOnly("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9:universal")
    shade("org.spongepowered:mixin:0.7.11-SNAPSHOT") {
        exclude(module = "launchwrapper")
        exclude(module = "guava")
        exclude(module = "gson")
        exclude(module = "commons-io")
        exclude(module = "log4j-core")
    }
    shade(project(":nosession_libc", "lib"))
    compileOnly("org.spongepowered:mixin:0.7.11-SNAPSHOT")
    annotationProcessor("org.spongepowered:mixin:0.8.5:processor")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
}

tasks.processResources {
    inputs.property("version", project.version)
    inputs.property("mcversion", project.minecraft.version)
    filesMatching(listOf("mcmod.info")) {
        expand(inputs.properties)
    }
}

sourceSets.main {
    this.ext["refMap"] = "mixins.nosession.refmap.json"
}

tasks.withType(Jar::class) {
    from(shade.map { if(it.isDirectory) it else zipTree(it) })
    manifest {
        attributes(
            "ForceLoadAsMod" to true,
            "ModSide" to "CLIENT",
            "FMLCorePluginContainsFMLMod" to true,
            "MixinConfigs" to "mixins.nosession.json",
            "FMLCorePlugin" to "gq.malwarefight.nosession.NoSessionLoadingPlugin"
        )
    }
    exclude("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA", "dummyThing")
    archiveBaseName.set("NoSession")
    isPreserveFileTimestamps = false
    isReproducibleFileOrder = true
}