diff --git a/build.bat b/build.bat index 1123b66acb..d881dd204d 100644 --- a/build.bat +++ b/build.bat @@ -1,3 +1 @@ -IF EXIST ".\build" RD /S /Q ".\build" - cmd /k gradlew build \ No newline at end of file diff --git a/build.gradle b/build.gradle index c2d2e28dd6..56a6735f5b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,111 +1,148 @@ buildscript { repositories { + maven { url = 'https://files.minecraftforge.net/maven' } jcenter() - maven { - name = "Forge" - url = "http://files.minecraftforge.net/maven" - } - maven { - name = "Sonatype" - url = 'https://oss.sonatype.org/content/groups/public' - } + mavenCentral() } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true } } +apply plugin: 'net.minecraftforge.gradle' +// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. +apply plugin: 'eclipse' +apply plugin: 'maven-publish' -plugins { - id 'com.matthewprenger.cursegradle' version '1.0.9' -} +version = "${version_minecraft}-${version_compile}" +group = '' // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "${compile_name}" -repositories { - maven { - name = "CurseForge" - url = "https://minecraft.curseforge.com/api/maven/" - } -} +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. -apply plugin: 'net.minecraftforge.gradle.forge' -//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup. +minecraft { + // The mappings can be changed at any time, and must be in the following format. + // snapshot_YYYYMMDD Snapshot are built nightly. + // stable_# Stables are built at the discretion of the MCP team. + // Use non-default mappings at your own risk. they may not always work. + // Simply re-run your setup task after changing the mappings to update your workspace. + mappings channel: 'snapshot', version: "${version_mappings}" + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. + + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') + // Default run configurations. + // These can be tweaked, removed, or duplicated as needed. + runs { + client { + workingDirectory project.file('run') -version = "${version_minecraft}-${version_compile}" -group= "" -archivesBaseName = "${compile_name}" + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' -repositories { - maven { - //JEI files - url = "http://dvs1.progwml6.com/files/maven" - } - maven { - // location of a maven mirror for JEI files, as a fallback - name = "ModMaven" - url = "http://modmaven.k-4u.nl" + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + + mods { + examplemod { + source sourceSets.main + } + } + } + + server { + workingDirectory project.file('run') + + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + + mods { + examplemod { + source sourceSets.main + } + } + } + + data { + workingDirectory project.file('run') + + // Recommended logging data for a userdev environment + property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' + + // Recommended logging level for the console + property 'forge.logging.console.level', 'debug' + + args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/') + + mods { + examplemod { + source sourceSets.main + } + } + } } } dependencies { - //Thut Core - deobfCompile "thutcore:thutcore:${version_minecraft}:${version_thutcore}" - //Thut Wearables - deobfCompile "thut-wearables:thut-wearables:release:deobf" - - //Pokecube Core - deobfCompile "pokecube-core:pokecube-core:release:deobf" - //Pokecube Revival - deobfCompile "pokecube-revival:pokecube-revival:release:deobf" - //Pokecube Mobs - deobfCompile "pokecube-mobs:pokecube-mobs:release:deobf" -} + // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed + // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. + // The userdev artifact is a special name and will get all sorts of transformations applied to it. + minecraft "net.minecraftforge:forge:${version_minecraft}-${version_forge}" -sourceCompatibility = 1.8 -targetCompatibility = 1.8 + // You may put jars on which you depend on in ./libs or you may define them like so.. + // compile "some.group:artifact:version:classifier" + // compile "some.group:artifact:version" -minecraft { - version = "${version_long}" - runDir = "run" - mappings = "${version_mappings}" - useDepAts = true - - replace "@VERSION", project.version_compile - replaceIn "WikiWriteMod.java" - replace "@MINVERSION", project.version_compat - replaceIn "WikiWriteMod.java" -} + // Real examples + // 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 -task deobfJar(type: Jar) { - from sourceSets.main.output - classifier = 'deobf' -} + // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. + // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // These dependencies get remapped to your current MCP mappings + // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // For more info... + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html + // http://www.gradle.org/docs/current/userguide/dependency_management.html -artifacts { - archives deobfJar } +// Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { - attributes "FMLAT": "${at_file}" - } + attributes 'FMLAT': 'accesstransformer.cfg', + "Specification-Title": "${compile_name}", + "Specification-Vendor": "${author_name}", + "Specification-Version": "1", // We are version 1 of ourselves + "Implementation-Title": project.name, + "Implementation-Version": "${version_compile}", + "Implementation-Vendor" :"${author_name}", + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + } } -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 'version':project.version, 'mcversion':project.minecraft.version +// Example configuration to allow publishing using the maven-publish task +// we define a custom artifact that is sourced from the reobfJar output task +// and then declare that to be published +// Note you'll need to add a repository here +def reobfFile = file("$buildDir/reobfJar/output.jar") +def reobfArtifact = artifacts.add('default', reobfFile) { + type 'jar' + builtBy 'reobfJar' +} +publishing { + publications { + mavenJava(MavenPublication) { + artifact reobfArtifact + } } - - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' + repositories { + maven { + url "file:///${project.projectDir}/mcmodsrepo" + } } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 7c32d3a523..dd0f575412 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,14 +1,13 @@ -# Sets default memory used for gradle commands. Can be overridden by user or command line properties. -# This is required to provide enough memory for the Minecraft decompilation process. -org.gradle.jvmargs=-Xmx3G -version_long=1.12.2-14.23.4.2705 -version_forge=14.23.4.2705 -version_minecraft=1.12.2 -version_mcsupport=[1.12] -version_mappings=snapshot_20171003 -version_thutcore=5.21.0 - -compile_name=pokecube-aio -version_compile=1.15.11 -version_compat=1.15.0 -at_file=pokecube_at.cfg +# Sets default memory used for gradle commands. Can be overridden by user or command line properties. +# This is required to provide enough memory for the Minecraft decompilation process. +org.gradle.jvmargs=-Xmx3G +org.gradle.daemon=false + +version_forge=28.1.111 +version_minecraft=1.14.4 +version_mcsupport=[1.14.4] +version_mappings=20190719-1.14.3 + +compile_name=pokecube-aio +version_compile=2.0.0 +author_name=Thutmose diff --git a/runSetup.bat b/runSetup.bat index b65c824bd1..2611772b31 100644 --- a/runSetup.bat +++ b/runSetup.bat @@ -1 +1 @@ -cmd /k gradlew setupDecompWorkspace eclipse \ No newline at end of file +cmd /k gradlew genEclipseRuns eclipse \ No newline at end of file