Mindustry/ios/build.gradle

97 lines
2.4 KiB
Groovy
Raw Normal View History

2022-06-06 22:31:38 +07:00
buildscript{
repositories{
mavenCentral()
}
dependencies{
2022-08-23 02:36:24 +07:00
classpath "com.mobidevelop.robovm:robovm-gradle-plugin:2.3.18"
2022-06-06 22:31:38 +07:00
}
}
apply plugin: "java"
apply plugin: "robovm"
task incrementConfig{
def vfile = file('robovm.properties')
def bversion = getBuildVersion()
def props = new Properties()
if(vfile.exists()){
props.load(new FileInputStream(vfile))
}else{
props['app.id'] = 'io.anuke.mindustry'
props['app.version'] = '7.0'
props['app.mainclass'] = 'mindustry.IOSLauncher'
props['app.executable'] = 'IOSLauncher'
props['app.name'] = 'Mindustry'
}
props['app.build'] = (!props.containsKey("app.build") ? 40 : props['app.build'].toInteger() + 1) + ""
if(bversion != "custom build"){
props['app.version'] = versionNumber + "." + bversion + (bversion.contains(".") ? "" : ".0")
}
props.store(vfile.newWriter(), null)
}
dependencies{
implementation project(":core")
implementation arcModule("natives:natives-ios")
implementation arcModule("natives:natives-freetype-ios")
implementation arcModule("backends:backend-robovm")
compileOnly project(":annotations")
}
2019-04-08 20:03:18 +07:00
sourceSets.main.java.srcDirs = ["src/"]
2018-04-28 03:01:37 +07:00
2019-04-08 20:03:18 +07:00
ext{
2019-12-26 00:06:19 +07:00
mainClassName = "mindustry.ios.IOSLauncher"
2018-04-28 03:01:37 +07:00
}
2019-08-15 00:10:29 +07:00
task copyAssets(){
2019-08-15 00:53:23 +07:00
doLast{
2019-08-15 07:50:26 +07:00
delete{
delete "assets/"
}
2019-08-15 00:10:29 +07:00
2019-08-15 07:50:26 +07:00
copy{
from "../core/assets"
into "assets/"
}
2019-08-15 00:53:23 +07:00
}
2019-08-15 00:10:29 +07:00
}
2021-03-30 05:33:03 +07:00
task copyNatives(){
doLast{
copy{
from "../../Arc/natives/natives-freetype-ios/libs", "../../Arc/natives/natives-ios/libs"
into "libs"
}
}
}
2019-08-26 23:23:09 +07:00
task deploy{
if(System.getProperty("os.name").contains("Mac")) dependsOn copyAssets
2019-08-26 23:23:09 +07:00
dependsOn createIPA
}
2021-03-30 06:05:55 +07:00
//must pack before deployment, as iOS never has the latest sprites.
2020-12-16 03:24:09 +07:00
copyAssets.dependsOn ":tools:pack"
2021-03-30 21:42:51 +07:00
copyAssets.dependsOn copyNatives
2018-04-28 03:01:37 +07:00
launchIPhoneSimulator.dependsOn build
launchIPadSimulator.dependsOn build
launchIOSDevice.dependsOn build
createIPA.dependsOn build
2019-04-08 20:03:18 +07:00
robovm{
archs = "thumbv7:arm64"
2020-10-30 02:44:06 +07:00
if(project.hasProperty("signIdentity")) println "iOS Sign Identity: " + project.property("signIdentity")
if(project.hasProperty("provisioningProfile")) println "iOS Provisioning Profile: " + project.property("provisioningProfile")
2020-10-30 03:07:01 +07:00
iosSignIdentity = project.properties["signIdentity"]
iosProvisioningProfile = project.properties["provisioningProfile"]
2020-10-30 02:10:09 +07:00
iosSkipSigning = false
2019-08-15 00:53:23 +07:00
}