1
1
plugins {
2
- id(" java" )
3
- id(" java-library" )
4
- id(" idea" )
5
- id(" maven-publish" )
6
- id(" org.jetbrains.gradle.plugin.idea-ext" ) version(" ${ ideaext_version} " ) // Required for NeoGradle
2
+ id(" fabric-loom" ) version(" ${ loom_version} " ) apply(false )
3
+ id(" net.neoforged.moddev" ) version(" ${ moddev_version} " ) apply(false )
7
4
id(" com.modrinth.minotaur" ) version(" ${ minotaur_version} " )
8
5
id(" net.darkhax.curseforgegradle" ) version(" ${ curseforgegradle_version} " )
9
6
id(" com.github.breadmoirai.github-release" ) version(" ${ githubrelease_version} " )
@@ -14,106 +11,14 @@ subprojects {
14
11
version = mod_version
15
12
group = mod_group
16
13
17
- apply(plugin : " java" )
18
- apply(plugin : " java-library" )
19
- apply(plugin : " idea" )
20
- apply(plugin : " maven-publish" )
21
-
22
- if (project. name != " common" ) {
14
+ // Publishing
15
+ if (name != " common" ) {
23
16
apply(plugin : " com.modrinth.minotaur" )
17
+ apply(plugin : " net.darkhax.curseforgegradle" )
24
18
apply(plugin : " com.github.breadmoirai.github-release" )
25
19
apply(plugin : " org.ajoberstar.grgit.service" )
26
- }
27
-
28
- java. toolchain. languageVersion = JavaLanguageVersion . of(Integer . valueOf(java_version))
29
-
30
- jar {
31
- from(rootProject. file(" LICENSE" )) {
32
- rename { " ${ it} _${ mod_name} " }
33
- }
34
- manifest {
35
- attributes([
36
- " Specification-Title" : mod_name,
37
- " Specification-Vendor" : mod_owner,
38
- " Specification-Version" : project. jar. archiveVersion,
39
- " Implementation-Title" : project. name,
40
- " Implementation-Version" : project. jar. archiveVersion,
41
- " Implementation-Vendor" : mod_owner,
42
- " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" ),
43
- " Timestamp" : System . currentTimeMillis(),
44
- " Built-On-Java" : " ${ System.getProperty('java.vm.version')} (${ System.getProperty('java.vm.vendor')} )" ,
45
- " Built-On-Minecraft" : minecraft_version
46
- ])
47
- }
48
- }
49
- java. withSourcesJar()
50
- sourcesJar {
51
- from(rootProject. file(" LICENSE" )) {
52
- rename { " ${ it} _${ mod_name} " }
53
- }
54
- }
55
-
56
- repositories {
57
- maven {
58
- name = " Modrinth"
59
- url = " https://api.modrinth.com/maven"
60
- }
61
- }
62
-
63
- tasks. withType(JavaCompile ). configureEach {
64
- it. options. encoding = " UTF-8"
65
- it. options. getRelease(). set(Integer . valueOf(java_version))
66
- }
67
20
68
- processResources {
69
- def expandProps = [
70
- " project_group" : project. group,
71
- " mod_version" : mod_version,
72
- " mod_group" : mod_group,
73
- " mod_id" : mod_id,
74
- " mod_name" : mod_name,
75
- " mod_description" : mod_description,
76
- " mod_icon" : " assets/" + mod_id + " /icon.png" ,
77
- " mod_owner" : mod_owner,
78
- " mod_authors_list" : asJsonList(mod_authors),
79
- " mod_contributors_list" : asJsonList(mod_contributors),
80
- " mod_authors_string" : mod_authors. replace(" ," , " , " ),
81
- " mod_contributors_string" : mod_contributors. replace(" ," , " , " ),
82
- " mod_license" : mod_license,
83
- " mod_environment" : mod_environment,
84
- " java_version" : java_version,
85
- " java_versions_fabric_list" : asJsonList(java_versions_fabric),
86
- " java_versions_neoforge" : java_versions_neoforge,
87
- " minecraft_version" : minecraft_version,
88
- " minecraft_versions_fabric_list" : asJsonList(minecraft_versions_fabric),
89
- " minecraft_versions_neoforge" : minecraft_versions_neoforge,
90
- " fabric_loader_version" : fabric_loader_version,
91
- " fabric_loader_versions_list" : asJsonList(fabric_loader_versions),
92
- " fabric_api_version" : fabric_api_version,
93
- " fabric_api_versions_list" : asJsonList(fabric_api_versions),
94
- " neoforge_loader_versions" : neoforge_loader_versions,
95
- " neoforge_version" : neoforge_version,
96
- " neoforge_versions" : neoforge_versions,
97
- " modmenu_version" : modmenu_version,
98
- " modmenu_versions_list" : asJsonList(modmenu_versions),
99
- " homepage_url" : homepage_url,
100
- " sources_url" : sources_url,
101
- " issues_url" : issues_url,
102
- " contact_url" : contact_url
103
- ]
104
-
105
- filesMatching([" pack.mcmeta" , " *.mod.json" , " META-INF/*mods.toml" , " *.mixins.json" ]) {
106
- expand expandProps
107
- }
108
- inputs. properties(expandProps)
109
- }
110
-
111
- tasks. withType(GenerateModuleMetadata ). configureEach {
112
- enabled = false
113
- }
114
-
115
- afterEvaluate {
116
- if (name != " common" ) {
21
+ afterEvaluate {
117
22
modrinth {
118
23
token = System . getenv(). MODRINTH_TOKEN ? System . getenv(). MODRINTH_TOKEN : " empty"
119
24
projectId = modrinth_id
@@ -149,8 +54,7 @@ subprojects {
149
54
tasks. modrinthSyncBody. onlyIf { System . getenv(). MODRINTH_TOKEN }
150
55
151
56
task curseforge(type : net.darkhax.curseforgegradle.TaskPublishCurseForge ) {
152
- apiToken = System . getenv(). CURSEFORGE_TOKEN ? System . getenv(). CURSEFORGE_TOKEN : " "
153
- if (apiToken. isBlank()) return
57
+ apiToken = System . getenv(). CURSEFORGE_TOKEN ? System . getenv(). CURSEFORGE_TOKEN : " empty"
154
58
155
59
disableVersionDetection()
156
60
String module = project. name
@@ -205,10 +109,6 @@ subprojects {
205
109
}
206
110
}
207
111
208
- static asJsonList (String versions ) {
209
- return versions. split(" ," ). collect { " \" $it \" " }. join(' ,' )
210
- }
211
-
212
112
static String capsLoader (String loader ) {
213
113
switch (loader) {
214
114
case " fabric" : return " Fabric"
0 commit comments