summaryrefslogtreecommitdiffstats
path: root/build/config/android/internal_rules.gni
diff options
context:
space:
mode:
authorcjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-26 04:01:47 +0000
committercjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-26 04:01:47 +0000
commit6fad603bfebe6314ecaa4d74a3ffdca430eeb8a6 (patch)
tree46e88b39046ce753373ac25fafb549b19b57d9d8 /build/config/android/internal_rules.gni
parent29a5d132d2e499651a741611f5c4504e5298a684 (diff)
downloadchromium_src-6fad603bfebe6314ecaa4d74a3ffdca430eeb8a6.zip
chromium_src-6fad603bfebe6314ecaa4d74a3ffdca430eeb8a6.tar.gz
chromium_src-6fad603bfebe6314ecaa4d74a3ffdca430eeb8a6.tar.bz2
Add java_cpp_template template
This is the GN version of build/java_cpp_template.gypi. It defines a template that wraps an action_foreach that generates .java files using the host C preprocessor. The major difference in the GN version is that it takes all the generated java files and zips them together in a single .srcjar. When such a target is included in the srcjar_deps of a java library, the .java files in the .srcjar will be treated much like files listed in that libraries java_sources (particularly they will be compiled and included in the .jar/.dex). Depends on https://crrev.com/264773014/ BUG=359249 Review URL: https://codereview.chromium.org/264923007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/config/android/internal_rules.gni')
-rw-r--r--build/config/android/internal_rules.gni25
1 files changed, 25 insertions, 0 deletions
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
new file mode 100644
index 0000000..b3114ef
--- /dev/null
+++ b/build/config/android/internal_rules.gni
@@ -0,0 +1,25 @@
+
+# Creates a zip archive of the inputs.
+# If base_dir is provided, the archive paths will be relative to it.
+template("zip") {
+ assert(defined(invoker.inputs))
+ assert(defined(invoker.output))
+
+ rebase_inputs = rebase_path(invoker.inputs)
+ rebase_output = rebase_path(invoker.output)
+ action(target_name) {
+ script = "//build/android/gn/zip.py"
+ source_prereqs = invoker.inputs
+ outputs = [invoker.output]
+ args = [
+ "--inputs=$rebase_inputs",
+ "--output=$rebase_output",
+ ]
+ if (defined(invoker.base_dir)) {
+ args += [
+ "--base-dir", rebase_path(invoker.base_dir)
+ ]
+ }
+ }
+}
+