Code cleanup

This commit is contained in:
LemADEC 2020-07-11 11:18:19 +02:00
parent 831ea2509f
commit b40e5a7d96

View file

@ -35,18 +35,19 @@ group = "cr0s.warpdrive" // http://maven.apache.org/guides/mini/guide-naming-con
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv("BUILD_NUMBER") ?: 'SNAPSHOT'}" version = "${config.minecraft_version}-${config.mod_version}.${System.getenv("BUILD_NUMBER") ?: 'SNAPSHOT'}"
archivesBaseName = "WarpDrive" archivesBaseName = "WarpDrive"
sourceCompatibility = JavaVersion.VERSION_1_8 // Enforce Java version explicitly so eclipse task generates correctly.
targetCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = compileJava.sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = compileJava.targetCompatibility = JavaVersion.VERSION_1_8
minecraft { minecraft {
version = config.minecraft_version + "-" + config.forge_version version = config.minecraft_version + "-" + config.forge_version
runDir = "run" runDir = "run"
// the mappings can be changed at any time, and must be in the following format. // The mappings can be changed at any time, and must be in the following format.
// snapshot_YYYYMMDD snapshot are built nightly. // snapshot_YYYYMMDD Snapshot are built nightly.
// stable_# stables are built at the discretion of the MCP team. // stable_# Stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not allways work. // Use non-default mappings at your own risk. they may not allways work.
// simply re-run your setup task after changing the mappings to update your workspace. // Simply re-run your setup task after changing the mappings to update your workspace.
mappings = "${config.mappings_version}" mappings = "${config.mappings_version}"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
@ -125,20 +126,19 @@ repositories {
} }
dependencies { dependencies {
// you may put jars on which you depend on in ./libs // You may put jars on which you depend on in ./libs or you may define them like so..
// or you may define them like so..
//compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version" //compile "some.group:artifact:version"
// real examples // Real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// for more info... // For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html // http://www.gradle.org/docs/current/userguide/dependency_management.html
// using deobfCompile will include in run environment // Using deobfCompile will include in run environment
provided "blusunrize:ImmersiveEngineering:${config.ImmersiveEngineering_version}:deobf" provided "blusunrize:ImmersiveEngineering:${config.ImmersiveEngineering_version}:deobf"
provided "cofh:CoFHCore:${config.CoFHCore_version}:universal" provided "cofh:CoFHCore:${config.CoFHCore_version}:universal"
provided "cofh:RedstoneFlux:${config.RedstoneFlux_version}:universal" provided "cofh:RedstoneFlux:${config.RedstoneFlux_version}:universal"
@ -162,7 +162,7 @@ dependencies {
processResources { processResources {
// this will ensure that this task is redone when the versions change. // this will ensure that this task is redone when the versions change.
inputs.property "version", project.version inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version inputs.property "mcversion", config.minecraft_version
// skip source assets // skip source assets
exclude '**/*.pdn' exclude '**/*.pdn'
@ -173,10 +173,10 @@ processResources {
include 'mcmod.info' include 'mcmod.info'
// replace version and mcversion // replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version expand 'version':project.version, 'mcversion':config.minecraft_version
} }
// copy everything else, thats not the mcmod.info // copy everything else, that's not the mcmod.info
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info' exclude 'mcmod.info'
} }
@ -227,19 +227,20 @@ jar {
dependsOn copyOpenComputersCommons1, copyOpenComputersCommons2, copyOpenComputersCommons3, copyOpenComputersCommons4, copyOpenComputersCommons5, copyOpenComputersCommons6 dependsOn copyOpenComputersCommons1, copyOpenComputersCommons2, copyOpenComputersCommons3, copyOpenComputersCommons4, copyOpenComputersCommons5, copyOpenComputersCommons6
manifest { manifest {
attributes FMLAT: "warpdrive_at.cfg" attributes([
attributes FMLCorePlugin: "cr0s.warpdrive.core.FMLLoadingPlugin" "FMLAT": "warpdrive_at.cfg",
attributes FMLCorePluginContainsFMLMod: "true" "FMLCorePlugin": "cr0s.warpdrive.core.FMLLoadingPlugin",
"FMLCorePluginContainsFMLMod": "true",
])
} }
classifier = '' classifier = ''
destinationDir = file 'output' destinationDir = file 'output'
} }
task signJar(type: SignJar) { task signJar(type: SignJar, dependsOn: reobfJar) {
onlyIf { // Skip the task if our secret data isn't available onlyIf { // Skip the task if our secret data isn't available
project.hasProperty('keyStore') project.hasProperty('keyStore')
} }
dependsOn reobfJar
if (project.hasProperty('keyStore')) { // This needs to be a path to the keystore file if (project.hasProperty('keyStore')) { // This needs to be a path to the keystore file
keyStore = project.keyStore keyStore = project.keyStore