Skip to content
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

Android Basic Support #34

Merged
merged 14 commits into from
Feb 14, 2023
Merged

Android Basic Support #34

merged 14 commits into from
Feb 14, 2023

Conversation

pavly-gerges
Copy link
Member

@pavly-gerges pavly-gerges commented Feb 13, 2023

This PR adds the following:

  • Bash build script for android.
  • Android compiling task.
  • UnSupportedSystemError: that is thrown when an unsupported system has been detected.
  • A github runner compile and upload jobs for android.

And modifies the following:

  • Gradle buildSrc: support script command args.
  • NativeVariant: added the Android to the systems.
  • NativeBinaryLoader: added a check for android and other unsupported systems.
  • Github runner jobs to the new gradle tasks names.

@pavly-gerges pavly-gerges added enhancement New feature or request build-script Concerning build script core Concerning API core code labels Feb 13, 2023
@pavly-gerges pavly-gerges added this to the API-Building-Model milestone Feb 13, 2023
@pavly-gerges pavly-gerges linked an issue Feb 13, 2023 that may be closed by this pull request
@pavly-gerges pavly-gerges changed the title Android buildscript Android Basic Support Feb 13, 2023
@pavly-gerges
Copy link
Member Author

Tested on android and got this exception, as a result of the System.getProperty("os.name") on android is being also Linux:

 Linux
2023-02-14 06:22:38.124  5346-5346  TestNativeBufferUtils   com.jme3.testalloc                   I  **************** com.jme3.testalloc.TestNativeBufferUtils****************
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  java.io.FileNotFoundException: /libjmealloc.so (Read-only file system)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at java.io.FileOutputStream.open0(Native Method)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at java.io.FileOutputStream.open(FileOutputStream.java:308)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at java.io.FileOutputStream.<init>(FileOutputStream.java:238)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at java.io.FileOutputStream.<init>(FileOutputStream.java:119)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at com.jme3.alloc.util.loader.NativeBinaryLoader.cleanExtractBinary(NativeBinaryLoader.java:195)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at com.jme3.alloc.util.loader.NativeBinaryLoader.incrementalExtractBinary(NativeBinaryLoader.java:182)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at com.jme3.alloc.util.loader.NativeBinaryLoader.loadLinux(NativeBinaryLoader.java:89)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at com.jme3.alloc.util.loader.NativeBinaryLoader.loadLibrary(NativeBinaryLoader.java:61)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at com.jme3.alloc.util.NativeBufferUtils.<clinit>(NativeBufferUtils.java:48)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at com.jme3.alloc.util.NativeBufferUtils.clearAlloc(Native Method)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at com.jme3.testalloc.TestNativeBufferUtils.main(TestNativeBufferUtils.java:53)
2023-02-14 06:22:38.133  5346-5346  System.err              com.jme3.testalloc                   W  	at com.jme3.testalloc.MainActivity.onCreate(MainActivity.java:16)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.app.Activity.performCreate(Activity.java:7224)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.app.Activity.performCreate(Activity.java:7213)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.os.Handler.dispatchMessage(Handler.java:106)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.os.Looper.loop(Looper.java:201)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at android.app.ActivityThread.main(ActivityThread.java:6810)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at java.lang.reflect.Method.invoke(Native Method)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
2023-02-14 06:22:38.134  5346-5346  System.err              com.jme3.testalloc                   W  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

The last commit, should resolve this exception; because it checks first if the VM is a dalvik on a linux system (that's android for sure).

@pavly-gerges
Copy link
Member Author

Issue resolved, going to merge this soon.

@pavly-gerges pavly-gerges merged commit 3a69890 into master Feb 14, 2023
@pavly-gerges pavly-gerges deleted the android-buildscript branch February 14, 2023 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-script Concerning build script core Concerning API core code enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android] Compile shared object files for different architectures
1 participant