summaryrefslogtreecommitdiff
path: root/platform/android/SCsub
diff options
context:
space:
mode:
authorMatthias Hoelzl <tc@xantira.com>2017-08-26 18:53:49 +0200
committerMatthias Hoelzl <tc@xantira.com>2017-08-27 23:05:39 +0200
commitb6e1e47e3a92c1b94ef327149068a8a147fc73f5 (patch)
tree649111f4d36d3a1a12048db41e9d72026a787d6b /platform/android/SCsub
parenta919a013f53bdd9535d248ad9fdbb586c342a4d6 (diff)
Make build scripts Python3 compatible
- The Windows, UWP, Android (on Windows) and Linux builds are tested with Scons 3.0 alpha using Python 3. - OSX and iOS should hopefully work but are not tested since I don't have a Mac. - Builds using SCons 2.5 and Python 2 should not be impacted.
Diffstat (limited to 'platform/android/SCsub')
-rw-r--r--platform/android/SCsub11
1 files changed, 6 insertions, 5 deletions
diff --git a/platform/android/SCsub b/platform/android/SCsub
index b124a1a5a8..87e7ee4747 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import shutil
+from compat import open_utf8
Import('env')
@@ -40,8 +41,8 @@ prog = None
abspath = env.Dir(".").abspath
-gradle_basein = open(abspath + "/build.gradle.template", "rb")
-gradle_baseout = open(abspath + "/java/build.gradle", "wb")
+gradle_basein = open_utf8(abspath + "/build.gradle.template", "r")
+gradle_baseout = open_utf8(abspath + "/java/build.gradle", "w")
gradle_text = gradle_basein.read()
@@ -124,8 +125,8 @@ gradle_baseout.write(gradle_text)
gradle_baseout.close()
-pp_basein = open(abspath + "/AndroidManifest.xml.template", "rb")
-pp_baseout = open(abspath + "/java/AndroidManifest.xml", "wb")
+pp_basein = open_utf8(abspath + "/AndroidManifest.xml.template", "r")
+pp_baseout = open_utf8(abspath + "/java/AndroidManifest.xml", "w")
manifest = pp_basein.read()
manifest = manifest.replace("$$ADD_APPLICATION_CHUNKS$$", env.android_manifest_chunk)
manifest = manifest.replace("$$ADD_PERMISSION_CHUNKS$$", env.android_permission_chunk)
@@ -146,7 +147,7 @@ elif env['android_arch'] == 'arm64v8':
elif env['android_arch'] == 'x86':
lib_arch_dir = 'x86'
else:
- print 'WARN: Architecture not suitable for embedding into APK; keeping .so at \\bin'
+ print('WARN: Architecture not suitable for embedding into APK; keeping .so at \\bin')
if lib_arch_dir != '':
if env['target'] == 'release':