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

architectury {
    common(forgeEnabled.toBoolean())
}

loom {
    accessWidenerPath = gradle.rootProject.project("fabric").file("src/main/resources/roughlyenoughitems.accessWidener")
}

dependencies {
    modCompileOnly("net.fabricmc:fabric-loader:${project.fabricloader_version}")
    modApi("me.shedaniel.cloth:cloth-config:${cloth_config_version}")
    modApi("dev.architectury:architectury:${architectury_version}")
    compileClasspath(annotationProcessor("org.projectlombok:lombok:1.18.22"))
    compileClasspath(project(path: ":api", configuration: "namedElements"))
    testImplementation(project(path: ":api", configuration: "namedElements"))
    testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
}

test {
    useJUnitPlatform()
}

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
}

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
        }
    }
}