Skip to content

Commit 5f38053

Browse files
committed
Update buildscript
1 parent d92f24c commit 5f38053

File tree

6 files changed

+48
-59
lines changed

6 files changed

+48
-59
lines changed

build.gradle

Lines changed: 19 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,28 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
33
plugins {
44
id 'java'
55
id 'idea'
6+
id 'eclipse'
67
id 'maven-publish'
7-
alias libs.plugins.licenser
88
alias libs.plugins.gradleutils
9+
alias libs.plugins.gitversion
10+
alias libs.plugins.changelog
11+
alias libs.plugins.licenser
912
alias libs.plugins.shadow
10-
//alias libs.plugins.modules
1113
}
1214

13-
final projectDisplayName = 'Minecraft Mavenizer'
14-
final projectArtifactId = base.archivesName = 'minecraft-mavenizer'
15-
final projectVendor = 'Forge Development LLC'
15+
gradleutils.displayName = 'Minecraft Mavenizer'
1616
description = 'A pure-blooded Java tool to generate a maven repository for Minecraft artifacts.'
1717
group = 'net.minecraftforge'
1818
version = gitversion.tagOffset
1919

2020
println "Version: $version"
2121

22+
// TODO [Mavenizer] Update to Java 25 once ForgeGradle and ForgeDev target Gradle 9.1.0
2223
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
2324

