1buildscript { 2 repositories { 3 mavenCentral() 4 mavenLocal() 5 maven { 6 url uri(System.getenv("INTEL_MULTI_OS_ENGINE_HOME") + "/gradle") 7 } 8 } 9 dependencies { 10 classpath 'com.intel.gradle:moeGradlePlugin:1.1.0.final-1' 11 } 12} 13 14apply plugin: 'moe' 15 16configurations { natives } 17 18task copyNatives << { 19 file("xcode/native/ios/").mkdirs(); 20 def LD_FLAGS = "LIBGDX_NATIVES = " 21 configurations.natives.files.each { jar-> 22 def outputDir = null 23 if (jar.name.endsWith("natives-ios.jar")) outputDir = file("xcode/native/ios") 24 if (outputDir != null) { 25 FileCollection fileCollection = zipTree(jar) 26 for (File libFile : fileCollection) { 27 if (libFile.getAbsolutePath().endsWith(".a") && !libFile.getAbsolutePath().contains("/tvos/")) { 28 copy { 29 from libFile.getAbsolutePath() 30 into outputDir 31 } 32 LD_FLAGS += " -force_load \${SRCROOT}/native/ios/" + libFile.getName() 33 } 34 } 35 } 36 } 37 def outFlags = file("xcode/IOSTests/custom.xcconfig"); 38 outFlags.write LD_FLAGS 39 40 def proguard = file("/Applications/Intel/multi_os_engine/tools/proguard.cfg") 41 if (proguard.exists()) { 42 if (!proguard.text.contains("-keep class com.badlogic.**")) { 43 proguard << "-keep class com.badlogic.** { *; }\n" 44 proguard << "-keep enum com.badlogic.** { *; }\n" 45 } 46 } 47} 48 49repositories { 50 mavenLocal() 51 mavenCentral() 52 jcenter() 53} 54 55sourceSets.main.java.srcDirs = ["src/main/java"] 56sourceSets.main.resources.srcDirs = ["src/main/resources"] 57 58dependencies { 59 natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios" 60 natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios" 61 natives "com.badlogicgames.gdx:gdx-bullet-platform:$gdxVersion:natives-ios" 62 natives "com.badlogicgames.gdx:gdx-freetype-platform:1.9.2:natives-ios" 63} 64 65moe { 66 mainClassName 'IOSTests' 67 xcode { 68 mainTarget 'IOSTests' 69 packageName 'com.badlogicgames.gdx.tests' 70 deploymentTarget = '9.0' 71 xcodeProjectDirPath 'xcode' 72 generateProject false 73 } 74} 75 76moeMainReleaseIphoneosXcodeBuild.dependsOn copyNatives 77moeMainDebugIphoneosXcodeBuild.dependsOn copyNatives 78moeMainReleaseIphonesimulatorXcodeBuild.dependsOn copyNatives 79moeMainDebugIphonesimulatorXcodeBuild.dependsOn copyNatives 80