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

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

Issue 1498593003: GN(android): Distinguish java_binary from java_library in build_config (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@build_config_barriers
Patch Set: Created 5 years 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/write_build_config.py ('k') | build/config/android/rules.gni » ('j') | 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("//build/config/sanitizers/sanitizers.gni") 6 import("//build/config/sanitizers/sanitizers.gni")
7 import("//build/config/zip.gni") 7 import("//build/config/zip.gni")
8 import("//third_party/ijar/ijar.gni") 8 import("//third_party/ijar/ijar.gni")
9 9
10 assert(is_android) 10 assert(is_android)
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 # See build/android/gyp/write_build_config.py and 334 # See build/android/gyp/write_build_config.py and
335 # build/android/gyp/util/build_utils.py:ExpandFileArgs 335 # build/android/gyp/util/build_utils.py:ExpandFileArgs
336 template("write_build_config") { 336 template("write_build_config") {
337 action(target_name) { 337 action(target_name) {
338 set_sources_assignment_filter([]) 338 set_sources_assignment_filter([])
339 type = invoker.type 339 type = invoker.type
340 build_config = invoker.build_config 340 build_config = invoker.build_config
341 341
342 assert(type == "android_apk" || type == "java_library" || 342 assert(type == "android_apk" || type == "java_library" ||
343 type == "android_resources" || type == "deps_dex" || 343 type == "android_resources" || type == "deps_dex" ||
344 type == "android_assets" || type == "resource_rewriter") 344 type == "android_assets" || type == "resource_rewriter" ||
345 type == "java_binary")
345 346
346 deps = [] 347 deps = []
347 forward_variables_from(invoker, 348 forward_variables_from(invoker,
348 [ 349 [
349 "deps", 350 "deps",
350 "testonly", 351 "testonly",
351 "visibility", 352 "visibility",
352 ]) 353 ])
353 354
354 script = "//build/android/gyp/write_build_config.py" 355 script = "//build/android/gyp/write_build_config.py"
(...skipping 17 matching lines...) Expand all
372 args = [ 373 args = [
373 "--type", 374 "--type",
374 type, 375 type,
375 "--depfile", 376 "--depfile",
376 rebase_path(depfile, root_build_dir), 377 rebase_path(depfile, root_build_dir),
377 "--possible-deps-configs=$rebase_possible_deps_configs", 378 "--possible-deps-configs=$rebase_possible_deps_configs",
378 "--build-config", 379 "--build-config",
379 rebase_path(build_config, root_build_dir), 380 rebase_path(build_config, root_build_dir),
380 ] 381 ]
381 382
382 is_java_library = type == "java_library" 383 is_java = type == "java_library" || type == "java_binary"
383 is_apk = type == "android_apk" 384 is_apk = type == "android_apk"
384 is_android_assets = type == "android_assets" 385 is_android_assets = type == "android_assets"
385 is_android_resources = type == "android_resources" 386 is_android_resources = type == "android_resources"
386 is_deps_dex = type == "deps_dex" 387 is_deps_dex = type == "deps_dex"
387 388
388 supports_android = 389 supports_android =
389 is_apk || is_android_assets || is_android_resources || is_deps_dex || 390 is_apk || is_android_assets || is_android_resources || is_deps_dex ||
390 (is_java_library && defined(invoker.supports_android) && 391 (is_java && defined(invoker.supports_android) &&
391 invoker.supports_android) 392 invoker.supports_android)
392 requires_android = 393 requires_android =
393 is_apk || is_android_assets || is_android_resources || is_deps_dex || 394 is_apk || is_android_assets || is_android_resources || is_deps_dex ||
394 (is_java_library && defined(invoker.requires_android) && 395 (is_java && defined(invoker.requires_android) &&
395 invoker.requires_android) 396 invoker.requires_android)
396 397
397 assert(!requires_android || supports_android, 398 assert(!requires_android || supports_android,
398 "requires_android requires" + " supports_android") 399 "requires_android requires" + " supports_android")
399 400
400 # Mark these variables as used. 401 # Mark these variables as used.
401 assert(is_java_library || true) 402 assert(is_java || true)
402 assert(is_apk || true) 403 assert(is_apk || true)
403 assert(is_android_resources || true) 404 assert(is_android_resources || true)
404 assert(is_deps_dex || true) 405 assert(is_deps_dex || true)
405 406
406 if (is_java_library || is_apk) { 407 if (is_java || is_apk) {
407 args += [ 408 args += [
408 "--jar-path", 409 "--jar-path",
409 rebase_path(invoker.jar_path, root_build_dir), 410 rebase_path(invoker.jar_path, root_build_dir),
410 ] 411 ]
411 } 412 }
412 413
413 if (is_apk || is_deps_dex || (is_java_library && supports_android)) { 414 if (is_apk || is_deps_dex || (is_java && supports_android)) {
414 args += [ 415 args += [
415 "--dex-path", 416 "--dex-path",
416 rebase_path(invoker.dex_path, root_build_dir), 417 rebase_path(invoker.dex_path, root_build_dir),
417 ] 418 ]
418 } 419 }
419 if (supports_android) { 420 if (supports_android) {
420 args += [ "--supports-android" ] 421 args += [ "--supports-android" ]
421 } 422 }
422 if (requires_android) { 423 if (requires_android) {
423 args += [ "--requires-android" ] 424 args += [ "--requires-android" ]
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 "java_library_impl($target_name), you should " + 1541 "java_library_impl($target_name), you should " +
1541 "also specify the target that made it in the deps") 1542 "also specify the target that made it in the deps")
1542 build_config_deps = invoker.deps 1543 build_config_deps = invoker.deps
1543 } else { 1544 } else {
1544 _build_config = _base_path + ".build_config" 1545 _build_config = _base_path + ".build_config"
1545 build_config_target_name = "${_template_name}__build_config" 1546 build_config_target_name = "${_template_name}__build_config"
1546 build_config_deps = [ ":$build_config_target_name" ] 1547 build_config_deps = [ ":$build_config_target_name" ]
1547 1548
1548 write_build_config(build_config_target_name) { 1549 write_build_config(build_config_target_name) {
1549 forward_variables_from(invoker, [ "deps" ]) 1550 forward_variables_from(invoker, [ "deps" ])
1550 type = "java_library" 1551 if (defined(invoker.is_java_binary) && invoker.is_java_binary) {
1552 type = "java_binary"
1553 } else {
1554 type = "java_library"
1555 }
1551 supports_android = _supports_android 1556 supports_android = _supports_android
1552 requires_android = _requires_android 1557 requires_android = _requires_android
1553 bypass_platform_checks = defined(invoker.bypass_platform_checks) && 1558 bypass_platform_checks = defined(invoker.bypass_platform_checks) &&
1554 invoker.bypass_platform_checks 1559 invoker.bypass_platform_checks
1555 1560
1556 build_config = _build_config 1561 build_config = _build_config
1557 jar_path = _jar_path 1562 jar_path = _jar_path
1558 if (_supports_android) { 1563 if (_supports_android) {
1559 dex_path = _dex_path 1564 dex_path = _dex_path
1560 } 1565 }
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 ] 2010 ]
2006 args = [ 2011 args = [
2007 "--depfile", 2012 "--depfile",
2008 rebase_path(depfile, root_build_dir), 2013 rebase_path(depfile, root_build_dir),
2009 "--script-output-path", 2014 "--script-output-path",
2010 rebase_path(generated_script, root_build_dir), 2015 rebase_path(generated_script, root_build_dir),
2011 ] 2016 ]
2012 args += test_runner_args 2017 args += test_runner_args
2013 } 2018 }
2014 } 2019 }
OLDNEW
« 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