فهرست منبع

Added gradle for jme3-ios-native

joliver82 1 سال پیش
والد
کامیت
b3dfd17e1b
3فایلهای تغییر یافته به همراه41 افزوده شده و 5 حذف شده
  1. 6 3
      .github/workflows/main.yml
  2. 35 0
      jme3-ios-native/build.gradle
  3. 0 2
      jme3-ios-native/template/META-INF/MANIFEST.MF

+ 6 - 3
.github/workflows/main.yml

@@ -51,7 +51,7 @@ on:
       - v3.5
       - v3.4
       - v3.3
-      - ios-2024
+      - ios-2024_2
   pull_request:
   release:
     types: [published]
@@ -88,8 +88,11 @@ jobs:
       - name: Validate the Gradle wrapper
         uses: gradle/actions/wrapper-validation@v3
 
-      - name: Manually run export shell script
-        run: cd jme3-ios-native && ./export.sh
+      - name: Build
+        run: |
+          ./gradlew -PuseCommitHashAsVersionName=true --no-daemon -PbuildNativeProjects=true \
+          :jme3-ios-native:build
+
 
 
 

+ 35 - 0
jme3-ios-native/build.gradle

@@ -0,0 +1,35 @@
+import org.apache.tools.ant.taskdefs.condition.Os
+
+task deleteXcframework(type: Delete) {
+    delete 'template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework'
+}
+
+task buildNativeLibIos(type: Exec) {
+    executable "xcodebuild"
+    args 'archive', '-project', 'jme3-ios-native.xcodeproj', '-scheme', 'jme3-ios-native', '-destination', 'generic/platform=iOS', '-archivePath', 'build/archives/jme3-ios-native_iOS', 'SKIP_INSTALL=NO', 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES'
+}
+
+task buildNativeLibSimulator(type: Exec) {
+    executable "xcodebuild"
+    args 'archive', '-project', 'jme3-ios-native.xcodeproj', '-scheme', 'jme3-ios-native', '-destination', 'generic/platform=iOS Simulator', '-archivePath', 'build/archives/jme3-ios-native_iOS-Simulator', 'SKIP_INSTALL=NO', 'BUILD_LIBRARY_FOR_DISTRIBUTION=YES'
+}
+
+task buildNativeLib(type: Exec) {
+    dependsOn 'deleteXcframework'
+    dependsOn 'buildNativeLibIos'
+    dependsOn 'buildNativeLibSimulator'
+    executable "xcodebuild"
+    args '-create-xcframework', '-framework', 'build/archives/jme3-ios-native_iOS.xcarchive/Products/Library/Frameworks/jme3_ios_native.framework', '-framework', 'build/archives/jme3-ios-native_iOS-Simulator.xcarchive/Products/Library/Frameworks/jme3_ios_native.framework', '-output', 'template/META-INF/robovm/ios/libs/jme3-ios-native.xcframework'
+}
+
+// buildNativeProjects is a string set to "true"
+if (Os.isFamily(Os.FAMILY_MAC) && buildNativeProjects == "true") {
+    // build native libs and update stored pre-compiled libs to commit
+    compileJava.dependsOn { buildNativeLib }
+} else {
+    // TODO: (like android natives?) use pre-compiled native libs (not building new ones)
+    // compileJava.dependsOn { copyPreCompiledLibs }
+    println "Native build disable or not running on OSX"
+}
+
+jar.into("") { from "template" }

+ 0 - 2
jme3-ios-native/template/META-INF/MANIFEST.MF

@@ -1,2 +0,0 @@
-Manifest-Version: 1.0
-