aboutsummaryrefslogtreecommitdiff
path: root/api/build.gradle
blob: ea141a1ef63a27723d136ac9935e90610db0a58b (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
archivesBaseName = rootProject.name + "-" + project.name

dependencies {
    modCompileOnly("net.fabricmc:fabric-loader:${project.fabricloader_version}")
    modApi("me.shedaniel.cloth:cloth-config:${cloth_config_version}")
    modApi("me.shedaniel:architectury:${architectury_version}")
}

architectury {
    common(forgeEnabled.toBoolean())
}

remapJar {
    classifier "raw"
}

task fakeJar(type: Jar, dependsOn: remapJar) {
    from remapJar.archiveFile.map { zipTree(it) }
    from(rootProject.file("fake/fabric.mod.json")) {
        into ""
    }
    classifier null
}

task fakeForgeJar(type: Jar, dependsOn: remapJar) {
    from remapJar.archiveFile.map { zipTree(it) }
    from(rootProject.file("fake/fabric.mod.json")) {
        into ""
    }
    from(rootProject.file("fake/REIPlugin.class")) {
        into "me/shedaniel/rei/forge"
    }
    classifier "fake-forge"
}

artifacts {
    apiElements(fakeJar)
    runtimeElements(fakeJar)
}

afterEvaluate {
    configurations.apiElements.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(tasks.remapJar) }
    configurations.runtimeElements.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(tasks.remapJar) }
}

publishing {
    publications {
        mavenCommon(MavenPublication) {
            artifactId = rootProject.name + "-" + project.name
            from components.java
        }
    }
}