Added deployment scripts
This commit is contained in:
@@ -8,7 +8,7 @@ buildscript{
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies{
|
dependencies{
|
||||||
classpath 'com.android.tools.build:gradle:3.4.2'
|
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
21
build.gradle
21
build.gradle
@@ -314,3 +314,24 @@ project(":net"){
|
|||||||
compile "org.lz4:lz4-java:1.4.1"
|
compile "org.lz4:lz4-java:1.4.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task deployAll{
|
||||||
|
task cleanDeployOutput{
|
||||||
|
doFirst{
|
||||||
|
if("${getBuildVersion()}" == "custom build") throw new IllegalArgumentException("----\n\nSET A BUILD NUMBER FIRST!\n\n----")
|
||||||
|
if(!project.hasProperty("release")) throw new IllegalArgumentException("----\n\nSET THE RELEASE PROJECT PROPERTY FIRST!\n\n----")
|
||||||
|
|
||||||
|
delete{
|
||||||
|
delete "deploy/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependsOn cleanDeployOutput
|
||||||
|
dependsOn "desktop-sdl:packrLinux64"
|
||||||
|
dependsOn "desktop-sdl:packrWindows64"
|
||||||
|
dependsOn "desktop-sdl:packrWindows32"
|
||||||
|
dependsOn "desktop-sdl:packrMacOS"
|
||||||
|
dependsOn "server:deploy"
|
||||||
|
dependsOn "android:deploy"
|
||||||
|
}
|
||||||
Binary file not shown.
@@ -227,12 +227,14 @@ public class TechTree implements ContentList{
|
|||||||
|
|
||||||
node(turbineGenerator, () -> {
|
node(turbineGenerator, () -> {
|
||||||
node(thermalGenerator, () -> {
|
node(thermalGenerator, () -> {
|
||||||
node(rtgGenerator, () -> {
|
|
||||||
node(differentialGenerator, () -> {
|
node(differentialGenerator, () -> {
|
||||||
node(thoriumReactor, () -> {
|
node(thoriumReactor, () -> {
|
||||||
node(impactReactor, () -> {
|
node(impactReactor, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
node(rtgGenerator, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
import com.badlogicgames.packr.Packr
|
||||||
|
import com.badlogicgames.packr.PackrConfig
|
||||||
|
|
||||||
apply plugin: "java"
|
apply plugin: "java"
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
@@ -7,7 +10,10 @@ project.ext.mainClassName = "io.anuke.mindustry.desktopsdl.DesktopLauncher"
|
|||||||
project.ext.assetsDir = new File("../core/assets")
|
project.ext.assetsDir = new File("../core/assets")
|
||||||
|
|
||||||
def IKVM_DIR = System.env.IKVM_HOME
|
def IKVM_DIR = System.env.IKVM_HOME
|
||||||
def getTarget = { return project.hasProperty("target") ? project.properties["target"] : "windows" }
|
//def getTarget = { return project.hasProperty("target") ? project.properties["target"] : "windows" }
|
||||||
|
|
||||||
|
def JDK_DIR = "$System.env.PACKR_DIR"
|
||||||
|
def ICON_DIR = new File("core/assets/icons/icon.icns")
|
||||||
|
|
||||||
task run(dependsOn: classes, type: JavaExec){
|
task run(dependsOn: classes, type: JavaExec){
|
||||||
main = project.mainClassName
|
main = project.mainClassName
|
||||||
@@ -29,24 +35,27 @@ task run(dependsOn: classes, type: JavaExec){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task dist(type: Jar, dependsOn: classes){
|
|
||||||
|
|
||||||
|
["Windows", "Linux", "Mac", "All"].each{ target ->
|
||||||
|
task "dist$target"(type: Jar, dependsOn: classes){
|
||||||
from files(sourceSets.main.output.classesDirs)
|
from files(sourceSets.main.output.classesDirs)
|
||||||
from files(sourceSets.main.output.resourcesDir)
|
from files(sourceSets.main.output.resourcesDir)
|
||||||
from {configurations.compile.collect {zipTree(it)}}
|
from {configurations.compile.collect {zipTree(it)}}
|
||||||
from files(project.assetsDir)
|
from files(project.assetsDir)
|
||||||
|
|
||||||
//use target = all for all platforms
|
|
||||||
def target = getTarget()
|
|
||||||
if(target.contains("windows")) exclude('**.so', "**.dylib")
|
if(target.contains("windows")) exclude('**.so', "**.dylib")
|
||||||
if(target == "mac") exclude('**.so', "**.dll")
|
if(target == "mac") exclude('**.so', "**.dll")
|
||||||
if(target == "linux") exclude('**.dll', "**.dylib")
|
if(target == "linux") exclude('**.dll', "**.dylib")
|
||||||
archivesBaseName = appName + "-" + target
|
archiveName = "$appName-${target}.jar"
|
||||||
|
|
||||||
manifest{
|
manifest{
|
||||||
attributes 'Main-Class': project.mainClassName
|
attributes 'Main-Class': project.mainClassName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
task ikZip(type: Zip){
|
task ikZip(type: Zip){
|
||||||
def filename = "$appName-${getTarget()}-${version}"
|
def filename = "$appName-${getTarget()}-${version}"
|
||||||
|
|
||||||
@@ -83,5 +92,85 @@ task ikdist{
|
|||||||
into folder
|
into folder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
PackrConfig.Platform.values().each{ platform ->
|
||||||
|
task "packr${platform.toString()}"{
|
||||||
|
def platformName = platform.toString().replace('64', '').replace('32', '').replace('MacOS', 'Mac')
|
||||||
|
|
||||||
|
dependsOn "dist$platformName"
|
||||||
|
|
||||||
|
doLast{
|
||||||
|
copy{
|
||||||
|
into "build/packr/"
|
||||||
|
rename("$appName-${platformName}.jar", "desktop.jar")
|
||||||
|
from "build/libs/$appName-${platformName}.jar"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete{
|
||||||
|
delete "build/packr/output/"
|
||||||
|
}
|
||||||
|
|
||||||
|
if(platform == PackrConfig.Platform.Windows32 || platform == PackrConfig.Platform.Windows64){
|
||||||
|
copy{
|
||||||
|
into "build/packr/output"
|
||||||
|
from "${JDK_DIR}/templates/${platform.toString().toLowerCase()}"
|
||||||
|
}
|
||||||
|
|
||||||
|
copy{
|
||||||
|
into "build/packr/output"
|
||||||
|
rename("$appName-${platformName}.jar", "desktop.jar")
|
||||||
|
from "build/libs/$appName-${platformName}.jar"
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
def config = new PackrConfig()
|
||||||
|
config.with{
|
||||||
|
config.executable = appName
|
||||||
|
config.platform = platform
|
||||||
|
verbose = true
|
||||||
|
bundleIdentifier = getPackage() + ".mac"
|
||||||
|
iconResource = ICON_DIR
|
||||||
|
outDir = file("build/packr/output")
|
||||||
|
mainClass = project.ext.mainClassName
|
||||||
|
classpath = ["desktop-sdl/build/packr/desktop.jar"]
|
||||||
|
removePlatformLibs = ["desktop-sdl/build/packr/desktop.jar"]
|
||||||
|
|
||||||
|
vmArgs = ["Djava.net.preferIPv4Stack=true"]
|
||||||
|
minimizeJre = "../desktop/packr_minimize.json"
|
||||||
|
jdk = JDK_DIR + "jdk-${platform.toString().toLowerCase()}.zip"
|
||||||
|
|
||||||
|
if(platform == PackrConfig.Platform.MacOS){
|
||||||
|
vmArgs += "XstartOnFirstThread"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
new Packr().pack(config)
|
||||||
|
|
||||||
|
if(platform == PackrConfig.Platform.MacOS){
|
||||||
|
copy{
|
||||||
|
into "build/packr/" + appName + ".app/Contents/"
|
||||||
|
from "build/packr/Contents/"
|
||||||
|
}
|
||||||
|
|
||||||
|
delete{
|
||||||
|
delete "build/packr/Contents/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "zip${platform.toString()}"(type: Zip){
|
||||||
|
from "build/packr/output"
|
||||||
|
archiveName "${generateDeployName(platform.toString())}.zip"
|
||||||
|
destinationDir(file("../deploy"))
|
||||||
|
|
||||||
|
doLast{
|
||||||
|
delete{
|
||||||
|
delete "build/packr/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
finalizedBy "zip${platform.toString()}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.badlogicgames.packr.PackrConfig
|
|||||||
def JDK_DIR = "$System.env.PACKR_DIR"
|
def JDK_DIR = "$System.env.PACKR_DIR"
|
||||||
def ICON_DIR = new File("core/assets/icons/icon.icns")
|
def ICON_DIR = new File("core/assets/icons/icon.icns")
|
||||||
|
|
||||||
|
/*
|
||||||
ext.getPlatform = {
|
ext.getPlatform = {
|
||||||
def lc = project.hasProperty("platform") ? platform.toLowerCase() : ""
|
def lc = project.hasProperty("platform") ? platform.toLowerCase() : ""
|
||||||
if(lc == "windows64"){
|
if(lc == "windows64"){
|
||||||
@@ -27,7 +28,7 @@ ext.getPlatform = {
|
|||||||
}else{
|
}else{
|
||||||
throw new InvalidUserDataException("Invalid platform. Set platform with -Pplatform=windows64/windows32/linux/mac")
|
throw new InvalidUserDataException("Invalid platform. Set platform with -Pplatform=windows64/windows32/linux/mac")
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
task run(dependsOn: classes, type: JavaExec){
|
task run(dependsOn: classes, type: JavaExec){
|
||||||
main = project.mainClassName
|
main = project.mainClassName
|
||||||
@@ -71,108 +72,66 @@ task dist(type: Jar){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//note: call desktop:dist beforehand
|
PackrConfig.Platform.values().each{ platform ->
|
||||||
task packrCmd(){
|
task "packr${platform.toString()}"{
|
||||||
|
|
||||||
doLast{
|
doLast{
|
||||||
|
if(platform == PackrConfig.Platform.Windows32 || platform == PackrConfig.Platform.Windows64){
|
||||||
|
copy{
|
||||||
|
into "packr-out/"
|
||||||
|
from "${JDK_DIR}/templates/${platform.toString().toLowerCase()}"
|
||||||
|
}
|
||||||
|
|
||||||
|
copy{
|
||||||
|
into "packr-out/"
|
||||||
|
rename("desktop-release.jar", "desktop.jar")
|
||||||
|
from "../desktop-sdl/build/libs/desktop.jar"
|
||||||
|
}
|
||||||
|
}else{
|
||||||
def config = new PackrConfig()
|
def config = new PackrConfig()
|
||||||
config.with{
|
config.with{
|
||||||
config.executable = appName
|
config.executable = appName
|
||||||
|
config.platform = platform
|
||||||
verbose = true
|
verbose = true
|
||||||
platform = getPlatform()
|
|
||||||
bundleIdentifier = getPackage() + ".mac"
|
bundleIdentifier = getPackage() + ".mac"
|
||||||
iconResource = ICON_DIR
|
iconResource = ICON_DIR
|
||||||
outDir = file("packr-out/")
|
outDir = file("packr-out/")
|
||||||
mainClass = project.ext.mainClassName
|
mainClass = project.ext.mainClassName
|
||||||
classpath = ["desktop/build/libs/desktop-release.jar"]
|
classpath = ["desktop-sdl/build/libs/desktop.jar"]
|
||||||
removePlatformLibs = ["desktop/build/libs/desktop-release.jar"]
|
removePlatformLibs = ["desktop-sdl/build/libs/desktop.jar"]
|
||||||
|
|
||||||
vmArgs = ["Djava.net.preferIPv4Stack=true"]
|
vmArgs = ["Djava.net.preferIPv4Stack=true"]
|
||||||
minimizeJre = "desktop/packr_minimize.json"
|
minimizeJre = "desktop/packr_minimize.json"
|
||||||
jdk = JDK_DIR + "jdk-${getPlatform().toString().toLowerCase()}.zip"
|
jdk = JDK_DIR + "jdk-${platform.toString().toLowerCase()}.zip"
|
||||||
|
|
||||||
if(getPlatform() == PackrConfig.Platform.MacOS){
|
if(platform == PackrConfig.Platform.MacOS){
|
||||||
vmArgs += "XstartOnFirstThread"
|
vmArgs += "XstartOnFirstThread"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
new Packr().pack(config)
|
new Packr().pack(config)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task copyTemplate(){
|
if(platform == PackrConfig.Platform.MacOS){
|
||||||
doLast{
|
|
||||||
copy{
|
copy{
|
||||||
into "packr-out/"
|
|
||||||
from "${JDK_DIR}/templates/${getPlatform().toString().toLowerCase()}"
|
|
||||||
}
|
|
||||||
|
|
||||||
copy{
|
|
||||||
into "packr-out/"
|
|
||||||
from "build/libs/desktop-release.jar"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task packrZip(){
|
|
||||||
task clearOut(type: Delete){
|
|
||||||
doLast{
|
|
||||||
delete "packr-out/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task fixMac(type: Copy){
|
|
||||||
dependsOn "packrCmd"
|
|
||||||
|
|
||||||
into "packr-out/" + appName + ".app/Contents/"
|
into "packr-out/" + appName + ".app/Contents/"
|
||||||
from "packr-out/Contents/"
|
from "packr-out/Contents/"
|
||||||
|
}
|
||||||
|
|
||||||
doLast{
|
|
||||||
delete{
|
delete{
|
||||||
delete "packr-out/Contents/"
|
delete "packr-out/Contents/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task fixWindows32(type: Copy){
|
task "zip${platform.toString()}"(type: Zip){
|
||||||
dependsOn "packrCmd"
|
|
||||||
|
|
||||||
into "packr-out/jre/bin/"
|
|
||||||
from JDK_DIR + "zip.dll"
|
|
||||||
rename("zip.dll", "ojdkbuild_zlib.dll")
|
|
||||||
|
|
||||||
doLast{
|
|
||||||
copy{
|
|
||||||
into "packr-out/jre/bin/"
|
|
||||||
from JDK_DIR + "zip.dll"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
finalizedBy "clearOut"
|
|
||||||
|
|
||||||
if(project.hasProperty("platform")){
|
|
||||||
def plat = getPlatform()
|
|
||||||
if(plat == PackrConfig.Platform.Windows32 || plat == PackrConfig.Platform.Windows64){
|
|
||||||
dependsOn "copyTemplate"
|
|
||||||
}else{
|
|
||||||
dependsOn "packrCmd"
|
|
||||||
|
|
||||||
if(getPlatform() == PackrConfig.Platform.MacOS){
|
|
||||||
dependsOn "fixMac"
|
|
||||||
}
|
|
||||||
|
|
||||||
if(getPlatform() == PackrConfig.Platform.Windows32){
|
|
||||||
dependsOn "fixWindows32"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task rzip(type: Zip){
|
|
||||||
from "packr-out/"
|
from "packr-out/"
|
||||||
archiveName "${generateDeployName(getPlatform().toString())}.zip"
|
archiveName "${generateDeployName(platform.toString())}.zip"
|
||||||
destinationDir(file("packr-export"))
|
destinationDir(file("packr-export"))
|
||||||
}
|
}
|
||||||
|
|
||||||
finalizedBy 'rzip'
|
finalizedBy 'rzip'
|
||||||
|
|
||||||
|
delete "packr-out/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user