Working on compatibility with Create 6.
This commit is contained in:
39
gradle/java.gradle
Normal file
39
gradle/java.gradle
Normal file
@@ -0,0 +1,39 @@
|
||||
apply plugin: 'java'
|
||||
|
||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||
java.withSourcesJar()
|
||||
java.withJavadocJar()
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes([
|
||||
'Specification-Title' : mod_name,
|
||||
'Specification-Vendor' : mod_author,
|
||||
'Specification-Version' : project.jar.archiveVersion,
|
||||
'Implementation-Title' : project.name,
|
||||
'Implementation-Version' : project.jar.archiveVersion,
|
||||
'Implementation-Vendor' : mod_author,
|
||||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||
'Timestampe' : System.currentTimeMillis(),
|
||||
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
|
||||
'Built-On-Minecraft' : minecraft_version
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
it.options.encoding = 'UTF-8'
|
||||
it.options.release = 17
|
||||
}
|
||||
|
||||
// Disables Gradle's custom module metadata from being published to maven. The
|
||||
// metadata includes mapped dependencies which are not reasonably consumable by
|
||||
// other mod developers.
|
||||
tasks.withType(GenerateModuleMetadata) {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
javadoc {
|
||||
// Suppress annoying warnings when generating JavaDoc files.
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
}
|
||||
48
gradle/property_loader.gradle
Normal file
48
gradle/property_loader.gradle
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
This module can inject build properties from a JSON file. Each property in the
|
||||
JSON file will be mapped to a build property using the key of that property.
|
||||
Property keys ending with _comment will be skipped.
|
||||
|
||||
If a secretFile property exists and points to a valid JSON file that file will
|
||||
be automatically loaded. You can manually load a file using the loadProperties
|
||||
method.
|
||||
*/
|
||||
import groovy.json.JsonSlurper
|
||||
|
||||
// Auto detects a secret file and injects it.
|
||||
if (project.rootProject.hasProperty("secretFile")) {
|
||||
project.logger.lifecycle("Automatically loading properties from the secretFile")
|
||||
final def secretsFile = project.rootProject.file(project.rootProject.getProperty("secretFile"))
|
||||
|
||||
if (secretsFile.exists() && secretsFile.name.endsWith(".json")) {
|
||||
loadProperties(secretsFile)
|
||||
}
|
||||
}
|
||||
|
||||
// Loads properties using a specified json file.
|
||||
def loadProperties(propertyFile) {
|
||||
if (propertyFile.exists()) {
|
||||
propertyFile.withReader {
|
||||
Map propMap = new JsonSlurper().parse it
|
||||
|
||||
for (entry in propMap) {
|
||||
|
||||
// Filter entries that use _comment in the key.
|
||||
if (!entry.key.endsWith("_comment")) {
|
||||
|
||||
project.ext.set(entry.key, entry.value)
|
||||
}
|
||||
}
|
||||
|
||||
project.logger.lifecycle("Successfully loaded " + propMap.size() + " properties")
|
||||
propMap.clear()
|
||||
}
|
||||
} else {
|
||||
project.logger.warn("The property file " + propertyFile.getName() + " could not be loaded. It does not exist.")
|
||||
}
|
||||
}
|
||||
|
||||
// Allows other scripts to use these methods.
|
||||
ext {
|
||||
loadProperties = this.&loadProperties
|
||||
}
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
Reference in New Issue
Block a user