diff --git a/.gitignore b/.gitignore index 49101653..4a0ea1e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,42 +1,29 @@ -#ant stuff -/bin/ -/download/ -#Remove OS generated garbage -*/.DS_Store -.DS_Store -.DS_Store? -.Spotlight-V100 -.Trashes -Icon? -ehthumbs.db -Thumbs.db -#gradle stuff -/.gradle +.gradle +.settings +/.idea/ +/run/ /build/ -/run*/ -/ui/ -gradle-app.setting -#IDEA files from Gradle -.idea/ -/*.iml -/*.ipr -/*.iws -#Vim backups -*~ -#manual version override -version.properties -#eclipse stuffs -/.classpath -/.project -/.settings/ /eclipse/ -/debug/ -*.lock -/.metadata/ +.classpath +.project +/bin/ /config/ +/crash-reports/ /logs/ options.txt /saves/ -/out -libs/ -*.bat +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 +src/main/resources/mixins.*.json diff --git a/build.gradle b/build.gradle index dcdc1f7f..3041be10 100644 --- a/build.gradle +++ b/build.gradle @@ -1,38 +1,50 @@ -import org.codehaus.groovy.runtime.GStringImpl +//version: 1c18f850adb30b1b14861baf9f5c831841443bb0 +/* +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 -import java.util.Properties -import groovy.util.ConfigSlurper buildscript { repositories { - mavenCentral() - mavenLocal() - jcenter() - maven { - name = "gt" - url = "https://gregtech.overminddl1.com/" - } - maven { - name = "forge" - url = "http://files.minecraftforge.net/maven" - } maven { name = "jitpack" url = "https://jitpack.io" } + maven { + name = "forge" + url = "https://maven.minecraftforge.net" + } + maven { + name = "sonatype" + url = "https://oss.sonatype.org/content/repositories/snapshots/" + } } dependencies { - classpath "com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT" + classpath 'com.github.TheElan:ForgeGradle:1.2.2' } } 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' + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(8)) + } } -apply plugin: "java" -apply plugin: "idea" -apply plugin: "forge" -apply plugin: "signing" idea { module { @@ -42,139 +54,457 @@ idea { } } -java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 +checkPropertyExists("modName") +checkPropertyExists("modId") +checkPropertyExists("modGroup") +checkPropertyExists("autoUpdateBuildScript") +checkPropertyExists("minecraftVersion") +checkPropertyExists("forgeVersion") +checkPropertyExists("replaceGradleTokenInFile") +checkPropertyExists("gradleTokenModId") +checkPropertyExists("gradleTokenModName") +checkPropertyExists("gradleTokenVersion") +checkPropertyExists("gradleTokenGroupName") +checkPropertyExists("apiPackage") +checkPropertyExists("accessTransformersFile") +checkPropertyExists("usesMixins") +checkPropertyExists("mixinPlugin") +checkPropertyExists("mixinsPackage") +checkPropertyExists("coreModClass") +checkPropertyExists("containsMixinsAndOrCoreModOnly") +checkPropertyExists("usesShadowedDependencies") +checkPropertyExists("developmentEnvironmentUserName") + +def checkPropertyExists(String propertyName) { + if (project.hasProperty(propertyName) == false) { + throw new GradleException("This project requires a property \"" + propertyName + "\"! Please add it your \"gradle.properties\". You can find all properties and their description here: https://github.com/SinTh0r4s/ExampleMod1.7.10/blob/main/gradle.properties") + } } -sourceSets { - main { - resources { - srcDir 'resources' +String targetPackage = "src/main/java/" + modGroup.toString().replaceAll("\\.", "/") +if(new File(targetPackage).exists() == false) { + throw new GradleException("Could not resolve \"modGroup\"! Could not find " + targetPackage) +} + +if(apiPackage) { + targetPackage = "src/main/java/" + modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString().replaceAll("\\.", "/") + if(new File(targetPackage).exists() == false) { + throw new GradleException("Could not resolve \"apiPackage\"! Could not find " + targetPackage) + } +} + +if(accessTransformersFile) { + targetPackage = "src/main/resources/META-INF/" + accessTransformersFile + if(new File(targetPackage).exists() == false) { + throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetPackage) + } +} + +if(usesMixins.toBoolean()) { + if(mixinsPackage.isEmpty() || mixinPlugin.isEmpty()) { + throw new GradleException("\"mixinPlugin\" requires \"mixinsPackage\" and \"mixinPlugin\" to be set!") + } + + targetPackage = "src/main/java/" + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinsPackage.toString().replaceAll("\\.", "/") + if(new File(targetPackage).exists() == false) { + throw new GradleException("Could not resolve \"mixinsPackage\"! Could not find " + targetPackage) + } + + String targetFile = "src/main/java/" + modGroup.toString().replaceAll("\\.", "/") + "/" + mixinPlugin.toString().replaceAll("\\.", "/") + ".java" + if(new File(targetFile).exists() == false) { + throw new GradleException("Could not resolve \"mixinPlugin\"! Could not find " + targetFile) + } +} + +if(coreModClass) { + String targetFile = "src/main/java/" + modGroup.toString().replaceAll("\\.", "/") + "/" + coreModClass.toString().replaceAll("\\.", "/") + ".java" + if(new File(targetFile).exists() == false) { + throw new GradleException("Could not resolve \"coreModClass\"! Could not find " + targetFile) + } +} + +configurations.all { + resolutionStrategy.cacheChangingModulesFor(0, TimeUnit.SECONDS) + + // 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) +} + +// Fix Jenkins' Git: chmod a file should not be detected as a change and append a '.dirty' to the version +'git config core.fileMode false'.execute() +// Pulls version from git tag +version = minecraftVersion + "-" + gitVersion() +group = modGroup +archivesBaseName = modId + +minecraft { + 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 } } } -// Define properties file -ext.configFile = file "build.properties" - -configFile.withReader { - // Load config. It shall from now be referenced as simply config or project.config - def prop = new Properties() - prop.load(it) - project.ext.config = new ConfigSlurper().parse prop +if(file("addon.gradle").exists()) { + apply from: "addon.gradle" } -// Finds and sets version data -task buildInfo { - def cmd = "git rev-parse --short HEAD" - def proc = cmd.execute() - proc.waitFor() - if (proc.exitValue() == 0) { - ext.revision = proc.text.trim() - } else { - ext.revision = "GITBORK" - } +apply from: 'repositories.gradle' - if (System.getenv().BUILD_NUMBER != null) { - ext.buildNum = "build${System.getenv().BUILD_NUMBER}" - } else { - ext.buildNum = "DEV.${project.buildInfo.revision}" - } -} -ext.artifact_version = 'NFG' -if (System.getenv().ARTIFACT_VERSION == null) { - artifact_version = "${config.mod_version}.${project.buildInfo.buildNum}" as GStringImpl -} -if (System.getenv().ARTIFACT_VERSION != null) { - artifact_version = "${System.getenv().ARTIFACT_VERSION}" as GStringImpl -} - -group = 'tconstruct' -version = "${config.minecraft_version}-${artifact_version}" - -minecraft { - version = config.minecraft_version + "-" + config.forge_version - runDir = 'run' - replace '${version}', project.version -} - -processResources -{ - inputs.property "version", artifact_version - inputs.property "MCversion", config.minecraft_version - - // Replace stuff in text files, not binaries. - from(sourceSets.main.resources.srcDirs) { - include '**/*.info' - // Replace version and MCversion - expand 'version':artifact_version,'MCversion':config.minecraft_version - } - - // Copy everything else that's not text - from(sourceSets.main.resources.srcDirs) { - exclude '**/*.info' - } +configurations { + implementation.extendsFrom(shadowImplementation) } repositories { - maven { - name 'CB Maven FS' - url "http://chickenbones.net/maven/" - } - maven { - name 'DVS1 Maven FS' - url 'http://dvs1.progwml6.com/files/maven' - } - maven { - name = 'code chicken lib' - url 'https://maven.cil.li/' + if(usesMixins.toBoolean()) { + maven { + name = "sponge" + url = "https://repo.spongepowered.org/repository/maven-public" + } + maven { + url = "https://jitpack.io" + } } } dependencies { - compile "mantle:Mantle:${config.minecraft_version}-${config.mantle_version}:deobf" - compile "codechicken:CodeChickenLib:${config.minecraft_version}-${config.CCLIB_version}:dev" - compile "codechicken:CodeChickenCore:${config.minecraft_version}-${config.ccc_version}:dev" - compile "codechicken:NotEnoughItems:${config.minecraft_version}-${config.NEI_version}:dev" - compile "codechicken:ForgeMultipart:${config.minecraft_version}-${config.fmp_version}:dev" - //compile "mcp.mobius.waila:Waila:${config.waila_version}:dev" + 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") + } } +apply from: 'dependencies.gradle' +task relocateShadowJar(type: ConfigureShadowRelocation) { + target = tasks.shadowJar + prefix = modGroup + ".shadow" +} -// Add Coremod Manifest -jar { +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" +} + +""" + } +} + +shadowJar { + 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 'FMLAT': 'TConstruct_at.cfg' + attributes(manifestAttributes) + } + + minimize() + configurations = [project.configurations.shadowImplementation] + dependsOn(relocateShadowJar) +} + +jar { + 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) + } + + if(usesShadowedDependencies.toBoolean()) { + dependsOn(shadowJar) + enabled = false } } -// Create deobf dev jars -task deobfJar(type: Jar) { +reobf { + if(usesMixins.toBoolean()) { + addExtraSrgFile mixinSrg + } +} + +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" + ] + } + } +} + +runClient { + def arguments = [] + + if(usesMixins.toBoolean()) { + arguments += [ + "--mods=../build/libs/$modId-${version}.jar", + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] + } + + if(developmentEnvironmentUserName) { + arguments += [ + "--username", + developmentEnvironmentUserName + ] + } + + args(arguments) +} + +runServer { + def arguments = [] + + if(usesMixins.toBoolean()) { + arguments += [ + "--mods=../build/libs/$modId-${version}.jar", + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] + } + + args(arguments) +} + +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 - getArchiveClassifier().set("deobf") - manifest { - attributes 'FMLAT': 'TConstruct_at.cfg' + 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) } } -// Create API library jar -task libJar(type: Jar) { - from(sourceSets.main.allSource) { - include "tconstruct/library/**/*" +task apiJar(type: Jar) { + from (sourceSets.main.allJava) { + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString() + '/**' } - getArchiveClassifier().set 'lib' -} -// Create Maven source jar -task sourceJar(type: Jar, dependsOn:classes) { - getArchiveClassifier().set 'sources' - from sourceSets.main.allSource + from (sourceSets.main.output) { + include modGroup.toString().replaceAll("\\.", "/") + "/" + apiPackage.toString() + '/**' + } + + from (sourceSets.main.resources.srcDirs) { + include("LICENSE") + } + + getArchiveClassifier().set('api') } artifacts { - archives deobfJar - archives libJar - archives sourceJar -} \ No newline at end of file + archives sourcesJar + archives devJar + if(apiPackage) { + archives apiJar + } +} + +// Updating +task updateBuildScript { + doLast { + if (updateBuildScript()) return + + print("Build script already up-to-date!") + } +} + +if (isNewBuildScriptVersionAvailable()) { + if (autoUpdateBuildScript.toBoolean()) { + updateBuildScript() + } else { + println("Build script update available! Run 'gradle updateBuildScript'") + } +} + +static URL availableBuildScriptUrl() { + new URL("https://raw.githubusercontent.com/SinTh0r4s/ExampleMod1.7.10/main/build.gradle") +} + +static boolean updateBuildScript() { + if (isNewBuildScriptVersionAvailable()) { + def buildscriptFile = new File("build.gradle") + availableBuildScriptUrl().withInputStream { i -> buildscriptFile.withOutputStream { it << i } } + print("Build script updated. Please REIMPORT the project or RESTART your IDE!") + return true + } + return false +} + +static boolean isNewBuildScriptVersionAvailable() { + Map parameters = ["connectTimeout": 2000, "readTimeout": 2000] + + String currentBuildScript = new File("build.gradle").getText() + String currentBuildScriptHash = getVersionHash(currentBuildScript) + String availableBuildScript = availableBuildScriptUrl().newInputStream(parameters).getText() + String availableBuildScriptHash = getVersionHash(availableBuildScript) + + boolean isUpToDate = currentBuildScriptHash.empty || availableBuildScriptHash.empty || currentBuildScriptHash == availableBuildScriptHash + return !isUpToDate +} + +static String getVersionHash(String buildScriptContent) { + String versionLine = buildScriptContent.find("^//version: [a-z0-9]*") + if(versionLine != null) { + return versionLine.split(": ").last() + } + return "" +} + +configure(updateBuildScript) { + group = 'forgegradle' + description = 'Updates the build script to the latest version' +} diff --git a/build.properties b/build.properties deleted file mode 100644 index a49d0a1b..00000000 --- a/build.properties +++ /dev/null @@ -1,9 +0,0 @@ -minecraft_version=1.7.10 -forge_version=10.13.4.1614-1.7.10 -mantle_version=0.3.2.jenkins187 -CCLIB_version=1.1.3.136 -NEI_version=1.0.4.106 -ccc_version=1.0.6.43 -mod_version=1.9.0.3-GTNH -waila_version=1.5.3_1.7.10 -fmp_version=1.1.2.334 diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 00000000..737a427d --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,9 @@ +// Add your dependencies here + +dependencies { + compile "mantle:Mantle:1.7.10-0.3.2.jenkins187: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.120:dev") + compile "codechicken:ForgeMultipart:1.7.10-1.2.0.344:dev" +} diff --git a/eclipse_formatter.xml b/eclipse_formatter.xml deleted file mode 100644 index a183bfaa..00000000 --- a/eclipse_formatter.xml +++ /dev/null @@ -1,291 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..a9ca3f7c --- /dev/null +++ b/gradle.properties @@ -0,0 +1,60 @@ +modName = Tinkers' Construct + +# This is a case-sensitive string to identify your mod. Convention is to use lower case. +modId = TConstruct + +modGroup = tconstruct + +# 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/ + +# Will update your build.gradle automatically whenever an update is available +autoUpdateBuildScript = false + +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 = TConstruct.java +gradleTokenModId = GRADLETOKEN_MODID +gradleTokenModName = +gradleTokenVersion = GRADLETOKEN_VERSION +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 = library + +# 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 = TConstruct_at.cfg + +# 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/gradlew b/gradlew index cccdd3d5..83f2acfd 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 index f9553162..9618d8d9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@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 @@ -14,7 +30,7 @@ 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= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..09bbb514 --- /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 00000000..0a09df69 --- /dev/null +++ b/repositories.gradle @@ -0,0 +1,16 @@ +// Add any additional repositiroes for your dependencies here + +repositories { + maven { + name 'CB Maven FS' + url "http://chickenbones.net/maven/" + } + maven { + name 'DVS1 Maven FS' + url 'http://dvs1.progwml6.com/files/maven' + } + maven { + name = 'code chicken lib' + url 'https://maven.cil.li/' + } +} diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 018a3bf1..00000000 --- a/settings.gradle +++ /dev/null @@ -1,19 +0,0 @@ -/* - * This settings file was auto generated by the Gradle buildInit task - * by 'sunstrike' at '21/11/13 14:14' with Gradle 1.9 - * - * The settings file is used to specify which projects to include in your build. - * In a single project build this file can be empty or even removed. - * - * Detailed information about configuring a multi-project build in Gradle can be found - * in the user guide at http://gradle.org/docs/1.9/userguide/multi_project_builds.html - */ - -/* -// To declare projects as part of a multi-project build use the 'include' method -include 'shared' -include 'api' -include 'services:webservice' -*/ - -rootProject.name = 'TConstruct' diff --git a/src/main/java/tconstruct/TConstruct.java b/src/main/java/tconstruct/TConstruct.java index 6ba78133..7caf421a 100644 --- a/src/main/java/tconstruct/TConstruct.java +++ b/src/main/java/tconstruct/TConstruct.java @@ -69,7 +69,7 @@ import java.util.Random; * @author mDiyo */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "${version}", +@Mod(modid = "TConstruct", name = "TConstruct", version = TConstruct.modVersion, dependencies = "required-after:Forge@[10.13.3.1384,11.14);" + "required-after:Mantle@[1.7.10-0.3.2,);" + "after:MineFactoryReloaded@[1.7.10R2.8.0RC7,);" + @@ -88,7 +88,7 @@ import java.util.Random; ) public class TConstruct { - public static final String modVersion = "${version}"; + public static final String modVersion = "GRADLETOKEN_VERSION"; /** The value of one ingot in millibuckets */ public static final int ingotLiquidValue = 144; public static final int oreLiquidValue = ingotLiquidValue * 2; @@ -98,7 +98,7 @@ public class TConstruct public static final int stoneLiquidValue = ingotLiquidValue/8; public static final int liquidUpdateAmount = 6; - public static final String modID = "TConstruct"; + public static final String modID = "GRADLETOKEN_MODID"; public static final Logger logger = LogManager.getLogger(modID); public static final PacketPipeline packetPipeline = new PacketPipeline(); public static Random random = new Random(); diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index edaa4d30..ce12df41 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,10 +1,10 @@ [ { - "modid": "TConstruct", - "name": "Tinkers' Construct", + "modid": "${modId}", + "name": "${modName}", "description": "A little of this, a little of that, a lot of tinkering, and a lot of tools", - "version": "${version}", - "mcversion": "${MCversion}", + "version": "${modVersion}", + "mcversion": "${minecraftVersion}", "url": "http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2218638-tinkers-construct", "updateUrl": "", "authorList": [