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

Side by Side Diff: chrome/android/BUILD.gn

Issue 1458353002: Port ChromeSyncShell build rules to GN (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/config/android/rules.gni ('k') | chrome/android/chrome_apk.gyp » ('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/android/rules.gni") 6 import("//build/config/android/rules.gni")
7 import("//build_overrides/v8.gni") 7 import("//build_overrides/v8.gni")
8 import("//chrome/android/chrome_public_apk_tmpl.gni") 8 import("//chrome/android/chrome_public_apk_tmpl.gni")
9 import("//chrome/version.gni") 9 import("//chrome/version.gni")
10 import("//testing/test.gni") 10 import("//testing/test.gni")
11 import("//third_party/icu/config.gni") 11 import("//third_party/icu/config.gni")
12 import("//third_party/protobuf/proto_library.gni") 12 import("//third_party/protobuf/proto_library.gni")
13 import("channel.gni") 13 import("channel.gni")
14 14
15 manifest_package = "org.chromium.chrome" 15 manifest_package = "org.chromium.chrome"
16 if (enable_configuration_policy) { 16 if (enable_configuration_policy) {
17 configuration_policy = 1 17 configuration_policy = 1
18 } else { 18 } else {
19 configuration_policy = 0 19 configuration_policy = 0
20 } 20 }
21 21
22 jinja_variables = [ 22 chrome_public_jinja_variables = [
23 "channel=$android_channel", 23 "channel=$android_channel",
24 "manifest_package=$manifest_package", 24 "manifest_package=$manifest_package",
25 "configuration_policy=$configuration_policy", 25 "configuration_policy=$configuration_policy",
26 ] 26 ]
27 27
28 chrome_sync_shell_jinja_variables = [
29 "channel=$android_channel",
30 "manifest_package=org.chromium.chrome.sync_shell",
31 "configuration_policy=$configuration_policy",
32 ]
33
34 chrome_apk_gypi = exec_script("//build/gypi_to_gn.py",
35 [ rebase_path("chrome_apk.gyp") ],
36 "scope",
37 [ "chrome_apk.gyp" ])
38
28 chrome_android_paks_gypi = 39 chrome_android_paks_gypi =
29 exec_script("//build/gypi_to_gn.py", 40 exec_script("//build/gypi_to_gn.py",
30 [ 41 [
31 rebase_path("//chrome/chrome_android_paks.gypi"), 42 rebase_path("//chrome/chrome_android_paks.gypi"),
32 "--replace=<(PRODUCT_DIR)=$root_out_dir", 43 "--replace=<(PRODUCT_DIR)=$root_out_dir",
33 ], 44 ],
34 "scope", 45 "scope",
35 [ "//chrome/chrome_android_paks.gypi" ]) 46 [ "//chrome/chrome_android_paks.gypi" ])
36 47
37 locale_pak_resources("chrome_locale_paks") { 48 locale_pak_resources("chrome_locale_paks") {
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 "//chrome:packed_resources", 368 "//chrome:packed_resources",
358 "//third_party/icu:icu_assets", 369 "//third_party/icu:icu_assets",
359 "//v8:v8_external_startup_data_assets", 370 "//v8:v8_external_startup_data_assets",
360 ] 371 ]
361 } 372 }
362 373
363 # GYP: //chrome/android/chrome_apk.gyp:chrome_apk_manifest 374 # GYP: //chrome/android/chrome_apk.gyp:chrome_apk_manifest
364 jinja_template("chrome_public_apk_manifest") { 375 jinja_template("chrome_public_apk_manifest") {
365 input = "java/AndroidManifest.xml" 376 input = "java/AndroidManifest.xml"
366 output = "$root_gen_dir/chrome_public_apk_manifest/AndroidManifest.xml" 377 output = "$root_gen_dir/chrome_public_apk_manifest/AndroidManifest.xml"
367 variables = jinja_variables 378 variables = chrome_public_jinja_variables
368 variables += [ 379 variables += [
369 "min_sdk_version=16", 380 "min_sdk_version=16",
370 "target_sdk_version=23", 381 "target_sdk_version=23",
371 ] 382 ]
372 } 383 }
373 384
374 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_template_resources 385 # GYP: //chrome/android/chrome_apk.gyp:chrome_sync_shell_apk_manifest
375 jinja_template_resources("chrome_public_template_resources") { 386 jinja_template("chrome_sync_shell_apk_manifest") {
387 input = "java/AndroidManifest.xml"
388 output = "$root_gen_dir/chrome_sync_shell_apk_manifest/AndroidManifest.xml"
389 variables = chrome_sync_shell_jinja_variables
390 variables += [
391 "min_sdk_version=16",
392 "target_sdk_version=22",
393 ]
394 }
395
396 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_apk_template_resources
397 jinja_template_resources("chrome_public_apk_template_resources") {
376 resources = [ 398 resources = [
377 "java/res_template/xml/searchable.xml", 399 "java/res_template/xml/searchable.xml",
378 "java/res_template/xml/syncadapter.xml", 400 "java/res_template/xml/syncadapter.xml",
379 ] 401 ]
380 res_dir = "java/res_template" 402 res_dir = "java/res_template"
381 variables = jinja_variables 403 variables = chrome_public_jinja_variables
404 }
405
406 # GYP: //chrome/android/chrome_apk.gyp:chrome_sync_shell_apk_template_resources
407 jinja_template_resources("chrome_sync_shell_apk_template_resources") {
408 resources = [
409 "java/res_template/xml/searchable.xml",
410 "java/res_template/xml/syncadapter.xml",
411 ]
412 res_dir = "java/res_template"
413 variables = chrome_sync_shell_jinja_variables
382 } 414 }
383 415
384 # GYP: //chrome/android/chrome_apk.gyp:libchrome_public 416 # GYP: //chrome/android/chrome_apk.gyp:libchrome_public
385 shared_library("chrome_public") { 417 shared_library("chrome_public") {
386 deps = [ 418 deps = [
387 "//build/config/sanitizers:deps", 419 "//build/config/sanitizers:deps",
388 "//chrome:chrome_android_core", 420 "//chrome:chrome_android_core",
389 ] 421 ]
390 gypi_values = exec_script( 422 sources = chrome_apk_gypi.chrome_public_app_native_sources
391 "//build/gypi_to_gn.py",
392 [
393 rebase_path("chrome_apk.gyp"),
394 "--replace=<(chrome_native_sources_dir)=../browser/android/",
395 ],
396 "scope",
397 [ "chrome_apk.gyp" ])
398 sources = gypi_values.chrome_public_app_native_sources
399 } 423 }
400 424
401 chrome_public_apk_tmpl("chrome_public_apk") { 425 # GYP: //chrome/android/chrome_apk.gyp:libchrome_sync_shell
402 version_name = "Developer Build" 426 shared_library("chrome_sync_shell") {
403 version_code = "1" 427 testonly = true
428 deps = [
429 "//build/config/sanitizers:deps",
430 "//chrome:chrome_android_core",
431 "//sync",
432 "//sync:test_support_sync_fake_server_android",
433 ]
434 sources = chrome_apk_gypi.chrome_sync_shell_app_native_sources
435 }
436
437 # Contains rules common to chrome_public_apk and chrome_sync_shell_apk
438 template("chrome_public_apk_tmpl_shared") {
439 chrome_public_apk_tmpl(target_name) {
440 forward_variables_from(invoker, "*")
441
442 native_lib_version_rule = "//build/util:chrome_version_json"
443
444 # Only attempt loading the library from the APK for 64 bit devices
445 # until the number of 32 bit devices which don't support this
446 # approach falls to a minimal level - http://crbug.com/390618.
447 if (chromium_linker_supported &&
448 (target_cpu == "arm64" || target_cpu == "x64")) {
449 load_library_from_apk = chrome_public_apk_load_library_from_apk
450 }
451
452 deps += [
453 ":chrome_java",
454 ":chrome_public_apk_assets",
455 ":chrome_public_apk_resources",
456 "//base:base_java",
457 google_play_services_resources,
458 ]
459 }
460 }
461
462 chrome_public_apk_tmpl_shared("chrome_public_apk") {
404 android_manifest = get_target_outputs(":chrome_public_apk_manifest") 463 android_manifest = get_target_outputs(":chrome_public_apk_manifest")
405 android_manifest = android_manifest[1] 464 android_manifest = android_manifest[1]
406 apk_name = "ChromePublic" 465 apk_name = "ChromePublic"
407 native_libs = [ "libchrome_public.so" ] 466 native_libs = [ "libchrome_public.so" ]
408 native_lib_version_rule = "//build/util:chrome_version_json"
409
410 # Only attempt loading the library from the APK for 64 bit devices
411 # until the number of 32 bit devices which don't support this
412 # approach falls to a minimal level - http://crbug.com/390618.
413 if (chromium_linker_supported &&
414 (target_cpu == "arm64" || target_cpu == "x64")) {
415 load_library_from_apk = chrome_public_apk_load_library_from_apk
416 }
417 467
418 deps = [ 468 deps = [
419 ":chrome_java",
420 ":chrome_public", 469 ":chrome_public",
421 ":chrome_public_apk_assets",
422 ":chrome_public_apk_manifest", 470 ":chrome_public_apk_manifest",
423 ":chrome_public_apk_resources", 471 ":chrome_public_apk_template_resources",
424 ":chrome_public_template_resources", 472 ]
425 "//base:base_java", 473 }
426 google_play_services_resources, 474
475 chrome_public_apk_tmpl_shared("chrome_sync_shell_apk") {
476 testonly = true
477 android_manifest = get_target_outputs(":chrome_sync_shell_apk_manifest")
478 android_manifest = android_manifest[1]
479 apk_name = "ChromeSyncShell"
480 native_libs = [ "libchrome_sync_shell.so" ]
481
482 deps = [
483 ":chrome_sync_shell",
484 ":chrome_sync_shell_apk_manifest",
485 ":chrome_sync_shell_apk_template_resources",
486
487 # This exists here because com.google.protobuf.nano is needed in tests,
488 # but that code is stripped out via proguard. Adding this deps adds
489 # usages and prevents removal of the proto code.
490 "//sync:test_support_sync_proto_java",
427 ] 491 ]
428 } 492 }
429 493
430 chrome_public_test_apk_manifest = 494 chrome_public_test_apk_manifest =
431 "$root_gen_dir/chrome_public_test_apk_manifest/AndroidManifest.xml" 495 "$root_gen_dir/chrome_public_test_apk_manifest/AndroidManifest.xml"
496 chrome_sync_shell_test_apk_manifest =
497 "$root_gen_dir/chrome_sync_shell_test_apk_manifest/AndroidManifest.xml"
432 498
433 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_test_apk_manifest 499 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_test_apk_manifest
434 jinja_template("chrome_public_test_apk_manifest") { 500 jinja_template("chrome_public_test_apk_manifest") {
435 input = "javatests/AndroidManifest.xml" 501 input = "javatests/AndroidManifest.xml"
436 output = chrome_public_test_apk_manifest 502 output = chrome_public_test_apk_manifest
437 variables = jinja_variables 503 variables = chrome_public_jinja_variables
504 }
505
506 # GYP: //chrome/android/chrome_apk.gyp:chrome_sync_shell_test_apk_manifest
507 jinja_template("chrome_sync_shell_test_apk_manifest") {
508 input = "sync_shell/javatests/AndroidManifest.xml"
509 output = chrome_sync_shell_test_apk_manifest
510 variables = chrome_sync_shell_jinja_variables
438 } 511 }
439 512
440 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_test_apk 513 # GYP: //chrome/android/chrome_apk.gyp:chrome_public_test_apk
441 instrumentation_test_apk("chrome_public_test_apk") { 514 instrumentation_test_apk("chrome_public_test_apk") {
442 apk_name = "ChromePublicTest" 515 apk_name = "ChromePublicTest"
443 apk_under_test = ":chrome_public_apk" 516 apk_under_test = ":chrome_public_apk"
444 android_manifest = chrome_public_test_apk_manifest 517 android_manifest = chrome_public_test_apk_manifest
445 deps = [ 518 deps = [
446 ":chrome_public_test_apk_manifest", 519 ":chrome_public_test_apk_manifest",
447 "//chrome/android:chrome_shared_test_java", 520 ":chrome_shared_test_java",
448 ] 521 ]
449 isolate_file = "../chrome_public_test_apk.isolate" 522 isolate_file = "../chrome_public_test_apk.isolate"
450 proguard_enabled = !is_debug 523 proguard_enabled = !is_debug
451 } 524 }
525
526 android_library("chrome_sync_shell_test_apk_java") {
527 testonly = true
528 DEPRECATED_java_in_dir = "sync_shell/javatests/src"
529
530 deps = [
531 "//base:base_java",
532 "//base:base_java_test_support",
533 "//chrome/android:chrome_java",
534 "//chrome/android:chrome_java_resources",
535 "//chrome/test/android:chrome_java_test_support",
536 "//components/bookmarks/common/android:bookmarks_java",
537 "//components/policy/android:policy_java",
538 "//content/public/android:content_java",
539 "//content/public/test/android:content_java_test_support",
540 "//sync:sync_java_test_support",
541 "//sync:test_support_sync_proto_java",
542 "//sync/android:sync_java",
543 "//third_party/android_protobuf:protobuf_nano_javalib",
544 "//third_party/android_tools:android_support_v13_java",
545 "//third_party/android_tools:android_support_v7_appcompat_java",
546 "//ui/android:ui_java",
547 ]
548 }
549
550 # GYP: //chrome/android/chrome_apk.gyp:chrome_sync_shell_test_apk
551 instrumentation_test_apk("chrome_sync_shell_test_apk") {
552 apk_name = "ChromeSyncShellTest"
553 apk_under_test = ":chrome_sync_shell_apk"
554 android_manifest = chrome_sync_shell_test_apk_manifest
555 deps = [
556 ":chrome_sync_shell_test_apk_java",
557 ":chrome_sync_shell_test_apk_manifest",
558 ]
559 isolate_file = "../chrome_sync_shell_test_apk.isolate"
560 proguard_enabled = !is_debug
561 }
OLDNEW
« no previous file with comments | « build/config/android/rules.gni ('k') | chrome/android/chrome_apk.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698