Chromium Code Reviews| Index: build/java.gypi |
| diff --git a/build/java.gypi b/build/java.gypi |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4290232b3122599551b68f7a522901ee23172e88 |
| --- /dev/null |
| +++ b/build/java.gypi |
| @@ -0,0 +1,53 @@ |
| +# 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', |
|
Ryan Sleevi
2012/04/14 03:10:50
nit: 'my-package_java' -> 'my_package_java' ?
Jus
Yaron
2012/04/16 20:44:56
Ya. I could make it package_java but I wanted to h
|
| +# 'type': 'none', |
| +# 'variables': { |
| +# 'package_name': 'my-package', |
| +# 'java_root': 'path/to/package/root', |
|
Ryan Sleevi
2012/04/14 03:10:50
It seems a bit odd that this doesn't get relativiz
Yaron
2012/04/16 20:44:56
Done.
|
| +# }, |
| +# 'includes': ['path/to/this/gypi/file'], |
| +# } |
| +# |
| +# Note that this assumes that there's ant buildfile with package_name in |
| +# java_root. So if if you have package_name="base" and |
| +# java_root="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: |
| +# <(PRODUCT_DIR)/chromium_base.jar |
| +# |
| +# TODO(yfriedman): The "finally" statement isn't entirely true yet, as we don't |
| +# auto-generate the ant file yet. |
| + |
| +{ |
| + 'actions': [ |
| + { |
| + 'action_name': 'ant_<(package_name)', |
| + 'message': 'Building <(package_name) java sources.', |
| + 'inputs': [ |
| + '<(DEPTH)/<(java_root)/<(package_name).xml', |
| + '<!@(find <(DEPTH)/<(java_root) -name "*.java")' |
| + ], |
| + 'outputs': [ |
| + '<(PRODUCT_DIR)/chromium_<(package_name).jar', |
| + ], |
| + 'action': [ |
| + 'ant', |
| + '-DPRODUCT_DIR=<(PRODUCT_DIR)', |
| + '-buildfile', |
| + '<(DEPTH)/<(java_root)/<(package_name).xml', |
| + ] |
| + }, |
| + ], |
| +} |