1
1
plugins {
2
+ id ' java-library'
2
3
id ' eclipse'
4
+ id ' idea'
3
5
id ' maven-publish'
4
6
id ' pmd'
5
- id ' com.diffplug.spotless' version ' 5.12.5'
6
- id ' net.minecraftforge.gradle' version ' 5.1.+'
7
- id ' org.parchmentmc.librarian.forgegradle' version ' 1.+'
8
- id ' org.spongepowered.mixin' version ' 0.7.+'
7
+ id ' com.diffplug.spotless' version ' 6.25.0'
8
+ id ' net.neoforged.gradle.userdev' version ' 7.0.165'
9
9
}
10
10
11
11
ext. configFile = file(' build.properties' )
12
12
ext. config = parseConfig(configFile)
13
13
14
14
version = " ${ config.version} -${ config.build_number} "
15
15
group = " vazkii.${ config.mod_id} " // http://maven.apache.org/guides/mini/guide-naming-conventions.html
16
- archivesBaseName = config. mod_name
16
+ base {
17
+ archivesName = config. mod_name
18
+ }
17
19
18
- java. toolchain. languageVersion = JavaLanguageVersion . of(17 )
20
+ java. toolchain. languageVersion = JavaLanguageVersion . of(21 )
19
21
20
22
compileJava. options. compilerArgs << " -Xlint:all,-classfile,-processing,-deprecation" << " -Werror"
21
23
22
24
if (System . getenv(' BUILD_NUMBER' ) != null ) {
23
25
version + = " ." + System . getenv(' BUILD_NUMBER' )
24
26
}
25
27
26
- minecraft {
27
- // The mappings can be changed at any time, and must be in the following format.
28
- // snapshot_YYYYMMDD Snapshot are built nightly.
29
- // stable_# Stables are built at the discretion of the MCP team.
30
- // Use non-default mappings at your own risk. they may not always work.
31
- // Simply re-run your setup task after changing the mappings to update your workspace.
32
-
33
- mappings channel : " ${ config.mapping_channel} " , version : " ${ config.mapping_version} "
34
- // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
35
-
36
- // Default run configurations.
37
- // These can be tweaked, removed, or duplicated as needed.
38
- runs {
39
- client {
40
- workingDirectory project. file(' run' )
41
-
42
- // Recommended logging data for a userdev environment
43
- property ' forge.logging.markers' , ' SCAN,REGISTRIES,REGISTRYDUMP'
44
-
45
- // Recommended logging level for the console
46
- property ' forge.logging.console.level' , ' debug'
47
-
48
- mods {
49
- akashictome {
50
- source sourceSets. main
51
- }
52
- }
53
- }
28
+ runs {
29
+ // applies to all the run configs below
30
+ configureEach {
31
+ // Recommended logging data for a userdev environment
32
+ systemProperty ' forge.logging.markers' , ' REGISTRIES'
54
33
55
- server {
56
- workingDirectory project . file( ' run ' )
34
+ // Recommended logging level for the console
35
+ systemProperty ' forge.logging.console.level ' , ' debug '
57
36
58
- // Recommended logging data for a userdev environment
59
- property ' forge.logging.markers ' , ' SCAN,REGISTRIES,REGISTRYDUMP '
37
+ modSource project . sourceSets . main
38
+ }
60
39
61
- // Recommended logging level for the console
62
- property ' forge.logging.console.level ' , ' debug '
40
+ client {
41
+ }
63
42
64
- mods {
65
- akashictome {
66
- source sourceSets. main
67
- }
68
- }
69
- }
43
+ server {
44
+ programArgument ' --nogui'
70
45
}
71
46
}
72
47
73
48
repositories {
74
49
maven {
75
50
url " https://cursemaven.com"
51
+ content {
52
+ includeGroup " curse.maven"
53
+ }
76
54
}
77
55
}
78
56
79
57
dependencies {
80
- minecraft " net.minecraftforge:forge:${ config.mc_version} -${ config.forge_version} "
81
- implementation fg. deobf(" curse.maven:curios-309927:5367944" )
82
- implementation fg. deobf(" curse.maven:patchouli-306770:4966125" )
83
- implementation fg. deobf(" curse.maven:botania-225643:5594997" )
58
+ implementation " net.neoforged:neoforge:${ config.neo_version} "
59
+
60
+ implementation " curse.maven:curios-1037991:5765721"
61
+ implementation " curse.maven:patchouli-306770:5683901"
62
+ // implementation "curse.maven:botania-225643:5594997"
84
63
}
85
64
86
65
spotless {
@@ -96,11 +75,9 @@ spotless {
96
75
}
97
76
98
77
pmd {
99
- toolVersion ' 6.22.0'
100
- // no way around this warning unless we upgrade Gradle, apparently
101
- // incrementalAnalysis.set(true)
102
- ruleSets. clear()
103
- ruleSetFiles = files(" spotless/pmd-ruleset.xml" )
78
+ toolVersion ' 6.35.0'
79
+ incrementalAnalysis. set(true )
80
+ ruleSetFiles = rootProject. files(" spotless/pmd-ruleset.xml" )
104
81
}
105
82
106
83
task checkSyntax (group : " verification" ) {
@@ -118,7 +95,7 @@ task incrementBuildNumber {
118
95
119
96
import java.util.regex.Pattern
120
97
task sortArtifacts (type : Copy ) {
121
- from jar. destinationDir
98
+ from jar. destinationDirectory
122
99
into config. dir_output
123
100
// Put each jar with a classifier in a subfolder with the classifier as its name
124
101
eachFile {
@@ -144,9 +121,6 @@ def parseConfig(File config) {
144
121
}
145
122
146
123
jar {
147
- // rename the default output, for some better... sanity with scipts
148
- archiveName = " ${ baseName} -${ version} .${ extension} "
149
-
150
124
manifest {
151
125
attributes([
152
126
" Specification-Title" : " ${ config.mod_id} " ,
0 commit comments