2014-02-10 01:10:30 +00:00
|
|
|
import shutil
|
|
|
|
|
|
|
|
Import('env')
|
|
|
|
|
|
|
|
android_files = [
|
|
|
|
|
|
|
|
'os_android.cpp',
|
|
|
|
'godot_android.cpp',
|
|
|
|
'file_access_android.cpp',
|
|
|
|
'dir_access_android.cpp',
|
2014-03-14 01:57:24 +00:00
|
|
|
'audio_driver_opensl.cpp',
|
2014-02-10 01:10:30 +00:00
|
|
|
'file_access_jandroid.cpp',
|
|
|
|
'dir_access_jandroid.cpp',
|
|
|
|
'thread_jandroid.cpp',
|
|
|
|
'audio_driver_jandroid.cpp',
|
2014-05-24 04:35:47 +00:00
|
|
|
'ifaddrs_android.cpp',
|
2014-02-10 01:10:30 +00:00
|
|
|
'android_native_app_glue.c',
|
2014-09-03 02:13:40 +00:00
|
|
|
'java_glue.cpp',
|
2014-09-15 14:33:30 +00:00
|
|
|
'cpu-features.c',
|
2014-09-03 02:13:40 +00:00
|
|
|
'java_class_wrapper.cpp'
|
2014-02-10 01:10:30 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
#env.Depends('#core/math/vector3.h', 'vector3_psp.h')
|
|
|
|
|
|
|
|
#obj = env.SharedObject('godot_android.cpp')
|
|
|
|
|
|
|
|
env_android = env.Clone()
|
|
|
|
if env['target'] == "profile":
|
|
|
|
env_android.Append(CPPFLAGS=['-DPROFILER_ENABLED'])
|
|
|
|
|
|
|
|
android_objects=[]
|
|
|
|
for x in android_files:
|
|
|
|
android_objects.append( env_android.SharedObject( x ) )
|
|
|
|
|
|
|
|
prog = None
|
|
|
|
|
|
|
|
abspath=env.Dir(".").abspath
|
|
|
|
|
|
|
|
|
|
|
|
pp_basein = open(abspath+"/project.properties.template","rb")
|
|
|
|
pp_baseout = open(abspath+"/java/project.properties","wb")
|
|
|
|
pp_baseout.write( pp_basein.read() )
|
2014-03-14 01:57:24 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
refcount=1
|
2014-03-14 01:57:24 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
for x in env.android_source_modules:
|
|
|
|
pp_baseout.write("android.library.reference."+str(refcount)+"="+x+"\n")
|
|
|
|
refcount+=1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pp_baseout.close()
|
|
|
|
|
|
|
|
|
|
|
|
pp_basein = open(abspath+"/AndroidManifest.xml.template","rb")
|
|
|
|
pp_baseout = open(abspath+"/java/AndroidManifest.xml","wb")
|
|
|
|
manifest = pp_basein.read()
|
|
|
|
manifest = manifest.replace("$$ADD_APPLICATION_CHUNKS$$",env.android_manifest_chunk)
|
2015-03-03 17:39:13 +00:00
|
|
|
manifest = manifest.replace("$$ADD_PERMISSION_CHUNKS$$",env.android_permission_chunk)
|
|
|
|
manifest = manifest.replace("$$ADD_APPATTRIBUTE_CHUNKS$$",env.android_appattributes_chunk)
|
2014-02-10 01:10:30 +00:00
|
|
|
pp_baseout.write( manifest )
|
|
|
|
|
|
|
|
|
|
|
|
for x in env.android_source_files:
|
|
|
|
shutil.copy(x,abspath+"/java/src/com/android/godot")
|
|
|
|
|
|
|
|
for x in env.android_module_libraries:
|
|
|
|
shutil.copy(x,abspath+"/java/libs")
|
|
|
|
|
|
|
|
|
2014-10-08 06:37:04 +00:00
|
|
|
env_android.SharedLibrary("#bin/libgodot",[android_objects],SHLIBSUFFIX=env["SHLIBSUFFIX"])
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2014-10-07 04:31:49 +00:00
|
|
|
#env.Command('#bin/libgodot_android.so', '#platform/android/libgodot_android.so', Copy('bin/libgodot_android.so', 'platform/android/libgodot_android.so'))
|