-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
150 lines (124 loc) · 4.39 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import me.modmuss50.mpp.ReleaseType
plugins {
id("java-library")
id("net.neoforged.moddev")
id("me.modmuss50.mod-publish-plugin") version "0.8.1" apply false
}
extensions.create("runConfigCommon", RunConfigCommon.class)
def getGitCommit = providers.exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
}.standardOutput.getAsText().map { it.trim() }
def aw2at = Aw2AtTask.configureDefault(
getProject(),
layout.projectDirectory.file("src/main/resources/moonrise.accesswidener").getAsFile(),
sourceSets.main
)
neoForge {
neoFormVersion = neoform_version
validateAccessTransformers = true
accessTransformers.files.setFrom(aw2at.flatMap { t -> t.getOutputFile() })
}
runConfigCommon {
systemProperties.put "mixin.debug", "true"
systemProperties.put "Moonrise.MaxViewDistance", "128"
}
dependencies {
compileOnly "net.fabricmc:sponge-mixin:0.15.4+mixin.0.8.7"
compileOnly "io.github.llamalad7:mixinextras-common:0.4.1"
// work around minecraft (MDG) forcing ASM 9.3 which is incompatible with the above deps...
components.withModule("net.neoforged:minecraft-dependencies", RemoveAsmConstraint.class)
api("ca.spottedleaf:concurrentutil:${rootProject.concurrentutil_version}") { setTransitive(false) }
api("ca.spottedleaf:yamlconfig:${rootProject.yamlconfig_version}") { setTransitive(false) }
api("org.yaml:snakeyaml:${rootProject.snakeyaml_version}")
// todo: does cloth publish a platform-agnostic jar in mojang mappings?
compileOnly "me.shedaniel.cloth:cloth-config-neoforge:${rootProject.cloth_version}"
}
allprojects {
group = rootProject.maven_group
version = rootProject.mod_version + "+" + getGitCommit.get()
plugins.apply("java-library")
java {
withSourcesJar()
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
dependencies {
testImplementation "org.junit.jupiter:junit-jupiter:${rootProject.junit_version}"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.test {
useJUnitPlatform()
}
repositories {
maven {
url "https://repo.papermc.io/repository/maven-public/"
mavenContent {
includeGroup("ca.spottedleaf")
}
}
maven {
url "https://api.modrinth.com/maven"
mavenContent {
includeGroup("maven.modrinth")
}
}
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.terraformersmc.com/releases/" }
}
// make build reproducible
tasks.withType(AbstractArchiveTask).configureEach {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 21
}
tasks.jar.configure {
from(rootProject.file("LICENSE")) {
rename { "${it}_${rootProject.base.archivesName.get()}"}
}
}
}
subprojects {
plugins.apply("me.modmuss50.mod-publish-plugin")
plugins.apply 'java-library'
plugins.apply 'com.gradleup.shadow'
configurations.create("libs")
configurations.shadow {
extendsFrom(configurations.libs)
}
configurations.implementation {
extendsFrom(configurations.libs)
}
publishMods {
if (project.version.contains("-beta.")) {
type = ReleaseType.BETA
} else {
type = ReleaseType.STABLE
}
changelog = providers.environmentVariable("RELEASE_NOTES")
List<String> supportedMcVersions = rootProject.supported_minecraft_versions.split(',')
modrinth {
projectId = "KOHu7RCS"
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
minecraftVersions = supportedMcVersions
}
curseforge {
projectId = "1096335"
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
minecraftVersions = supportedMcVersions
}
}
// Setup a run with lithium for compatibility testing
configurations.create("lithium")
dependencies {
String coordinates = "maven.modrinth:lithium:"
if (getProject().name == "Moonrise-NeoForge") {
coordinates += rootProject.neo_lithium_version
} else {
coordinates += rootProject.fabric_lithium_version
}
lithium coordinates
}
}