1- import com.github.spotbugs.snom.SpotBugsTask
2-
31plugins {
4- id ' fabric-loom' version ' 1.11 -SNAPSHOT'
2+ id ' fabric-loom' version ' 1.12 -SNAPSHOT'
53 id ' maven-publish'
6- id ' io.freefair.lombok' version ' 8.6'
7- id ' com.github.spotbugs-base' version ' 6.0.14'
8- // id 'com.diffplug.spotless' version '6.25.0'
94 id ' me.modmuss50.mod-publish-plugin' version " 0.5.1"
105}
116
@@ -37,36 +32,6 @@ base {
3732 archivesName = " linkart-refabricated"
3833}
3934
40- tasks. register(" spotbugs" , SpotBugsTask ) { task ->
41- sourceSets. each {
42- task. sourceDirs. from(task. sourceDirs. files, it. allSource. sourceDirectories)
43- task. classDirs. from(task. classDirs. files, it. output)
44- task. auxClassPaths. from(task. auxClassPaths. files, it. compileClasspath)
45- }
46- excludeFilter = rootProject. file(" spotbugs.xml" )
47- ignoreFailures = true
48- reports {
49- html {
50- required = true
51- outputLocation = rootProject. file(" ${ rootProject.buildDir} /reports/spotbugs/main/spotbugs.html" )
52- stylesheet = ' fancy-hist.xsl'
53- }
54- sarif {
55- required = true
56- outputLocation = rootProject. file(" ${ rootProject.buildDir} /reports/spotbugs/main/spotbugs.sarif" )
57- }
58- }
59- }
60-
61- /* spotless {
62- java {
63- removeUnusedImports()
64- trimTrailingWhitespace()
65- formatAnnotations()
66- importOrder('', 'java|javax', '\\#')
67- }
68- }*/
69-
7035processResources {
7136 inputs. property " minecraft" , mcVersion
7237 inputs. property " version" , mod_version
8853 ideConfigGenerated true // Run configurations are not created for subprojects by default
8954 runDir " ../../run" // Use a shared run folder and create separate worlds
9055 }
56+
57+ fabricModJsonPath = rootProject. file(" src/main/resources/fabric.mod.json" )
9158}
9259
9360def targetJavaVersion = 17
@@ -110,77 +77,18 @@ java {
11077 withSourcesJar()
11178}
11279
113- jar {
114- from(" LICENSE" ) {
115- rename { " ${ it} _${ project.archivesBaseName} " }
116- }
117- }
118-
119- sourcesJar {
120- exclude {
121- sourceSets. main. allSource. contains it. file
122- }
123- from delombok
124- }
80+ tasks. register(' buildAndCollect' , Copy ) {
81+ group = ' build'
12582
126- /*
127- // configure the maven publication
128- publishing {
129- publications {
130- mavenJava(MavenPublication) {
131- artifactId 'linkart'
132- from components.java
133- }
134- }
83+ from(tasks. named(' remapJar' ). flatMap { it. archiveFile })
84+ from(tasks. named(' remapSourcesJar' ). flatMap { it. archiveFile })
85+ into rootProject. layout. buildDirectory. dir(" libs/${ project.mod_version} " ). get(). asFile
13586
136- repositories {
137- maven {
138- name = "GitHubPackages"
139- url = "https://maven.pkg.github.com/constellation-mc/Linkart"
140- credentials {
141- username = System.getenv("GITHUB_ACTOR")
142- password = System.getenv("GITHUB_TOKEN")
143- }
144- }
145- }
87+ dependsOn ' build'
14688}
14789
148- publishMods {
149- file = remapJar.archiveFile
150- additionalFiles.from(remapSourcesJar.archiveFile)
151-
152- changelog = file("CHANGELOG.md").text
153- type = ReleaseType.valueOf(providers.environmentVariable("VERSION_TYPE").getOrElse("BETA"))
154- modLoaders.add("fabric")
155-
156- displayName = "${project.mod_version} (${project.minecraft_version})"
157-
158- modrinth {
159- projectId = "sc4Mu9Zu"
160- accessToken = providers.environmentVariable("MODRINTH_TOKEN")
161- minecraftVersions.add("${project.minecraft_version}")
162- minecraftVersions.add("1.21")
163-
164- requires("fabric-api")
165- embeds("midnightlib")
166- }
167- curseforge {
168- projectId = "622736"
169- accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
170- minecraftVersions.add("${project.minecraft_version}")
171- minecraftVersions.add("1.21")
172-
173- requires("fabric-api")
174- embeds("midnightlib")
175- }
176- github {
177- repository = "constellation-mc/Linkart"
178- accessToken = providers.environmentVariable("GITHUB_TOKEN")
179- commitish = providers.environmentVariable("GITHUB_SHA").getOrElse("${project.minecraft_version}-fabric")
180-
181- type = STABLE
90+ jar {
91+ from(" LICENSE" ) {
92+ rename { " ${ it} _${ project.archivesBaseName} " }
18293 }
183-
184- dryRun = local
185- }
186- */
94+ }
0 commit comments