Make resource directory option in gyp template optional.

Resource directory may not always be defined for an apk, make it optional.

BUG=156061

Review URL: https://chromiumcodereview.appspot.com/11189010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162477 0039d316-1c4b-4281-b951-d872f2087c98
parent d853ff29
...@@ -106,7 +106,6 @@ ...@@ -106,7 +106,6 @@
'apk_name': 'AndroidWebView', 'apk_name': 'AndroidWebView',
'manifest_package_name': 'org.chromium.android_webview', 'manifest_package_name': 'org.chromium.android_webview',
'java_in_dir': '../android_webview/java', 'java_in_dir': '../android_webview/java',
'resource_dir': '../res',
'native_libs_paths': ['<(SHARED_LIB_DIR)/libwebview.so'], 'native_libs_paths': ['<(SHARED_LIB_DIR)/libwebview.so'],
'input_pak_files': [ 'input_pak_files': [
'<(SHARED_INTERMEDIATE_DIR)/repack/chrome.pak', '<(SHARED_INTERMEDIATE_DIR)/repack/chrome.pak',
......
The APK build rule from build/java_apk.gypi that we use requires a res/ folder
(even an empty one) to work.
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
# apk_name - The final apk will be named <apk_name>-debug.apk (or -release) # apk_name - The final apk will be named <apk_name>-debug.apk (or -release)
# java_in_dir - The top-level java directory. The src should be in # java_in_dir - The top-level java directory. The src should be in
# <java_in_dir>/src. # <java_in_dir>/src.
# resource_dir - The directory for resources.
# Optional/automatic variables: # Optional/automatic variables:
# additional_input_paths - These paths will be included in the 'inputs' list to # additional_input_paths - These paths will be included in the 'inputs' list to
# ensure that this target is rebuilt when one of these paths changes. # ensure that this target is rebuilt when one of these paths changes.
...@@ -52,6 +51,7 @@ ...@@ -52,6 +51,7 @@
# the library will be included in the apk and symbolic links to the # the library will be included in the apk and symbolic links to the
# unstripped copy will be added to <(android_product_out) to enable native # unstripped copy will be added to <(android_product_out) to enable native
# debugging. # debugging.
# resource_dir - The directory for resources.
{ {
'variables': { 'variables': {
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
'proguard_flags%': '', 'proguard_flags%': '',
'native_libs_paths': [], 'native_libs_paths': [],
'manifest_package_name%': 'unknown.package.name', 'manifest_package_name%': 'unknown.package.name',
'resource_dir%':'',
}, },
'sources': [ 'sources': [
'<@(native_libs_paths)' '<@(native_libs_paths)'
...@@ -106,11 +107,15 @@ ...@@ -106,11 +107,15 @@
# If there is a separate find for additional_src_dirs, it will find the # If there is a separate find for additional_src_dirs, it will find the
# wrong .java files when additional_src_dirs is empty. # wrong .java files when additional_src_dirs is empty.
'>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")', '>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")',
'<!@(find <(java_in_dir)/<(resource_dir) -name "*")',
'>@(input_jars_paths)', '>@(input_jars_paths)',
'>@(native_libs_paths)', '>@(native_libs_paths)',
'>@(additional_input_paths)', '>@(additional_input_paths)',
], ],
'conditions': [
['resource_dir!=""', {
'inputs': ['<!@(find <(java_in_dir)/<(resource_dir) -name "*")']
}],
],
'outputs': [ 'outputs': [
# TODO(cjhopman): Apks are built with a -debug suffix even when they are # TODO(cjhopman): Apks are built with a -debug suffix even when they are
# built in release. This should be fixed. # built in release. This should be fixed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment