-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
133 lines (107 loc) · 3.55 KB
/
build.gradle
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
plugins {
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
}
architectury {
minecraft = rootProject.minecraft_version
}
def sysProps = System.getProperties()
println "Java: ${ -> sysProps['java.version']} | JVM: ${ -> sysProps['java.vm.version']} | Vendor: ${ -> sysProps['java.vendor']} | Architecture: ${ -> sysProps['os.arch']}"
subprojects {
apply plugin: "com.github.johnrengelman.shadow"
apply plugin: "dev.architectury.loom"
configurations {
shade
implementation.extendsFrom(shade)
}
shadowJar {
archiveClassifier.set("shadow")
// relocate("com.esotericsoftware.reflectasm", "dev.latvian.mods.rhino.shaded.reflectasm")
relocate("net.neoforged.srgutils", "dev.latvian.mods.rhino.shaded.srgutils")
configurations = [project.configurations.shade]
}
remapJar {
setInput(shadowJar.archiveFile)
dependsOn shadowJar
}
assemble.dependsOn shadowJar
loom {
silentMojangMappingsLicense()
}
dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${rootProject.minecraft_version}:2021.10.10")
}
// https://mvnrepository.com/artifact/com.pkware.jabel/jabel-javac-plugin
annotationProcessor 'com.pkware.jabel:jabel-javac-plugin:1.0.1-1'
compileOnly 'com.pkware.jabel:jabel-javac-plugin:1.0.1-1'
testAnnotationProcessor('com.pkware.jabel:jabel-javac-plugin:1.0.1-1')
testCompileOnly('com.pkware.jabel:jabel-javac-plugin:1.0.1-1')
// https://mvnrepository.com/artifact/net.neoforged/srgutils
shade('net.neoforged:srgutils:1.0.9')
//lombok, see https://projectlombok.org/setup/gradle
compileOnly("org.projectlombok:lombok:$lombok_version")
annotationProcessor("org.projectlombok:lombok:$lombok_version")
testCompileOnly("org.projectlombok:lombok:$lombok_version")
testAnnotationProcessor("org.projectlombok:lombok:$lombok_version")
// Unit Testing
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit_version")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit_version")
}
test {
// useJUnitPlatform()
}
}
allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"
// apply from: "https://files.latmod.com/public/markdown-git-changelog.gradle"
def ENV = System.getenv()
// version = "${mod_version}-build.${ENV.GITHUB_RUN_NUMBER ?: 9999}"
version = mod_version
group = project.mod_package
archivesBaseName = project.mod_name
tasks.withType(JavaCompile.class) {
sourceCompatibility = 21
options.encoding = "UTF-8"
options.compilerArgs << "-parameters"
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
// We'll use that if it's available, but otherwise we'll use the older option.
options.release = 8
}
repositories {
mavenCentral()
maven {
url "https://maven.architectury.dev/"
}
maven {
url "https://www.cursemaven.com"
content {
includeGroup "curse.maven"
}
}
maven {
url "https://maven.saps.dev/minecraft"
content {
includeGroup "dev.latvian.mods"
includeGroup "dev.ftb.mods"
}
}
maven {
url = "https://maven.parchmentmc.net/"
content {
includeGroup "org.parchmentmc.data"
}
}
}
java {
withSourcesJar()
modularity.inferModulePath.set(false)
}
}
task curseforgePublish