-
Notifications
You must be signed in to change notification settings - Fork 1
Added template resources for iOS (MultiOsEngine) #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| buildscript { | ||
| repositories { | ||
| mavenCentral() | ||
| } | ||
| dependencies { | ||
| classpath "org.multi-os-engine:moe-gradle:$multiOsEngineVersion" | ||
| } | ||
| } | ||
|
|
||
| apply plugin: 'moe' | ||
|
|
||
| // Exclude all files from Gradle's test runner | ||
| test { exclude '**' } | ||
|
|
||
| // Copy all xcframeworks to xcode/native/ios | ||
| // They need to be picked up from there for linking in XCode | ||
| task copyNatives { | ||
| doLast { | ||
| file("xcode/native/ios/").mkdirs(); | ||
| def subDir = "META-INF/robovm/ios/libs/" | ||
| configurations.natives.files.each { jar -> | ||
| copy { | ||
| from zipTree(jar) | ||
| include "$subDir/*.xcframework/**" | ||
| into("xcode/native/ios/") | ||
| eachFile { file -> | ||
| file.path = file.path.replaceFirst("^$subDir", '') | ||
| } | ||
| includeEmptyDirs(false) | ||
| } | ||
| } | ||
|
|
||
| def LD_FLAGS = "" | ||
| def outFlags = file("xcode/ios-moe/custom.xcconfig"); | ||
| outFlags.write LD_FLAGS | ||
|
|
||
| def proguard = file("proguard.append.cfg") | ||
| } | ||
| } | ||
|
|
||
| configurations { natives } | ||
|
|
||
| ext.jmonkeyengineVersion = '[JME_VERSION]' | ||
|
|
||
| dependencies { | ||
| implementation project(':game') | ||
|
|
||
| implementation "org.jmonkeyengine:jme3-ios:" + jmonkeyengineVersion | ||
| natives "org.jmonkeyengine:jme3-ios-native:" + jmonkeyengineVersion | ||
| } | ||
|
|
||
| // Setup Multi-OS Engine | ||
| moe { | ||
| xcode { | ||
| project 'xcode/ios-moe.xcodeproj' | ||
| mainTarget 'ios-moe' | ||
| testTarget 'ios-moe-Test' | ||
| } | ||
| } | ||
|
|
||
| moeMainReleaseIphoneosXcodeBuild.dependsOn copyNatives | ||
| moeMainDebugIphoneosXcodeBuild.dependsOn copyNatives | ||
| moeMainReleaseIphonesimulatorXcodeBuild.dependsOn copyNatives | ||
| moeMainDebugIphonesimulatorXcodeBuild.dependsOn copyNatives | ||
|
|
||
| if (System.getenv('PLATFORM_NAME') != null) { | ||
| moeXcodeInternal.dependsOn copyNatives | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| #-dontshrink | ||
| #-dontoptimize | ||
| #-dontusemixedcaseclassnames | ||
| #-dontskipnonpubliclibraryclasses | ||
| #-dontskipnonpubliclibraryclassmembers | ||
| #-dontpreverify | ||
| # Issue : (Index 39424 out of bounds for length 635) | ||
| #-keep class com.** { *; } | ||
| #-keep enum com.** { *; } | ||
|
|
||
| # All jme3 | ||
| -keep class com.jme3.** {*;} | ||
| -keep enum com.jme3.** {*;} | ||
| -keep class de.lessvoid.nifty.** {*;} | ||
| -keep enum de.lessvoid.nifty.** {*;} | ||
|
|
||
| # Previous jme3 related classes | ||
| -keep public class com.jme3.system.ios.*{public *;} | ||
| -keep public class * extends com.jme3.system.ios.IosHarness{public *;} | ||
| -keep public class * extends com.jme3.app.Application{public *;} | ||
| -keep public class * extends com.jme3.system.JmeSystemDelegate{public *;} | ||
| -keep public class * extends com.jme3.scene.control.*{public *;} | ||
| -keep public class * extends com.jme3.scene.Node{public *;} | ||
| -keep public class * implements com.jme3.renderer.Renderer{public *;} | ||
| -keep public class * implements com.jme3.asset.AssetLoader{public *;} | ||
| -keep public class * implements com.jme3.asset.AssetLocator{public *;} | ||
| -keep public class * implements de.lessvoid.nifty.screen.ScreenController{public *;} | ||
| -keep public class de.lessvoid.nifty.loaderv2.types.** { public *;} | ||
| -keep public class de.lessvoid.nifty.controls.** { public *; } | ||
| -keep public class de.lessvoid.nifty.input.** { public *; } | ||
| -keep public class de.lessvoid.nifty.effects.impl.** { public *;} | ||
| -keepclassmembers class com.jme3.audio.plugins.NativeVorbisFile{public *;} | ||
| -keep public class * implements javax.xml.parsers.SAXParserFactory{public *;} | ||
| -keep public class com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl | ||
| -keep public class com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl | ||
| -keep public class sun.nio.fs.MacOSXFileSystemProvider | ||
| -keep public class * extends java.nio.charset.Charset { *; } | ||
| -keep public class java.util.zip.Deflater { *; } | ||
| -keep public class java.io.FileNotFoundException { *; } | ||
| -keep public class java.lang.reflect.Proxy { *; } | ||
| -keep public class java.lang.reflect.InvocationHandler { *; } | ||
| -keep public class java.util.logging.ConsoleHandler | ||
| -keep public class java.util.logging.FileHandler | ||
| -keep public class java.util.logging.SimpleFormatter | ||
| -keep public class java.util.logging.LogManager { *; } | ||
| -keep public class org.xmlpull.mxp1.MXParserFactory { *; } | ||
| -keep public class mf.org.** { *; } | ||
|
|
||
| # Base java | ||
| -keep class java.lang.** {*;} | ||
| -keep class java.net.** {*;} | ||
| -keep class java.nio.Bits {*;} | ||
|
|
||
| # Minie | ||
| -keep class vhacd4.** {*;} | ||
| -keep class vhacd.** {*;} | ||
| -keep class jme3utilities.** {*;} | ||
|
|
||
| # Keep all native methods, their classes and any classes in their descriptors | ||
| -keepclasseswithmembers,includedescriptorclasses class ** { | ||
| native <methods>; | ||
| long nativeHandle; | ||
| } | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| package [GAME_PACKAGE]; | ||
|
|
||
| import org.moe.natj.general.Pointer; | ||
| import org.moe.natj.general.ann.RegisterOnStartup; | ||
| import org.moe.natj.objc.ann.Selector; | ||
|
|
||
| import apple.NSObject; | ||
| import apple.foundation.NSDictionary; | ||
| import apple.corefoundation.struct.CGRect; | ||
| import apple.uikit.UIApplication; | ||
| import apple.uikit.UIColor; | ||
| import apple.uikit.UIImage; | ||
| import apple.uikit.UINavigationController; | ||
| import apple.uikit.UIScreen; | ||
| import apple.uikit.UIViewController; | ||
| import apple.uikit.UIWindow; | ||
| import apple.uikit.c.UIKit; | ||
| import apple.uikit.enums.UIBarStyle; | ||
| import apple.uikit.protocol.UIApplicationDelegate; | ||
|
|
||
| @RegisterOnStartup | ||
| public class DummyMain extends NSObject implements UIApplicationDelegate | ||
| { | ||
| public static void main(String[] args) { | ||
| UIKit.UIApplicationMain(0, null, null, DummyMain.class.getName()); | ||
| } | ||
|
|
||
| @Selector("alloc") | ||
| public static native DummyMain alloc(); | ||
|
|
||
| protected DummyMain(Pointer peer) { | ||
| super(peer); | ||
| } | ||
|
|
||
| private UIWindow window; | ||
|
|
||
| @Override | ||
| public boolean applicationDidFinishLaunchingWithOptions(UIApplication application, NSDictionary launchOptions) { | ||
| UIScreen screen = UIScreen.mainScreen(); | ||
| CGRect bounds = screen.bounds(); | ||
| window = UIWindow.alloc().initWithFrame(bounds); | ||
|
|
||
| UIViewController vc = MoeIosJmeAppHarness.alloc().init(); | ||
|
|
||
| // Initialization with navigation bar | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this meant to be commented out?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I left it as an example on how to add a top bar. I think most, if not all, people will use fullscreen without any bar, but just in case |
||
| /* | ||
| UINavigationController navigationController = UINavigationController.alloc().init(); | ||
| UIColor moeBlue = UIColor.alloc().initWithRedGreenBlueAlpha(0.0, 113/255.f, 197/255.f, 1.0); | ||
| navigationController.initWithRootViewController(vc); | ||
| window.setRootViewController(navigationController); | ||
|
|
||
| navigationController.navigationBar().setBarStyle(UIBarStyle.Black); | ||
| navigationController.navigationBar().setBarTintColor(moeBlue); | ||
| navigationController.navigationBar().setShadowImage(UIImage.alloc().init()); | ||
| navigationController.navigationBar().setTranslucent(false); | ||
| navigationController.navigationBar().setTintColor(UIColor.whiteColor()); | ||
| */ | ||
|
|
||
| // New initialization, only glwindow | ||
| window.setRootViewController(vc); | ||
|
|
||
| window.makeKeyAndVisible(); | ||
|
|
||
| System.out.println("DummyMain applicationDidFinishLaunchingWithOptions"); | ||
|
|
||
| return true; | ||
| } | ||
|
|
||
| @Override | ||
| public void setWindow(UIWindow value) { | ||
| window = value; | ||
| } | ||
|
|
||
| @Override | ||
| public UIWindow window() { | ||
| return window; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.