2425
dependencies {
26+
compileOnly libs.nulls
27+
2528
implementation libs.jopt
2629
implementation libs.gson
2730
implementation libs.jver
@@ -32,20 +35,8 @@ dependencies {
3235
implementation libs.commonsio
3336

3437
implementation libs.bundles.utils
35-
36-
// Static Analysis
37-
compileOnly libs.nulls
3838
}
3939

40-
/* Can't do modules yet with JavaProvisioner having JavaProbe in the root package.
41-
extraJavaModuleInfo {
42-
failOnMissingModuleInfo = false
43-
//skipLocalJars = true
44-
45-
automaticModule(libs.diff, 'io.codechicken.diffpatch')
46-
}
47-
*/
48-
4940
license {
5041
header = rootProject.file('LICENSE-header.txt')
5142
newLine false
@@ -55,17 +46,11 @@ license {
5546
tasks.named('jar', Jar) {
5647
manifest {
5748
attributes([
58-
'Main-Class': 'net.minecraftforge.mcmaven.cli.Main',
49+
'Main-Class' : 'net.minecraftforge.mcmaven.cli.Main',
5950
'Automatic-Module-Name': 'net.minecraftforge.mavenizer'
6051
])
61-
attributes([
62-
'Specification-Title' : projectDisplayName,
63-
'Specification-Vendor' : projectVendor,
64-
'Specification-Version' : gitversion.info.tag,
65-
'Implementation-Title' : projectDisplayName,
66-
'Implementation-Vendor' : projectVendor,
67-
'Implementation-Version': project.version
68-
], 'net/minecraftforge/mcmaven/cli/')
52+
53+
gradleutils.manifestDefaults(it, 'net/minecraftforge/mcmaven/cli/')
6954
}
7055

7156
archiveClassifier = 'slim'
@@ -75,28 +60,26 @@ tasks.named('shadowJar', ShadowJar) {
7560
archiveClassifier = ''
7661
}
7762

78-
tasks.withType(JavaCompile).configureEach {
79-
options.encoding = 'UTF-8'
80-
options.compilerArgs.addAll(['--module-version', project.version]);
81-
}
82-
8363
changelog {
8464
fromBase()
85-
publishAll = false
8665
}
8766

8867
publishing {
68+
repositories {
69+
maven gradleutils.publishingForgeMaven
70+
}
71+
8972
publications.register('mavenJava', MavenPublication) {
9073
from components.shadow
9174

92-
artifactId = projectArtifactId
93-
changelog.publish it
75+
changelog.publish(it)
76+
gradleutils.promote(it)
9477

9578
pom { pom ->
96-
name = projectDisplayName
79+
name = gradleutils.displayName
9780
description = project.description
9881

99-
gradleutils.pom.setGitHubDetails pom
82+
gradleutils.pom.addRemoteDetails(pom)
10083

10184
licenses {
10285
license gradleutils.pom.licenses.LGPLv2_1
@@ -108,10 +91,4 @@ publishing {
10891
}
10992
}
11093
}
111-
112-
repositories {
113-
maven gradleutils.publishingForgeMaven
114-
}
11594
}
116-
117-
idea.module { downloadSources = downloadJavadoc = true }

gradle.properties

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ org.gradle.caching=true
22
org.gradle.parallel=true
33
org.gradle.configureondemand=true
44

5-
# TODO [MCMavenizer][Gradle9] Enable
6-
#org.gradle.configuration-cache=true
7-
#org.gradle.configuration-cache.parallel=true
5+
org.gradle.configuration-cache=true
6+
org.gradle.configuration-cache.parallel=true
7+
org.gradle.configuration-cache.problems=warn
8+
9+
net.minecraftforge.gradleutils.ide.automatic.sources=true
10+
net.minecraftforge.gradleutils.compilation.defaults=true

gradle/wrapper/gradle-wrapper.jar

122 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.

settings.gradle

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
plugins {
2-
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.10.0'
2+
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
33
}
44

55
rootProject.name = 'minecraft-mavenizer'
66

7-
dependencyResolutionManagement {
8-
repositories {
9-
maven { url = 'https://maven.minecraftforge.net/' }
10-
mavenCentral()
7+
// Applying plugins causes them to not have any IDE support when also applied to any build.gradle files
8+
// The workaround for now is to use this listener here so that it can stay in settings.gradle
9+
// See: https://youtrack.jetbrains.com/issue/IDEA-332061/Gradle-Missing-Code-Completion-Suggestions-for-Settings-Plugins-in-Groovy-DSL
10+
gradle.beforeProject { Project project ->
11+
project.pluginManager.withPlugin('net.minecraftforge.gradleutils') {
12+
project.repositories {
13+
mavenCentral()
14+
maven project.gradleutils.forgeMaven
15+
//mavenLocal()
16+
}
1117
}
18+
}
1219

20+
dependencyResolutionManagement {
1321
//@formatter:off
1422
versionCatalogs.register('libs') {
15-
plugin 'licenser', 'net.minecraftforge.licenser' version '1.2.0'
16-
plugin 'gradleutils', 'net.minecraftforge.gradleutils' version '2.6.0'
17-
plugin 'shadow', 'com.gradleup.shadow' version '9.0.0-beta13'
18-
plugin 'modules', 'org.gradlex.extra-java-module-info' version '1.12'
23+
plugin 'licenser', 'net.minecraftforge.licenser' version '1.2.0'
24+
plugin 'gradleutils', 'net.minecraftforge.gradleutils' version '3.3.18'
25+
plugin 'gitversion', 'net.minecraftforge.gitversion' version '3.1.1'
26+
plugin 'changelog', 'net.minecraftforge.changelog' version '3.1.2'
27+
plugin 'shadow', 'com.gradleup.shadow' version '9.2.2'
28+
29+
// Static Analysis
30+
library 'nulls', 'org.jetbrains', 'annotations' version '26.0.2'
1931

2032
library 'gson', 'com.google.code.gson', 'gson' version '2.10.1'
2133
library 'jopt', 'net.sf.jopt-simple', 'jopt-simple' version '6.0-alpha-3'
@@ -33,9 +45,6 @@ dependencyResolutionManagement {
3345
library 'utils-data', 'net.minecraftforge', 'json-data-utils' version '0.2.3'
3446
library 'utils-logging', 'net.minecraftforge', 'log-utils' version '0.3.1'
3547
bundle 'utils', ['utils-download', 'utils-files', 'utils-hash', 'utils-data', 'utils-logging']
36-
37-
// Static Analysis
38-
library 'nulls', 'org.jetbrains', 'annotations' version '26.0.2'
3948
}
4049
//@formatter:on
4150
}

0 commit comments

Comments
 (0)