Refactor forge and example run configs based on MinecraftForge/ForgeGradle#546

- Updated run config formats based on the refactored setup
- Removed old 'runclient' and 'runserver' JavaExec tasks, replacing them by creating the run configs using the refactored setup.
- Set 'assetIndex' environment variable from FG
- Updated MDK for new run config setup
This commit is contained in:
Jack Taylor 2019-02-19 08:39:05 +13:00 committed by tterrag
parent c5f7cfe6ee
commit 7714f8c98b

View file

@ -19,37 +19,52 @@ archivesBaseName = 'modid'
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
minecraft { minecraft {
// 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 always work. // 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. // Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_VERSION@' mappings channel: '@MAPPING_CHANNEL@', version: '@MAPPING_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.
//accessTransformer = file('my_at.cfg') // accessTransformer = file('build/resources/main/META-INF/accesstransformer.cfg')
// default run configurations. // Default run configurations.
// these can be tweaked, removed, or duplicated as needed. // These can be tweaked, removed, or duplicated as needed.
runs { runs {
client = { client {
// recommended logging data for a userdev environment workingDirectory project.file('run')
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console // Recommended logging data for a userdev environment
properties 'forge.logging.console.level': 'debug' property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
workingDirectory project.file('run').canonicalPath
// Recommended logging level for the console
property 'forge.logging.console.level', 'debug'
mods {
examplemod {
source sourceSets.main source sourceSets.main
} }
server = { }
// recommended logging data for a userdev environment }
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
// recommended logging level for the console server {
properties 'forge.logging.console.level': 'debug' workingDirectory project.file('run')
workingDirectory project.file('run').canonicalPath
// 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 source sourceSets.main
} }
} }
} }
}
}
dependencies { dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
@ -57,22 +72,21 @@ dependencies {
// The userdev artifact is a special name and will get all sorts of transformations applied to it. // The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft '@FORGE_GROUP@:@FORGE_NAME@:@FORGE_VERSION@' minecraft '@FORGE_GROUP@:@FORGE_NAME@:@FORGE_VERSION@'
// 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
// the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. // 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' // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// These dependencies get remapped to your current MCP mappings // These dependencies get remapped to your current MCP mappings
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// 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
@ -81,12 +95,14 @@ dependencies {
// Example for how to get properties into the manifest for reading by the runtime.. // Example for how to get properties into the manifest for reading by the runtime..
jar { jar {
manifest { manifest {
attributes(["Specification-Title": "examplemod", attributes([
"Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus", "Specification-Vendor": "examplemodsareus",
"Specification-Version": "1", // We are version 1 of ourselves "Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name, "Implementation-Title": project.name,
"Implementation-Version": "${version}", "Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus", "Implementation-Vendor" :"examplemodsareus",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],) "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
} }
} }