Update build.gradle to have single line for specifying minecraft version, and will update ForgeVersion.java as needed.
This commit is contained in:
parent
72f7c0be1f
commit
a9e4516068
14
build.gradle
14
build.gradle
|
@ -21,15 +21,17 @@ repositories {
|
||||||
url = "file:///home/cpw/projects/repo"
|
url = "file:///home/cpw/projects/repo"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: "maven"
|
apply plugin: "maven"
|
||||||
apply plugin: "net.minecraftforge.gradle.patcher"
|
apply plugin: "net.minecraftforge.gradle.patcher"
|
||||||
apply plugin: "net.minecraftforge.gradle.launch4j"
|
apply plugin: "net.minecraftforge.gradle.launch4j"
|
||||||
|
|
||||||
|
minecraft.version = "1.10.2"
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.10.2"
|
|
||||||
mappings = 'snapshot_nodoc_20160518'
|
mappings = 'snapshot_nodoc_20160518'
|
||||||
workspaceDir = "projects"
|
workspaceDir = "projects"
|
||||||
versionJson = "jsons/1.10.2-dev.json"
|
versionJson = "jsons/${minecraft.version}-dev.json"
|
||||||
buildUserdev = true
|
buildUserdev = true
|
||||||
buildInstaller = true
|
buildInstaller = true
|
||||||
installerVersion = "1.4"
|
installerVersion = "1.4"
|
||||||
|
@ -66,7 +68,7 @@ extractForgeResources { exclude "**/log4j2.xml" }
|
||||||
genGradleProjects { addTestCompileDep "junit:junit:4.12" }
|
genGradleProjects { addTestCompileDep "junit:junit:4.12" }
|
||||||
|
|
||||||
processJson {
|
processJson {
|
||||||
releaseJson = "jsons/1.10.2-rel.json"
|
releaseJson = "jsons/${minecraft.version}-rel.json"
|
||||||
addReplacements([
|
addReplacements([
|
||||||
"@minecraft_version@": project.minecraft.version,
|
"@minecraft_version@": project.minecraft.version,
|
||||||
"@version@": project.version,
|
"@version@": project.version,
|
||||||
|
@ -218,11 +220,13 @@ task ciWriteBuildNumber << {
|
||||||
def file = file("src/main/java/net/minecraftforge/common/ForgeVersion.java");
|
def file = file("src/main/java/net/minecraftforge/common/ForgeVersion.java");
|
||||||
def bn = System.getenv("BUILD_NUMBER")?:project.ext.properties.buildNumber?:0;
|
def bn = System.getenv("BUILD_NUMBER")?:project.ext.properties.buildNumber?:0;
|
||||||
def outfile = "";
|
def outfile = "";
|
||||||
def ln = System.getProperty('line.separator')
|
def ln = "\n"; //Linux line endings because we're on git!
|
||||||
|
|
||||||
file.eachLine{ String s ->
|
file.eachLine{ String s ->
|
||||||
if (s.matches("^ public static final int buildVersion = [\\d]+;\$"))
|
if (s.matches("^ public static final int buildVersion = [\\d]+;\$"))
|
||||||
s = " public static final int buildVersion = ${bn};";
|
s = " public static final int buildVersion = ${bn};";
|
||||||
|
if (s.matches('^ public static final String mcVersion = "[^\\"]+";'))
|
||||||
|
s = " public static final String mcVersion = \"${minecraft.version}\";";
|
||||||
outfile += (s+ln);
|
outfile += (s+ln);
|
||||||
}
|
}
|
||||||
file.write(outfile);
|
file.write(outfile);
|
||||||
|
@ -371,7 +375,7 @@ task resetBuildNumber << {
|
||||||
}
|
}
|
||||||
// re-add old tasks for jenkins compat
|
// re-add old tasks for jenkins compat
|
||||||
// should be remvoed, and the jenkisn fixed when no longer building with FG 1.2
|
// should be remvoed, and the jenkisn fixed when no longer building with FG 1.2
|
||||||
task setupForge { dependsOn 'setup' }
|
task setupForge { dependsOn 'setup', 'ciWriteBuildNumber' }
|
||||||
task buildPackages { dependsOn 'build' }
|
task buildPackages { dependsOn 'build' }
|
||||||
|
|
||||||
//Temporary hack to fix compile errors caused by mappings shading in Bootstrap
|
//Temporary hack to fix compile errors caused by mappings shading in Bootstrap
|
||||||
|
|
Loading…
Reference in New Issue