diff --git a/build.gradle b/build.gradle index a894de8227..b51258d6a0 100644 --- a/build.gradle +++ b/build.gradle @@ -7,6 +7,7 @@ buildscript { jcenter() } dependencies { + classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.0' classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6' classpath 'com.android.tools.build:gradle:3.0.1' classpath "com.badlogicgames.gdx:gdx-tools:1.9.8" @@ -24,6 +25,7 @@ allprojects { versionType = 'release' appName = 'Mindustry' gdxVersion = '1.9.8' + roboVMVersion = '2.3.0' aiVersion = '1.8.1' uCoreVersion = '55f0d90' @@ -103,6 +105,20 @@ project(":android") { } } +project(":ios") { + apply plugin: "java" + apply plugin: "robovm" + + + dependencies { + compile project(":core") + compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion" + compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion" + compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion" + compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios" + } +} + project(":core") { apply plugin: "java" diff --git a/desktop/build.gradle b/desktop/build.gradle index a84181ad30..618235efb0 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -10,7 +10,7 @@ def PACKR_DIR = "$System.env.PACKR_DIR" def ICON_DIR = new File("core/assets/sprites/icon.icns") ext.writeVersion = { - def pfile = new File('../core/assets/version.properties') + def pfile = new File('core/assets/version.properties') def props = new Properties() try{ diff --git a/ios/Info.plist.xml b/ios/Info.plist.xml new file mode 100644 index 0000000000..407bec75c5 --- /dev/null +++ b/ios/Info.plist.xml @@ -0,0 +1,59 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${app.name} + CFBundleExecutable + ${app.executable} + CFBundleIdentifier + ${app.id} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${app.name} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${app.version} + CFBundleSignature + ???? + CFBundleVersion + ${app.build} + LSRequiresIPhoneOS + + UIViewControllerBasedStatusBarAppearance + + UIStatusBarHidden + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + armv7 + opengles-2 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CFBundleIcons + + CFBundlePrimaryIcon + + CFBundleIconFiles + + Icon + Icon-72 + + + + + diff --git a/ios/build.gradle b/ios/build.gradle new file mode 100644 index 0000000000..b14d976190 --- /dev/null +++ b/ios/build.gradle @@ -0,0 +1,22 @@ +sourceSets.main.java.srcDirs = [ "src/" ] + +sourceCompatibility = '1.8' +[compileJava, compileTestJava]*.options*.encoding = 'UTF-8' + +ext { + mainClassName = "io.anuke.mindustry.IOSLauncher" +} + +launchIPhoneSimulator.dependsOn build +launchIPadSimulator.dependsOn build +launchIOSDevice.dependsOn build +createIPA.dependsOn build + +robovm { + archs = "thumbv7:arm64" +} + +eclipse.project { + name = appName + "-ios" + natures 'org.robovm.eclipse.RoboVMNature' +} \ No newline at end of file diff --git a/ios/data/Default-1024w-1366h@2x~ipad.png b/ios/data/Default-1024w-1366h@2x~ipad.png new file mode 100644 index 0000000000..b175eaab6d Binary files /dev/null and b/ios/data/Default-1024w-1366h@2x~ipad.png differ diff --git a/ios/data/Default-375w-667h@2x.png b/ios/data/Default-375w-667h@2x.png new file mode 100644 index 0000000000..f213ce60df Binary files /dev/null and b/ios/data/Default-375w-667h@2x.png differ diff --git a/ios/data/Default-414w-736h@3x.png b/ios/data/Default-414w-736h@3x.png new file mode 100644 index 0000000000..685ba51fcb Binary files /dev/null and b/ios/data/Default-414w-736h@3x.png differ diff --git a/ios/data/Default-568h@2x.png b/ios/data/Default-568h@2x.png new file mode 100644 index 0000000000..101752fe77 Binary files /dev/null and b/ios/data/Default-568h@2x.png differ diff --git a/ios/data/Default.png b/ios/data/Default.png new file mode 100644 index 0000000000..f1a5582a01 Binary files /dev/null and b/ios/data/Default.png differ diff --git a/ios/data/Default@2x.png b/ios/data/Default@2x.png new file mode 100644 index 0000000000..ca32f62fc2 Binary files /dev/null and b/ios/data/Default@2x.png differ diff --git a/ios/data/Default@2x~ipad.png b/ios/data/Default@2x~ipad.png new file mode 100644 index 0000000000..bb77ef073e Binary files /dev/null and b/ios/data/Default@2x~ipad.png differ diff --git a/ios/data/Default~ipad.png b/ios/data/Default~ipad.png new file mode 100644 index 0000000000..855e4f2ad9 Binary files /dev/null and b/ios/data/Default~ipad.png differ diff --git a/ios/data/Icon-72.png b/ios/data/Icon-72.png new file mode 100644 index 0000000000..8cc575912f Binary files /dev/null and b/ios/data/Icon-72.png differ diff --git a/ios/data/Icon-72@2x.png b/ios/data/Icon-72@2x.png new file mode 100644 index 0000000000..ec5e3803fa Binary files /dev/null and b/ios/data/Icon-72@2x.png differ diff --git a/ios/data/Icon.png b/ios/data/Icon.png new file mode 100644 index 0000000000..7f4bf36359 Binary files /dev/null and b/ios/data/Icon.png differ diff --git a/ios/data/Icon@2x.png b/ios/data/Icon@2x.png new file mode 100644 index 0000000000..eddc17c575 Binary files /dev/null and b/ios/data/Icon@2x.png differ diff --git a/ios/robovm.properties b/ios/robovm.properties new file mode 100644 index 0000000000..c47b07a461 --- /dev/null +++ b/ios/robovm.properties @@ -0,0 +1,6 @@ +app.version=1.0 +app.id=io.anuke.mindustry +app.mainclass=io.anuke.mindustry.IOSLauncher +app.executable=IOSLauncher +app.build=1 +app.name=Mindustry diff --git a/ios/robovm.xml b/ios/robovm.xml new file mode 100644 index 0000000000..ebce6c1b3c --- /dev/null +++ b/ios/robovm.xml @@ -0,0 +1,47 @@ + + ${app.executable} + ${app.mainclass} + ios + thumbv7 + ios + Info.plist.xml + + + ../core/assets + + ** + + true + + + data + + + + com.badlogic.gdx.scenes.scene2d.ui.* + com.badlogic.gdx.graphics.g3d.particles.** + com.android.okhttp.HttpHandler + com.android.okhttp.HttpsHandler + com.android.org.conscrypt.** + com.android.org.bouncycastle.jce.provider.BouncyCastleProvider + com.android.org.bouncycastle.jcajce.provider.keystore.BC$Mappings + com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi + com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$Std + com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi + com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryOpenSSL + org.apache.harmony.security.provider.cert.DRLCertFactory + org.apache.harmony.security.provider.crypto.CryptoProvider + + + z + + + UIKit + OpenGLES + QuartzCore + CoreGraphics + OpenAL + AudioToolbox + AVFoundation + + diff --git a/ios/src/io/anuke/mindustry/IOSLauncher.java b/ios/src/io/anuke/mindustry/IOSLauncher.java new file mode 100644 index 0000000000..8bfc8106dd --- /dev/null +++ b/ios/src/io/anuke/mindustry/IOSLauncher.java @@ -0,0 +1,20 @@ +package io.anuke.mindustry; + +import com.badlogic.gdx.backends.iosrobovm.IOSApplication; +import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration; +import org.robovm.apple.foundation.NSAutoreleasePool; +import org.robovm.apple.uikit.UIApplication; + +public class IOSLauncher extends IOSApplication.Delegate { + @Override + protected IOSApplication createApplication() { + IOSApplicationConfiguration config = new IOSApplicationConfiguration(); + return new IOSApplication(new Mindustry(), config); + } + + public static void main(String[] argv) { + NSAutoreleasePool pool = new NSAutoreleasePool(); + UIApplication.main(argv, null, IOSLauncher.class); + pool.close(); + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 420a1f02eb..ac95167d02 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,4 @@ -include 'desktop', 'html', 'core', 'android', 'kryonet', 'server' +include 'desktop', 'html', 'core', 'android', 'kryonet', 'server', 'ios' if(System.properties["release"] == null || System.properties["release"].equals("false")){ if (new File(settingsDir, '../uCore').exists()) {