-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
52 lines (47 loc) · 1.7 KB
/
Copy pathbuild.gradle
File metadata and controls
52 lines (47 loc) · 1.7 KB
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
// Root build script. Module-specific config (Loom for fabric, java-library
// for common/spigot, the actual deps) lives in each subproject's
// build.gradle. We hoist only the cross-cutting bits:
// - group / version
// - source encoding + Java 21 target (every subproject runs javac)
// - the GitHubPackages publishing destination
//
// `gradle build` / `gradle publish` at the root iterates over every
// subproject that defines those tasks.
def publishMode = findProperty("publishMode") == "true"
ext.publishMode = publishMode
allprojects {
group = project.maven_group
version = project.mod_version
}
subprojects {
repositories {
mavenCentral()
}
// plugins.withType is the canonical "react as soon as the plugin is
// applied" hook. Reacts BEFORE Loom finishes configuring its own tasks,
// so the toolchain is in place when Loom asks for it. afterEvaluate
// here would be too late.
plugins.withType(JavaPlugin) {
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.release.set(21)
}
}
plugins.withId('maven-publish') {
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/SAOFR-DEV/Modding-Lib")
credentials {
username = System.getenv("GITHUB_ACTOR") ?: findProperty("gpr.user")
password = System.getenv("GITHUB_TOKEN") ?: findProperty("gpr.key")
}
}
}
}
}
}