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

Side by Side Diff: build/config/android/internal_rules.gni

Issue 1328823002: GN: Use interface jars in the classpath to speed up compiling (a little) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ijar2
Patch Set: .interface.jar Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « build/android/gyp/javac.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//third_party/ijar/ijar.gni") 6 import("//third_party/ijar/ijar.gni")
7 7
8 assert(is_android) 8 assert(is_android)
9 9
10 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) 10 rebased_android_sdk = rebase_path(android_sdk, root_build_dir)
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 } 406 }
407 } 407 }
408 } 408 }
409 409
410 template("process_java_prebuilt") { 410 template("process_java_prebuilt") {
411 set_sources_assignment_filter([]) 411 set_sources_assignment_filter([])
412 forward_variables_from(invoker, [ "testonly" ]) 412 forward_variables_from(invoker, [ "testonly" ])
413 413
414 _input_jar_path = invoker.input_jar_path 414 _input_jar_path = invoker.input_jar_path
415 _output_jar_path = invoker.output_jar_path 415 _output_jar_path = invoker.output_jar_path
416 _jar_toc_path = _output_jar_path + ".TOC" 416 _output_ijar_path = get_path_info(_output_jar_path, "dir") + "/" +
417 get_path_info(_output_jar_path, "name") + ".interface.jar"
417 418
418 assert(invoker.build_config != "") 419 assert(invoker.build_config != "")
419 420
420 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) { 421 if (defined(invoker.proguard_preprocess) && invoker.proguard_preprocess) {
421 _proguard_jar_path = "//third_party/proguard/lib/proguard.jar" 422 _proguard_jar_path = "//third_party/proguard/lib/proguard.jar"
422 _proguard_config_path = invoker.proguard_config 423 _proguard_config_path = invoker.proguard_config
423 _build_config = invoker.build_config 424 _build_config = invoker.build_config
424 _rebased_build_config = rebase_path(_build_config, root_build_dir) 425 _rebased_build_config = rebase_path(_build_config, root_build_dir)
425 _output_jar_target = "${target_name}__proguard_process" 426 _output_jar_target = "${target_name}__proguard_process"
426 action(_output_jar_target) { 427 action(_output_jar_target) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 ]) 471 ])
471 sources = [ 472 sources = [
472 _input_jar_path, 473 _input_jar_path,
473 ] 474 ]
474 outputs = [ 475 outputs = [
475 _output_jar_path, 476 _output_jar_path,
476 ] 477 ]
477 } 478 }
478 } 479 }
479 480
480 # TODO(agrieve): Change file extension to .ijar and use them in classpaths. 481 generate_interface_jar("${target_name}__ijar") {
481 generate_interface_jar("${target_name}__jar_toc") {
482 input_jar = _output_jar_path 482 input_jar = _output_jar_path
483 output_jar = _jar_toc_path 483 output_jar = _output_ijar_path
484 deps = [ 484 deps = [
485 ":$_output_jar_target", 485 ":$_output_jar_target",
486 ] 486 ]
487 } 487 }
488 488
489 group(target_name) { 489 group(target_name) {
490 forward_variables_from(invoker, [ "visibility" ]) 490 forward_variables_from(invoker, [ "visibility" ])
491 public_deps = [ 491 public_deps = [
492 ":${target_name}__jar_toc", 492 ":${target_name}__ijar",
493 ":$_output_jar_target", 493 ":$_output_jar_target",
494 ] 494 ]
495 } 495 }
496 } 496 }
497 497
498 # Creates an unsigned .apk. 498 # Creates an unsigned .apk.
499 # 499 #
500 # Variables 500 # Variables
501 # deps: Specifies the dependencies of this target. 501 # deps: Specifies the dependencies of this target.
502 # dex_path: Path to classes.dex file to include (optional). 502 # dex_path: Path to classes.dex file to include (optional).
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 if (defined(invoker.main_class)) { 977 if (defined(invoker.main_class)) {
978 data_deps += [ ":$binary_script_target_name" ] 978 data_deps += [ ":$binary_script_target_name" ]
979 } 979 }
980 } 980 }
981 } 981 }
982 982
983 # Compiles and jars a set of java files. 983 # Compiles and jars a set of java files.
984 # 984 #
985 # Outputs: 985 # Outputs:
986 # $jar_path.jar 986 # $jar_path.jar
987 # $jar_path.jar.TOC 987 # $jar_path.interface.jar
988 # 988 #
989 # Variables 989 # Variables
990 # java_files: List of .java files to compile. 990 # java_files: List of .java files to compile.
991 # java_deps: List of java dependencies. These should all have a .jar output 991 # java_deps: List of java dependencies. These should all have a .jar output
992 # at "${target_gen_dir}/${target_name}.jar. 992 # at "${target_gen_dir}/${target_name}.jar.
993 # chromium_code: If true, enable extra warnings. 993 # chromium_code: If true, enable extra warnings.
994 # srcjar_deps: List of srcjar dependencies. The .java files contained in the 994 # srcjar_deps: List of srcjar dependencies. The .java files contained in the
995 # dependencies srcjar outputs will be compiled and added to the output jar. 995 # dependencies srcjar outputs will be compiled and added to the output jar.
996 # jar_path: Use this to explicitly set the output jar path. Defaults to 996 # jar_path: Use this to explicitly set the output jar path. Defaults to
997 # "${target_gen_dir}/${target_name}.jar. 997 # "${target_gen_dir}/${target_name}.jar.
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1076 ] 1076 ]
1077 sources = _java_files + _java_srcjars 1077 sources = _java_files + _java_srcjars
1078 inputs = [ 1078 inputs = [
1079 _build_config, 1079 _build_config,
1080 ] 1080 ]
1081 1081
1082 _rebased_java_srcjars = rebase_path(_java_srcjars, root_build_dir) 1082 _rebased_java_srcjars = rebase_path(_java_srcjars, root_build_dir)
1083 _rebased_depfile = rebase_path(depfile, root_build_dir) 1083 _rebased_depfile = rebase_path(depfile, root_build_dir)
1084 args = [ 1084 args = [
1085 "--depfile=$_rebased_depfile", 1085 "--depfile=$_rebased_depfile",
1086 "--use-ijars",
1086 "--classpath=@FileArg($_rebased_build_config:javac:classpath)", 1087 "--classpath=@FileArg($_rebased_build_config:javac:classpath)",
1087 "--jar-path=$_rebased_jar_path", 1088 "--jar-path=$_rebased_jar_path",
1088 "--java-srcjars=$_rebased_java_srcjars", 1089 "--java-srcjars=$_rebased_java_srcjars",
1089 "--java-srcjars=@FileArg($_rebased_build_config:javac:srcjars)", 1090 "--java-srcjars=@FileArg($_rebased_build_config:javac:srcjars)",
1090 "--jar-excluded-classes=$_jar_excluded_patterns", 1091 "--jar-excluded-classes=$_jar_excluded_patterns",
1091 ] 1092 ]
1092 if (_supports_android) { 1093 if (_supports_android) {
1093 _rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir) 1094 deps += [ "//build/android:android_ijar" ]
1094 args += [ "--bootclasspath=$_rebased_android_sdk_jar" ] 1095 _android_sdk_ijar = "$root_out_dir/lib.java/android.interface.jar"
1096 inputs += [ _android_sdk_ijar ]
1097 _rebased_android_sdk_ijar = rebase_path(_android_sdk_ijar, root_build_dir)
1098 args += [ "--bootclasspath=$_rebased_android_sdk_ijar" ]
1095 } 1099 }
1096 foreach(e, _manifest_entries) { 1100 foreach(e, _manifest_entries) {
1097 args += [ "--manifest-entry=" + e ] 1101 args += [ "--manifest-entry=" + e ]
1098 } 1102 }
1099 if (_chromium_code) { 1103 if (_chromium_code) {
1100 args += [ "--chromium-code=1" ] 1104 args += [ "--chromium-code=1" ]
1101 } 1105 }
1102 if (_enable_errorprone) { 1106 if (_enable_errorprone) {
1103 deps += [ "//third_party/errorprone:chromium_errorprone" ] 1107 deps += [ "//third_party/errorprone:chromium_errorprone" ]
1104 args += [ 1108 args += [
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1609 ] 1613 ]
1610 args = [ 1614 args = [
1611 "--depfile", 1615 "--depfile",
1612 rebase_path(depfile, root_build_dir), 1616 rebase_path(depfile, root_build_dir),
1613 "--script-output-path", 1617 "--script-output-path",
1614 rebase_path(generated_script, root_build_dir), 1618 rebase_path(generated_script, root_build_dir),
1615 ] 1619 ]
1616 args += test_runner_args 1620 args += test_runner_args
1617 } 1621 }
1618 } 1622 }
OLDNEW
« no previous file with comments | « build/android/gyp/javac.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698