2012-04-17 08:39:52 +04:00
|
|
|
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# This file is meant to be included into a target to provide a rule
|
|
|
|
# to build Java in a consistent manner.
|
|
|
|
#
|
|
|
|
# To use this, create a gyp target with the following form:
|
|
|
|
# {
|
|
|
|
# 'target_name': 'my-package_java',
|
|
|
|
# 'type': 'none',
|
|
|
|
# 'variables': {
|
|
|
|
# 'package_name': 'my-package',
|
|
|
|
# 'java_in_dir': 'path/to/package/root',
|
|
|
|
# },
|
|
|
|
# 'includes': ['path/to/this/gypi/file'],
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# Note that this assumes that there's ant buildfile with package_name in
|
|
|
|
# java_in_dir. So if if you have package_name="base" and
|
|
|
|
# java_in_dir="base/android/java" you should have a directory structure like:
|
|
|
|
#
|
|
|
|
# base/android/java/base.xml
|
|
|
|
# base/android/java/org/chromium/base/Foo.java
|
|
|
|
# base/android/java/org/chromium/base/Bar.java
|
|
|
|
#
|
|
|
|
# Finally, the generated jar-file will be:
|
2012-05-10 05:50:47 +04:00
|
|
|
# <(PRODUCT_DIR)/lib.java/chromium_base.jar
|
2012-04-17 08:39:52 +04:00
|
|
|
|
|
|
|
{
|
2012-09-19 22:19:18 +04:00
|
|
|
'dependencies': [
|
2012-09-21 15:11:10 +04:00
|
|
|
'<(DEPTH)/build/build_output_dirs_android.gyp:build_output_dirs'
|
2012-09-19 22:19:18 +04:00
|
|
|
],
|
2012-08-09 22:08:19 +04:00
|
|
|
'direct_dependent_settings': {
|
|
|
|
'variables': {
|
|
|
|
'input_jars_paths': ['<(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar'],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'variables': {
|
|
|
|
'input_jars_paths': [],
|
2012-08-13 22:35:49 +04:00
|
|
|
'additional_src_dirs': [],
|
2012-09-22 05:21:32 +04:00
|
|
|
'additional_input_paths': [],
|
2012-08-09 22:08:19 +04:00
|
|
|
},
|
2012-04-17 08:39:52 +04:00
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'ant_<(package_name)',
|
|
|
|
'message': 'Building <(package_name) java sources.',
|
|
|
|
'inputs': [
|
2012-08-09 22:08:19 +04:00
|
|
|
'android/ant/common.xml',
|
|
|
|
'android/ant/chromium-jars.xml',
|
|
|
|
'<!@(find <(java_in_dir) -name "*.java")',
|
|
|
|
'>@(input_jars_paths)',
|
2012-09-22 05:21:32 +04:00
|
|
|
'>@(additional_input_paths)',
|
2012-04-17 08:39:52 +04:00
|
|
|
],
|
|
|
|
'outputs': [
|
2012-05-10 05:50:47 +04:00
|
|
|
'<(PRODUCT_DIR)/lib.java/chromium_<(package_name).jar',
|
2012-04-17 08:39:52 +04:00
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'ant',
|
2012-05-30 03:19:13 +04:00
|
|
|
'-DPRODUCT_DIR=<(ant_build_out)',
|
2012-04-25 07:18:46 +04:00
|
|
|
'-DPACKAGE_NAME=<(package_name)',
|
2012-08-14 00:17:24 +04:00
|
|
|
'-DINPUT_JARS_PATHS=>(input_jars_paths)',
|
2012-08-13 22:35:49 +04:00
|
|
|
'-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)',
|
2012-08-01 15:31:47 +04:00
|
|
|
'-DANDROID_SDK=<(android_sdk)',
|
2012-08-07 03:23:51 +04:00
|
|
|
'-DANDROID_SDK_ROOT=<(android_sdk_root)',
|
|
|
|
'-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
|
|
|
|
'-DANDROID_SDK_VERSION=<(android_sdk_version)',
|
2012-08-31 02:54:09 +04:00
|
|
|
'-DANDROID_GDBSERVER=<(android_gdbserver)',
|
2012-08-14 00:17:24 +04:00
|
|
|
'-Dbasedir=<(java_in_dir)',
|
2012-04-17 08:39:52 +04:00
|
|
|
'-buildfile',
|
2012-08-14 00:17:24 +04:00
|
|
|
'<(DEPTH)/build/android/ant/chromium-jars.xml'
|
2012-04-17 08:39:52 +04:00
|
|
|
]
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|