Upstream version 6.35.131.0
[platform/framework/web/crosswalk.git] / src / xwalk / app / tools / android / make_apk.py
index fc54b3f..563681e 100755 (executable)
@@ -116,9 +116,6 @@ def ParseManifest(options):
     options.fullscreen = True
   elif parser.GetFullScreenFlag().lower() == 'false':
     options.fullscreen = False
-  if parser.GetLaunchScreenImg():
-    options.launch_screen_img  = os.path.join(options.app_root,
-                                              parser.GetLaunchScreenImg())
 
 
 def ParseXPK(options, out_dir):
@@ -209,8 +206,8 @@ def Customize(options):
   CustomizeAll(app_versionCode, options.description, options.icon_dict,
                options.permissions, options.app_url, app_root,
                options.app_local_path, remote_debugging,
-               fullscreen_flag, options.extensions,
-               options.launch_screen_img, icon, package, name, app_version,
+               fullscreen_flag, options.keep_screen_on, options.extensions,
+               options.manifest, icon, package, name, app_version,
                orientation, options.xwalk_command_line)
 
 
@@ -524,14 +521,24 @@ def MakeApk(options, sanitized_name):
       valid_archs = ['x86', 'armeabi-v7a']
       packaged_archs = []
       for arch in valid_archs:
-        if os.path.isfile(os.path.join('native_libs', arch, 'libs',
-                                       arch, 'libxwalkcore.so')):
+        lib_path = os.path.join('native_libs', arch, 'libs',
+                                arch, 'libxwalkcore.so')
+        if os.path.isfile(lib_path):
           if arch.find('x86') != -1:
             options.arch = 'x86'
           elif arch.find('arm') != -1:
             options.arch = 'arm'
           Execution(options, sanitized_name)
           packaged_archs.append(options.arch)
+        else:
+          print('Warning: failed to create package for arch "%s" '
+                'due to missing library %s' %
+                (arch, lib_path))
+
+      if len(packaged_archs) == 0:
+        print('No packages created, aborting')
+        sys.exit(13)
+
       multi_arch = False
       if len(packaged_archs) >=2:
         multi_arch = True
@@ -639,6 +646,8 @@ def main(argv):
   group.add_option('-f', '--fullscreen', action='store_true',
                    dest='fullscreen', default=False,
                    help='Make application fullscreen.')
+  group.add_option('--keep-screen-on', action='store_true', default=False,
+                   help='Support keeping screen on')
   info = ('The path of application icon. '
           'Such as: --icon=/path/to/your/customized/icon')
   group.add_option('--icon', help=info)
@@ -676,10 +685,6 @@ def main(argv):
     parser.print_help()
     return 0
 
-  # This option will not export to users.
-  # Initialize here and will be read from manifest.json.
-  options.launch_screen_img = ''
-
   if options.version:
     if os.path.isfile('VERSION'):
       print(GetVersion('VERSION'))
@@ -703,6 +708,10 @@ def main(argv):
     if not options.package:
       parser.error('The package name is required! '
                    'Please use "--package" option.')
+    elif len(options.package) >= 128 :
+      parser.error('To be safe, the length of package name '
+                   'should be less than 128.')
+
     if not options.name:
       parser.error('The APK name is required! Please use "--name" option.')
     if not ((options.app_url and not options.app_root