summaryrefslogtreecommitdiff
path: root/platform/android/SCsub
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android/SCsub')
-rw-r--r--platform/android/SCsub26
1 files changed, 25 insertions, 1 deletions
diff --git a/platform/android/SCsub b/platform/android/SCsub
index c8feac8690..60bb4bd613 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -79,6 +79,11 @@ for x in env.android_jni_dirs:
gradle_asset_dirs_text=""
+gradle_default_config_text=""
+
+for x in env.android_default_config:
+ gradle_default_config_text+=x+"\n\t\t"
+
gradle_text = gradle_text.replace("$$GRADLE_REPOSITORY_URLS$$",gradle_maven_repos_text)
gradle_text = gradle_text.replace("$$GRADLE_DEPENDENCIES$$",gradle_maven_dependencies_text)
gradle_text = gradle_text.replace("$$GRADLE_JAVA_DIRS$$",gradle_java_dirs_text)
@@ -86,6 +91,7 @@ gradle_text = gradle_text.replace("$$GRADLE_RES_DIRS$$",gradle_res_dirs_text)
gradle_text = gradle_text.replace("$$GRADLE_ASSET_DIRS$$",gradle_asset_dirs_text)
gradle_text = gradle_text.replace("$$GRADLE_AIDL_DIRS$$",gradle_aidl_dirs_text)
gradle_text = gradle_text.replace("$$GRADLE_JNI_DIRS$$",gradle_jni_dirs_text)
+gradle_text = gradle_text.replace("$$GRADLE_DEFAULT_CONFIG$$",gradle_default_config_text)
gradle_baseout.write( gradle_text )
@@ -103,4 +109,22 @@ pp_baseout.write( manifest )
env_android.SharedLibrary("#bin/libgodot",[android_objects],SHLIBSUFFIX=env["SHLIBSUFFIX"])
-#env.Command('#bin/libgodot_android.so', '#platform/android/libgodot_android.so', Copy('bin/libgodot_android.so', 'platform/android/libgodot_android.so'))
+
+lib_arch_dir = ''
+if env['android_arch'] == 'armv6':
+ lib_arch_dir = 'armeabi'
+elif env['android_arch'] == 'armv7':
+ lib_arch_dir = 'armeabi-v7a'
+elif env['android_arch'] == 'x86':
+ lib_arch_dir = 'x86'
+else:
+ print 'WARN: Architecture not suitable for embedding into APK; keeping .so at \\bin'
+
+if lib_arch_dir != '':
+ if env['target'] == 'release':
+ lib_type_dir = 'release'
+ else: # release_debug, debug
+ lib_type_dir = 'debug'
+
+ out_dir = '#platform/android/java/libs/'+lib_type_dir+'/'+lib_arch_dir
+ env_android.Command(out_dir+'/libgodot_android.so', '#bin/libgodot'+env['SHLIBSUFFIX'], Move("$TARGET", "$SOURCE"))