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:
parent
c5f7cfe6ee
commit
7714f8c98b
1 changed files with 56 additions and 40 deletions
96
build.gradle
96
build.gradle
|
@ -9,7 +9,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
apply plugin: 'net.minecraftforge.gradle'
|
apply plugin: 'net.minecraftforge.gradle'
|
||||||
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
version = '1.0'
|
version = '1.0'
|
||||||
|
@ -19,34 +19,49 @@ 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
|
|
||||||
source sourceSets.main
|
// Recommended logging level for the console
|
||||||
|
property 'forge.logging.console.level', 'debug'
|
||||||
|
|
||||||
|
mods {
|
||||||
|
examplemod {
|
||||||
|
source sourceSets.main
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
server = {
|
|
||||||
// recommended logging data for a userdev environment
|
server {
|
||||||
properties 'forge.logging.markers': 'SCAN,REGISTRIES,REGISTRYDUMP'
|
workingDirectory project.file('run')
|
||||||
// recommended logging level for the console
|
|
||||||
properties 'forge.logging.console.level': 'debug'
|
// Recommended logging data for a userdev environment
|
||||||
workingDirectory project.file('run').canonicalPath
|
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
||||||
source sourceSets.main
|
|
||||||
|
// Recommended logging level for the console
|
||||||
|
property 'forge.logging.console.level', 'debug'
|
||||||
|
|
||||||
|
mods {
|
||||||
|
examplemod {
|
||||||
|
source sourceSets.main
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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-Vendor": "examplemodsareus",
|
"Specification-Title": "examplemod",
|
||||||
"Specification-Version": "1", // We are version 1 of ourselves
|
"Specification-Vendor": "examplemodsareus",
|
||||||
"Implementation-Title": project.name,
|
"Specification-Version": "1", // We are version 1 of ourselves
|
||||||
"Implementation-Version": "${version}",
|
"Implementation-Title": project.name,
|
||||||
"Implementation-Vendor" :"examplemodsareus",
|
"Implementation-Version": "${version}",
|
||||||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")],)
|
"Implementation-Vendor" :"examplemodsareus",
|
||||||
|
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
|
||||||
|
])
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue