From cfbbcc87770da532f9bed9e3e4b824200970c34c Mon Sep 17 00:00:00 2001 From: Johann Bernhardt Date: Sun, 7 Nov 2021 16:36:54 +0100 Subject: Unify build script draft --- .github/workflows/gradle.yml | 43 ++++ .gitignore | 116 ++------- build.gradle | 430 ++++++++++++++++++++++--------- build.properties | 32 --- dependencies.gradle | 29 +++ gradle.properties | 58 ++++- gradle/wrapper/gradle-wrapper.jar | Bin 54333 -> 55616 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 22 +- gradlew.bat | 100 +++++++ jitpack.yml | 2 + repositories.gradle | 43 ++++ src/main/java/gregtech/GT_Mod.java | 2 +- src/main/resources/mcmod.info | 8 +- 14 files changed, 635 insertions(+), 252 deletions(-) create mode 100644 .github/workflows/gradle.yml delete mode 100644 build.properties create mode 100644 dependencies.gradle create mode 100644 gradlew.bat create mode 100644 jitpack.yml create mode 100644 repositories.gradle diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000000..75338898fa --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,43 @@ +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ master, main ] + pull_request: + branches: [ master, main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up JDK 8 + uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Setup the workspace + run: ./gradlew setupCIWorkspace + + - name: Build the mod + run: ./gradlew build + + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: true + title: "Latest Development Build" + files: build/libs/*.jar + diff --git a/.gitignore b/.gitignore index 3beafd6561..4a0ea1e653 100644 --- a/.gitignore +++ b/.gitignore @@ -1,97 +1,29 @@ -### Windows ### - -thumbs.db -*.db - -### Java ### - -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.war -*.ear -*.txt - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -### Eclipse ### -libs/Galacticraft-Planets-Dev-1.7-3.0.12.503.jar -libs/GalacticraftCore-Dev-1.7-3.0.12.503.jar -libs/MicdoodleCore-Dev-1.7-3.0.12.503.jar -libs/gregtech-5.09.32.22-dev.jar -*.pydevproject -.metadata .gradle -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -/eclipse - -# Eclipse Core -.project - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# CDT-specific -.cproject - -# JDT-specific (Eclipse Java Development Tools) +.settings +/.idea/ +/run/ +/build/ +/eclipse/ .classpath - -# Java annotation processor (APT) -.factorypath - -# PDT-specific -.buildpath - -# sbteclipse plugin -.target - -# TeXlipse plugin -.texlipse - -### Intellij IDEA ### - +.project +/bin/ +/config/ +/crash-reports/ +/logs/ +options.txt +/saves/ +usernamecache.json +banned-ips.json +banned-players.json +eula.txt +ops.json +server.properties +servers.dat +usercache.json +whitelist.json +world/ +/out/ *.iml *.ipr *.iws - -.idea/ -.idea_modules/ -classes/ - -/out/ -gradlew -gradlew.bat - -# Linux -*~ - - -*.bat -libs/ -*.dat -*.dat_old -*.dat_mcr -*.lock -*.mca -*.gz -*.log -*.jar -*.errored -/build/ -/run +src/main/resources/mixins.*.json diff --git a/build.gradle b/build.gradle index f92e2a9a82..5c3a3f49a5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,17 +1,27 @@ +/* +DO NOT CHANGE THIS FILE! + +Also, you may replace this file at any time if there is an update available. +Please check https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/build.gradle for updates. + */ + + +import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation +import java.util.concurrent.TimeUnit + buildscript { repositories { - mavenCentral() maven { - name = "gt" - url = "https://gregtech.overminddl1.com/" + name = "jitpack" + url = "https://jitpack.io" } maven { - name = "sonatype" - url = "https://oss.sonatype.org/content/repositories/snapshots/" + name = "forge" + url = "https://maven.minecraftforge.net" } maven { - name = "jitpack.io" - url = "https://jitpack.io" + name = "sonatype" + url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { @@ -19,162 +29,348 @@ buildscript { } } +plugins { + id("org.ajoberstar.grgit") version("3.1.1") + id("com.github.johnrengelman.shadow") version("4.0.4") + id("com.palantir.git-version") version("0.12.3") +} + apply plugin: 'forge' apply plugin: 'idea' -apply plugin: 'java' -apply plugin: 'signing' -apply plugin: 'java-library' -file "build.properties" withReader { - def prop = new Properties() - prop.load(it) - ext.config = new ConfigSlurper().parse prop +idea { + module { + inheritOutputDirs = true + downloadJavadoc = true + downloadSources = true + } } -version = "${config.gt.version}" -group = "gregtech" -archivesBaseName = "gregtech" +configurations.all { + resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) -compileJava { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - options.encoding = "UTF-8" + // Make sure GregTech build won't time out + System.setProperty("org.gradle.internal.http.connectionTimeout", 120000 as String) + System.setProperty("org.gradle.internal.http.socketTimeout", 120000 as String) } +// Pulls version from git tag +version = minecraftVersion + "-" + gitVersion() +group = modGroup +archivesBaseName = modId + minecraft { - version = "${config.minecraft.version}-${config.forge.version}" + if(JavaVersion.current() != JavaVersion.VERSION_1_8) { + throw new GradleException("This project requires Java 8, but it's running on " + JavaVersion.current()) + } + + version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion runDir = "run" + + if (replaceGradleTokenInFile) { + replaceIn replaceGradleTokenInFile + if(gradleTokenModId) { + replace gradleTokenModId, modId + } + if(gradleTokenModName) { + replace gradleTokenModName, modName + } + if(gradleTokenModName) { + replace gradleTokenVersion, versionDetails().lastTag + } + if(gradleTokenGroupName) { + replace gradleTokenGroupName, modGroup + } + } } -idea.module.inheritOutputDirs = true +apply from: 'repositories.gradle' + +configurations { + implementation.extendsFrom(shadowImplementation) +} repositories { - maven { - name = "gt" - url = "https://gregtech.overminddl1.com/" + if(usesMixins.toBoolean()) { + maven { + name = "sponge" + url = "https://repo.spongepowered.org/repository/maven-public" + } + maven { + url = "https://jitpack.io" + } } - maven { - name = "chickenbones" - url = "https://nexus.covers1624.net/repository/maven-hosted/" +} + +dependencies { + if(usesMixins.toBoolean()) { + annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3") + annotationProcessor("com.google.guava:guava:24.1.1-jre") + annotationProcessor("com.google.code.gson:gson:2.8.6") + annotationProcessor("org.spongepowered:mixin:0.8-SNAPSHOT") + // using 0.8 to workaround a issue in 0.7 which fails mixin application + compile("org.spongepowered:mixin:0.7.11-SNAPSHOT") { + // Mixin includes a lot of dependencies that are too up-to-date + exclude module: "launchwrapper" + exclude module: "guava" + exclude module: "gson" + exclude module: "commons-io" + exclude module: "log4j-core" + } + compile("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev") } - maven { - name = "ic2, forestry" - url = "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/" +} + +apply from: 'dependencies.gradle' + +task relocateShadowJar(type: ConfigureShadowRelocation) { + target = tasks.shadowJar + prefix = modGroup + ".shadow" +} + +def mixinConfigJson = "mixins." + modId + ".json" +def mixingConfigRefMap = "mixins." + modId + ".refmap.json" +def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap +def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg" + +task generateAssets { + if(usesMixins.toBoolean()) { + new File(projectDir.toString() + "/src/main/resources/", mixinConfigJson).text = """{ + "required": true, + "minVersion": "0.7.11", + "package": "${modGroup}.${mixinsPackage}", + "plugin": "${modGroup}.${mixinPlugin}", + "refmap": "${mixingConfigRefMap}", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8" +} + +""" } - maven { // EnderIO & EnderCore - name = 'tterrag Repo' - url = "http://maven.tterrag.com" +} + +shadowJar { + def manifestAttributes = [:] + if(containsMixinsAndOrCoreModOnly.toBoolean() == false) { + manifestAttributes += ["FMLCorePluginContainsFMLMod": true] } - maven { // TConstruct - name = 'DVS1 Maven FS' - url = 'http://dvs1.progwml6.com/files/maven' + + if(accessTransformersFile) { + manifestAttributes += ["FMLAT" : accessTransformersFile.toString()] } - maven { // AppleCore - url = "http://www.ryanliptak.com/maven/" + + if(coreModClass) { + manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] } - maven { // GalacticGreg, YAMCore,.. - name = 'UsrvDE' - url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/" + + if(usesMixins.toBoolean()) { + from refMap + manifestAttributes += [ + "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs" : mixinConfigJson, + "ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false + ] } - ivy { - name = 'gtnh_download_source_stupid_underscore_typo' - artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]") + manifest { + attributes(manifestAttributes) } - ivy { - name = 'gtnh_download_source' - artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]") + + minimize() + configurations = [project.configurations.shadowImplementation] + dependsOn(relocateShadowJar) +} + +jar { + def manifestAttributes = [:] + if(containsMixinsAndOrCoreModOnly.toBoolean() == false) { + manifestAttributes += ["FMLCorePluginContainsFMLMod": true] } - maven { - name = "jitpack.io" - url = "https://jitpack.io" + + if(accessTransformersFile) { + manifestAttributes += ["FMLAT" : accessTransformersFile.toString()] } -} -dependencies { - //Hard dep to start (Without this, it wont compile nor start) - compile 'com.google.code.findbugs:jsr305:1.3.9' - compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" - compile ("com.github.GTNewHorizons:StructureLib:${config.structurelib.version}:deobf") + if(coreModClass) { + manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] + } + + if(usesMixins.toBoolean()) { + from refMap + manifestAttributes += [ + "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs" : mixinConfigJson, + "ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false + ] + } + manifest { + attributes(manifestAttributes) + } + + if(usesShadowedDependencies.toBoolean()) { + dependsOn(shadowJar) + enabled = false + } +} - //Hard dep to compile (Without this, it wont compile, not even as library) - api "appeng:appliedenergistics2:${config.ae2.version}:dev" - api "applecore:AppleCore:${config.applecore.version}:api" - api "codechicken:CodeChickenLib:${config.minecraft.version}-${config.codechickenlib.version}:dev" - api "codechicken:CodeChickenCore:${config.minecraft.version}-${config.codechickencore.version}:dev" - api "codechicken:NotEnoughItems:${config.minecraft.version}-${config.nei.version}:dev" - api "com.enderio.core:EnderCore:${config.enderiocore.version}:dev" - api("com.enderio:EnderIO:${config.enderio.version}:dev") { - transitive = false +reobf { + if(usesMixins.toBoolean()) { + addExtraSrgFile mixinSrg } +} - //Soft Depths (Without this, it wont compile, not needed as library) - compileOnly 'commons-io:commons-io:2.4' - compileOnly "eu.usrv:YAMCore:${config.minecraft.version}-${config.yamcore.version}:deobf" - compileOnly "tconstruct:TConstruct:${config.minecraft.version}-${config.tconstruct.version}:deobf" - compileOnly "codechicken:Translocator:${config.minecraft.version}-${config.translocators.version}:dev" - compileOnly "net.sengir.forestry:forestry_${config.minecraft.version}:${config.forestry.version}:dev" - compileOnly files("libs/Galacticraft-API-1.7-${config.gc.version}.jar") - compileOnly files("libs/GalacticraftCore-Dev-${config.gc.version}.jar") - compileOnly name: "Galacticraft-API", version: config.gc.version, ext: 'jar' - compileOnly name: "GalacticraftCore-Dev", version: config.gc.version, ext: 'jar' - compileOnly name: 'CoFHLib', version: config.cofhlib.version, ext: 'jar' - compileOnly name: 'Railcraft', version: config.railcraft.version, ext: 'jar' - compileOnly name: 'IC2NuclearControl', version: config.nc.version, ext: 'jar' +afterEvaluate { + if(usesMixins.toBoolean()) { + tasks.compileJava { + options.compilerArgs += [ + "-AreobfSrgFile=${tasks.reobf.srg}", + "-AoutSrgFile=${mixinSrg}", + "-AoutRefMapFile=${refMap}", + // Elan: from what I understand they are just some linter configs so you get some warning on how to properly code + "-XDenableSunApiLintControl", + "-XDignore.symbol.file" + ] + } + } } -processResources { - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version +runClient { + def arguments = [] - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' + if(usesMixins.toBoolean()) { + arguments += [ + "--mods=../build/libs/$modId-${version}.jar", + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] + } - // replace version and mcversion - expand 'version': project.version, 'mcversion': project.minecraft.version + if(developmentEnvironmentUserName) { + arguments += [ + "--username", + developmentEnvironmentUserName + ] } - // copy everything else, that's not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' + args(arguments) +} + +runServer { + def arguments = [] + + if(usesMixins.toBoolean()) { + arguments += [ + "--mods=../build/libs/$modId-${version}.jar", + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] } - exclude '**/Thumbs.db' + + args(arguments) } -task sourceJar(type: Jar) { - from sourceSets.main.allSource - archiveClassifier.set('sources') +processResources + { + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand "minecraftVersion": project.minecraft.version, + "modVersion": versionDetails().lastTag, + "modId": modId, + "modName": modName + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } + } + +task sourcesJar(type: Jar) { + from (sourceSets.main.allJava) + from (file("$projectDir/LICENSE")) + getArchiveClassifier().set('sources') + + def manifestAttributes = [:] + if(containsMixinsAndOrCoreModOnly.toBoolean() == false) { + manifestAttributes += ["FMLCorePluginContainsFMLMod": true] + } + + if(accessTransformersFile) { + manifestAttributes += ["FMLAT" : accessTransformersFile.toString()] + } + + if(coreModClass) { + manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] + } + + if(usesMixins.toBoolean()) { + from refMap + manifestAttributes += [ + "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs" : mixinConfigJson, + "ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false + ] + } + manifest { + attributes(manifestAttributes) + } } task devJar(type: Jar) { from sourceSets.main.output - archiveClassifier.set('dev') + getArchiveClassifier().set("dev") + + def manifestAttributes = [:] + if(containsMixinsAndOrCoreModOnly.toBoolean() == false) { + manifestAttributes += ["FMLCorePluginContainsFMLMod": true] + } + + if(accessTransformersFile) { + manifestAttributes += ["FMLAT" : accessTransformersFile.toString()] + } + + if(coreModClass) { + manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] + } + + if(usesMixins.toBoolean()) { + from refMap + manifestAttributes += [ + "TweakClass" : "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs" : mixinConfigJson, + "ForceLoadAsMod" : containsMixinsAndOrCoreModOnly.toBoolean() == false + ] + } + manifest { + attributes(manifestAttributes) + } } task apiJar(type: Jar) { - from sourceSets.main.allSource - include("gregtech/api/**") - archiveClassifier.set('api') + from (sourceSets.main.allJava) { + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString() + '/**' + } + + from (sourceSets.main.output) { + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString() + '/**' + } + + from (sourceSets.main.resources.srcDirs) { + include("LICENSE") + } + + getArchiveClassifier().set('api') } + artifacts { - archives(devJar) - archives(sourceJar) - archives(apiJar) -} - -task signJar(dependsOn: 'reobf') { - doLast { - ant.signjar( - destDir: jar.getDestinationDirectory(), - jar: jar.getArchivePath(), - alias: findProperty('keyStoreAlias') ?: '', - keystore: findProperty('keyStore') ?: '', - storepass: findProperty('keyStorePass') ?: '', - digestalg: findProperty('signDigestAlg') ?: '', - tsaurl: findProperty('signTSAurl') ?: '', - verbose: true - ) + archives sourcesJar + archives devJar + if(apiPackage) { + archives apiJar } } diff --git a/build.properties b/build.properties deleted file mode 100644 index bae670851f..0000000000 --- a/build.properties +++ /dev/null @@ -1,32 +0,0 @@ -minecraft.version=1.7.10 -forge.version=10.13.4.1614-1.7.10 -gt.version=5.09.38.04 -structurelib.version=1.0.6 -ae2.version=rv3-beta-22 -applecore.version=1.7.10-1.2.1+107.59407 -buildcraft.version=7.1.11 -codechickenlib.version=1.1.3.140 -codechickencore.version=1.0.7.47 -cofhcore.cf=2246/920 -cofhcore.version=[1.7.10]3.1.4-329-dev -cofhlib.cf=2246/918 -cofhlib.version=[1.7.10]1.0.3-175-dev -enderio.cf=2219/296 -enderio.version=1.7.10-2.3.0.417_beta -enderiocore.version=1.7.10-0.1.0.25_beta -forestry.version=4.4.0.0 -gc.version=1.7-3.0.12.504 -ic2.version=2.2.790-experimental -nei.version=1.0.5.111 -railcraft.cf=2299/713 -railcraft.version=1.7.10-9.12.2.0 -nc.cf=2275/987 -nc.version=2.3.4a -immeng.cf=2299/20 -immeng.version=0.7.7-deobf -magneticraft.cf=2276/268 -magneticraft.version=0.6.1-final -mantle.version=0.3.2.jenkins187 -tconstruct.version=1.8.4.build951 -translocators.version=1.1.2.16 -yamcore.version=0.5.78 diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 0000000000..16bc437a75 --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,29 @@ +// Add your dependencies here + +dependencies { + compile("net.industrial-craft:industrialcraft-2:2.2.790-experimental:dev") + compile("com.github.GTNewHorizons:StructureLib:master-SNAPSHOT:deobf") + compile("codechicken:CodeChickenLib:1.7.10-1.1.3.140:dev") + compile("codechicken:CodeChickenCore:1.7.10-1.0.7.47:dev") + compile("codechicken:NotEnoughItems:1.7.10-1.0.5.111:dev") + + compileOnly("appeng:appliedenergistics2:rv3-beta-22:dev") + compileOnly("applecore:AppleCore:1.7.10-1.2.1+107.59407:api") + compileOnly("com.enderio.core:EnderCore:1.7.10-0.1.0.25_beta:dev") + compileOnly("com.enderio:EnderIO:1.7.10-2.3.0.417_beta:dev") { + transitive = false + } + compileOnly("commons-io:commons-io:2.4") + compileOnly("eu.usrv:YAMCore:1.7.10-0.5.78:deobf") + compileOnly("tconstruct:TConstruct:1.7.10-1.8.4.build951:deobf") + compileOnly("codechicken:Translocator:1.7.10-1.1.2.16:dev") + compileOnly("net.sengir.forestry:forestry_1.7.10:4.4.0.0:dev") + compileOnly("micdoodle8.mods:MicdoodleCore:1.7-3.0.12.504:Dev") + compileOnly("mods.railcraft:Railcraft_1.7.10:9.12.2.0:dev") + compileOnly("cofh:CoFHLib:[1.7.10]1.0.3-175-dev:dev") + + // Ivy dependencies + compileOnly name: "Galacticraft-API", version: "1.7-3.0.12.504", ext: 'jar' + compileOnly name: "GalacticraftCore-Dev", version: "1.7-3.0.12.504", ext: 'jar' + compileOnly name: 'IC2NuclearControl', version: "2.3.4a", ext: 'jar' +} diff --git a/gradle.properties b/gradle.properties index 638b8749a0..d0433fdbc3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,57 @@ -systemProp.org.gradle.internal.http.connectionTimeout=120000 -systemProp.org.gradle.internal.http.socketTimeout=120000 +modName = GregTech5-Unofficial +# This is a case-sensitive string to identify your mod. Convention is to use lower case. +modId = gregtech + +modGroup = gregtech + +# WHY is there no version field? +# The build script relies on git to provide a version via tags. It is super easy and will enable you to always know the +# code base or your binary. Check out this tutorial: https://blog.mattclemente.com/2017/10/13/versioning-with-git-tags/ + +minecraftVersion = 1.7.10 +forgeVersion = 10.13.4.1614 + +# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you +# restart Minecraft in development. Choose this dependent on your mod: +# Do you need consistent player progressing (for example Thaumcraft)? -> Select a name +# Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty +developmentEnvironmentUserName = "Developer" + +# Define a source file of your project with: +# public static final String VERSION = "GRADLETOKEN_VERSION"; +# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's +# version in @Mod([...], version = VERSION, [...]) +# Leave these properties empty to skip individual token replacements +replaceGradleTokenInFile = +gradleTokenModId = +gradleTokenModName = +gradleTokenVersion = +gradleTokenGroupName = + +# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise you can +# leave this property empty. +# Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api +apiPackage = + +# Specify the configuration file for Forge's access transformers here. I must be placed into /src/main/resources/META-INF/ +# Example value: mymodid_at.cfg +accessTransformersFile = + +# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! +usesMixins = false +# Specify the location of your implementation of IMixinPlugin. Leave it empty otherwise. +mixinPlugin = +# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +mixinsPackage = +# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! +# This parameter is for legacy compatability only +# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin +coreModClass = +# If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class +# that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! +containsMixinsAndOrCoreModOnly = false + +# If enabled, you may use 'shadowImplementation' for dependencies. They will be integrated in your jar. It is your +# responsibility check the licence and request permission for distribution, if required. +usesShadowedDependencies = false diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 99340b4ad1..5c2d1cf016 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 674bdda00e..5028f28f8e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/gradlew b/gradlew index cccdd3d517..83f2acfdc3 100755 --- a/gradlew +++ b/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -109,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000000..9618d8d960 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,100 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000000..09bbb514fc --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +before_install: + - ./gradlew setupCIWorkspace \ No newline at end of file diff --git a/repositories.gradle b/repositories.gradle new file mode 100644 index 0000000000..d2dbc14430 --- /dev/null +++ b/repositories.gradle @@ -0,0 +1,43 @@ +// Add any additional repositiroes for your dependencies here + +repositories { + maven { + name = "gt" + url = "https://gregtech.overminddl1.com/" + } + maven { + name = "chickenbones" + url = "https://nexus.covers1624.net/repository/maven-hosted/" + } + maven { + name = "ic2, forestry" + url = "http://downloads.gtnewhorizons.com/Mods_for_Jenkins/" + } + maven { // EnderIO & EnderCore + name = 'tterrag Repo' + url = "http://maven.tterrag.com" + } + maven { // TConstruct + name = 'DVS1 Maven FS' + url = 'http://dvs1.progwml6.com/files/maven' + } + maven { // AppleCore + url = "http://www.ryanliptak.com/maven/" + } + maven { // GalacticGreg, YAMCore,.. + name = 'UsrvDE' + url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/" + } + ivy { + name = 'gtnh_download_source_stupid_underscore_typo' + artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]") + } + ivy { + name = 'gtnh_download_source' + artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]") + } + maven { + name = "jitpack.io" + url = "https://jitpack.io" + } +} diff --git a/src/main/java/gregtech/GT_Mod.java b/src/main/java/gregtech/GT_Mod.java index 8980483f47..302696138e 100644 --- a/src/main/java/gregtech/GT_Mod.java +++ b/src/main/java/gregtech/GT_Mod.java @@ -78,7 +78,7 @@ import static gregtech.api.enums.GT_Values.MOD_ID_FR; @SuppressWarnings("ALL") @Mod(modid = "gregtech", name = "GregTech", version = "MC1710", useMetadata = false, dependencies = " required-after:IC2;" + - " required-after:" + StructureLib.MOD_ID + ";" + + " required-after:structurelib;" + " after:dreamcraft;" + " after:Forestry;" + " after:PFAAGeologica;" + diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 0ec17827de..4a8f9e05ce 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,10 +1,10 @@ [ { - "modid": "gregtech_addon", - "name": "GregTech-Addon", + "modid": "${modId}", + "name": "${modName}", "description": "This Mod adds the awesome Technology of GregTech-Intergalactical to your World!", - "mcversion": "1.7.10", - "version": "5.09", + "mcversion": "${minecraftVersion}", + "version": "${modVersion}", "logoFile": "/assets/gregtech_addon/textures/LogoGTI_Long.png", "url": "http://forum.industrial-craft.net/index.php?page=Thread&threadID=11488", "updateUrl": "", -- cgit