Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(822)

Unified Diff: build/config/android/internal_rules.gni

Issue 386473002: Add dexing for libraries and apks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-apk-first
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/write_build_config.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index fa8387441de000012ac1c6cd134f21b93512a2bc..002320c5305946ba0f0ab94528a4accaba543dbe 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -62,6 +62,7 @@ template("write_build_config") {
if (type == "android_library" || type == "android_apk") {
args += [
"--jar-path", rebase_path(invoker.jar_path, root_build_dir),
+ "--dex-path", rebase_path(invoker.dex_path, root_build_dir),
]
}
@@ -110,6 +111,40 @@ template("zip") {
}
}
+template("dex") {
+ assert(defined(invoker.sources))
+ assert(defined(invoker.output))
+ action(target_name) {
+ script = "//build/android/gyp/dex.py"
+ depfile = "$target_gen_dir/$target_name.d"
+ sources = invoker.sources
+ outputs = [depfile, invoker.output]
+ if (defined(invoker.inputs)) {
+ inputs = invoker.inputs
+ }
+
+ rebased_output = rebase_path(invoker.output, root_build_dir)
+
+ args = [
+ "--depfile", rebase_path(depfile, root_build_dir),
+ "--android-sdk-tools", rebased_android_sdk_build_tools,
+ "--dex-path", rebased_output,
+ ]
+
+ if (defined(invoker.no_locals) && invoker.no_locals) {
+ args += [
+ "--no-locals=1"
+ ]
+ }
+
+ if (defined(invoker.args)) {
+ args += invoker.args
+ }
+
+ args += rebase_path(invoker.sources, root_build_dir)
+ }
+}
+
# Compiles and jars a set of java files.
#
# Outputs:
@@ -230,8 +265,10 @@ template("android_java_library") {
assert(defined(invoker.java_files))
assert(defined(invoker.build_config))
assert(defined(invoker.jar_path))
+ assert(defined(invoker.dex_path))
_jar_path = invoker.jar_path
+ _dex_path = invoker.dex_path
java_library("${target_name}__java_library") {
jar_path = _jar_path
@@ -247,11 +284,17 @@ template("android_java_library") {
}
# TODO(cjhopman): lint
- # TODO(cjhopman): dex
+
+
+ dex("${target_name}__dex") {
+ sources = [_jar_path]
+ output = _dex_path
+ }
group(target_name) {
deps = [
- ":${target_name}__java_library"
+ ":${target_name}__java_library",
+ ":${target_name}__dex",
]
}
}
« no previous file with comments | « build/android/gyp/write_build_config.py ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698