Skip to content

Commit

Permalink
Update build setup, Gradle 8.10.2 (#66)
Browse files Browse the repository at this point in the history
* Use Java 17 as a minimum everywhere, CoreMods itself is compiled with Java 17 already, so testing with Java 16 doesn't make sense.
* Use lazy task configuration for jar manifest attributes
* Minor cleanup to valid VMs versions
* Update licencer, enable configuration caching
  • Loading branch information
PaintNinja authored Nov 10, 2024
1 parent 2c5b795 commit 26bfc8e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 33 deletions.
39 changes: 18 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import net.minecraftforge.gradleutils.PomUtils

plugins {
id 'org.cadixdev.licenser' version '0.6.1'
id 'net.minecraftforge.licenser' version '1.0.1'
id 'idea'
id 'eclipse'
id 'java-library'
id 'maven-publish'
id 'net.minecraftforge.gradleutils' version '[2.1.2,2.3.0)'
id 'net.minecraftforge.gradleutils' version '[2.1.3,2.3.0)'
}

group 'net.minecraftforge'
version = gradleutils.tagOffsetVersion
println("Version: $version")
println "Version: $version"

java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
Expand Down Expand Up @@ -55,7 +55,7 @@ dependencies {
compileOnly(libs.nulls)
}

jar {
tasks.named('jar', Jar) {
manifest {
attributes([
'Specification-Title': 'coremods',
Expand All @@ -64,7 +64,7 @@ jar {
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor' :'Forge Development LLC'
] as java.util.LinkedHashMap, 'net/minecraftforge/coremod/')
], 'net/minecraftforge/coremod/')
}
}

Expand Down Expand Up @@ -93,22 +93,19 @@ publishing {

allprojects {
ext.VALID_VMS = [
'Adoptium': [16, 17, 18, 19, 20, 21],
'Amazon': [16, 17, 18, 19, 20, 21],
'Azul': (16..21),
'BellSoft': (16..21),
'Graal_VM': [16, 17, 19, 20, 21],
'IBM': [16, 17, 18, 19, 20 ],
'Microsoft': [16, 17, 21],
'Oracle': (16..21),
'SAP': (16..20)
'Adoptium': (17..21),
'Amazon': (17..21),
'Azul': (17..21),
'BellSoft': (17..21),
'Graal_VM': [17, 19, 20, 21],
'IBM': [17, 18, 19, 20 ],
'Microsoft': [17, 21],
'Oracle': (17..21),
'SAP': (17..20)
]
ext.VALID_VMS = [ 'Adoptium': [16] ]
ext.VALID_VMS = [ 'Adoptium': [17] ]
}

idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
idea.module {
downloadJavadoc = downloadSources = true
}
8 changes: 4 additions & 4 deletions coremods-test-jar/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'org.cadixdev.licenser' version '0.6.1'
id 'net.minecraftforge.licenser' version '1.0.1'
id 'eclipse'
id 'java-library'
id 'net.minecraftforge.gradleutils' version '[2.1.2,2.3.0)'
id 'net.minecraftforge.gradleutils' version '[2.1.3,2.3.0)'
}

repositories {
Expand All @@ -12,7 +12,7 @@ repositories {
}

java {
toolchain.languageVersion = JavaLanguageVersion.of(16)
toolchain.languageVersion = JavaLanguageVersion.of(17)
}

license {
Expand All @@ -23,4 +23,4 @@ license {
eclipse.classpath {
containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
file.whenMerged { entries.findAll { it.kind == 'lib' || it.path == 'org.eclipse.buildship.core.gradleclasspathcontainer' }.each { it.entryAttributes['module'] = 'true' } }
}
}
8 changes: 4 additions & 4 deletions coremods-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id 'org.cadixdev.licenser' version '0.6.1'
id 'net.minecraftforge.licenser' version '1.0.1'
id 'eclipse'
id 'java-library'
id 'org.gradlex.extra-java-module-info' version '1.4.2'
id 'net.minecraftforge.gradleutils' version '[2.1.2,2.3.0)'
id 'org.gradlex.extra-java-module-info' version '1.9'
id 'net.minecraftforge.gradleutils' version '[2.1.3,2.3.0)'
}

repositories {
Expand Down Expand Up @@ -99,4 +99,4 @@ if (project.hasProperty('javaVendor') && project.hasProperty('javaVersion')) {
eclipse.classpath {
containers 'org.eclipse.buildship.core.gradleclasspathcontainer'
file.whenMerged { entries.findAll { it.kind == 'lib' || it.path == 'org.eclipse.buildship.core.gradleclasspathcontainer' }.each { it.entryAttributes['module'] = 'true' } }
}
}
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.parallel=true
org.gradle.configuration-cache=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pluginManagement {
}

plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}

dependencyResolutionManagement {
Expand Down Expand Up @@ -45,4 +45,4 @@ dependencyResolutionManagement {

rootProject.name = 'CoreMods'
include 'coremods-test'
include 'coremods-test-jar'
include 'coremods-test-jar'

0 comments on commit 26bfc8e

Please sign in to comment.