-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
161 lines (134 loc) · 4.32 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
151
152
153
154
155
156
157
158
159
160
161
plugins {
id "fabric-loom" version "1.6-SNAPSHOT" apply false
id "io.github.dexman545.outlet" version "1.6.1"
id "com.modrinth.minotaur" version "2.+" apply false
id "java"
}
outlet {
maintainPropertiesFile = System.getenv("DISABLE_PROPERTIES_UPDATE") == null
mcVersionRange = "*"
propertiesData = [
"loader_version": outlet.loaderVersion()
]
}
subprojects {
apply plugin: "fabric-loom"
configurations {
includeApi
include.extendsFrom includeApi
api.extendsFrom includeApi
}
repositories {
mavenLocal()
maven {
name = "OffsetMods538"
url = "https://maven.offsetmonkey538.top/releases"
content {
includeGroup "top.offsetmonkey538.monkeylib538"
}
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
modImplementation "net.fabricmc:fabric-loader:${rootProject.loader_version}"
modImplementation "top.offsetmonkey538.monkeylib538:monkeylib538:${project.monkeylib538_version}"
}
processResources {
inputs.properties(Map.of(
"modVersion", rootProject.mod_version,
"supportedMinecraftVersions", project.supported_minecraft_versions,
"monkeylib538_version", project.monkeylib538_version
))
filesMatching("fabric.mod.json") {
expand(Map.of(
"modVersion", rootProject.mod_version,
"supportedMinecraftVersions", project.supported_minecraft_versions,
"monkeylib538_version", project.monkeylib538_version
))
}
exclude ".cache/**"
}
tasks.withType(JavaCompile).configureEach {
it.options.release = 17
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
jar {
from("${rootProject.projectDir}/LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
}
}
}
configure(subprojects.findAll {it.name == "common"}) {
version = rootProject.mod_version
}
configure(subprojects.findAll {it.name != "common"}) {
apply plugin: "com.modrinth.minotaur"
base {
archivesName = "better-multishot"
}
version = "${rootProject.mod_version}+${project.minecraft_version}"
outlet {
mcVersionRange = project.supported_minecraft_versions
allowSnapshotsForProject = false
}
loom {
splitEnvironmentSourceSets()
mods {
bettermultishot {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}
runs {
client {
client()
name = "${project.name} Client"
runDir "run"
}
server {
server()
name = "${project.name} Server"
runDir "run/server"
}
}
}
// https://gist.github.com/maityyy/3dbcd558d58a6412c3a2a38c72706e8e
afterEvaluate {
loom.runs.configureEach {
vmArg "-javaagent:${configurations.compileClasspath.find{ it.name.contains("sponge-mixin") }}"
}
}
configurations {
common {
canBeResolved = true
canBeConsumed = false
}
api.extendsFrom common
}
dependencies {
common project(path: ":common", configuration: "namedElements")
include project(":common")
}
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "bettermultishot"
def customVersionName = System.getenv("VERSION_NAME")
if (customVersionName != null) versionName = customVersionName
versionNumber = "${project.version}"
versionType = "release"
uploadFile = remapJar.archiveFile
additionalFiles = [sourcesJar.archiveFile]
gameVersions = outlet.mcVersions()
syncBodyFrom = rootProject.file("README.md").text
dependencies {
required.project "monkeylib538"
required.project "fabric-api"
}
}
tasks.modrinth.dependsOn(tasks.modrinthSyncBody)
}