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

Side by Side Diff: chrome/BUILD.gn

Issue 2348643002: Revert of Enable whitelisting for targets other than libchrome. (Closed)
Patch Set: Created 4 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 | « no previous file | chrome/chrome_paks.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/buildflag_header.gni") 5 import("//build/buildflag_header.gni")
6 import("//build/config/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 import("//build/config/compiler/compiler.gni") 7 import("//build/config/compiler/compiler.gni")
8 import("//build/config/features.gni") 8 import("//build/config/features.gni")
9 import("//build/config/locales.gni") 9 import("//build/config/locales.gni")
10 import("//build/config/sanitizers/sanitizers.gni") 10 import("//build/config/sanitizers/sanitizers.gni")
11 import("//build/config/ui.gni") 11 import("//build/config/ui.gni")
12 import("//build/config/win/console_app.gni") 12 import("//build/config/win/console_app.gni")
13 import("//build/config/win/manifest.gni") 13 import("//build/config/win/manifest.gni")
14 import("//chrome/chrome_paks.gni") 14 import("//chrome/chrome_repack_locales.gni")
15 import("//chrome/common/features.gni") 15 import("//chrome/common/features.gni")
16 import("//chrome/version.gni") 16 import("//chrome/version.gni")
17 import("//third_party/widevine/cdm/widevine.gni") 17 import("//third_party/widevine/cdm/widevine.gni")
18 import("//ui/base/ui_features.gni") 18 import("//ui/base/ui_features.gni")
19 import("//v8/gni/v8.gni") 19 import("//v8/gni/v8.gni")
20 20
21 if (enable_resource_whitelist_generation) {
22 android_resource_whitelist = "$root_gen_dir/chrome/resource_whitelist.txt"
23 }
24
21 if (is_android) { 25 if (is_android) {
22 import("//build/config/android/rules.gni") 26 import("//build/config/android/rules.gni")
23 } else if (is_mac) { 27 } else if (is_mac) {
24 import("//build/compiled_action.gni") 28 import("//build/compiled_action.gni")
25 import("//build/config/mac/rules.gni") 29 import("//build/config/mac/rules.gni")
26 import("//build/config/mac/symbols.gni") 30 import("//build/config/mac/symbols.gni")
27 import("//build/mac/tweak_info_plist.gni") 31 import("//build/mac/tweak_info_plist.gni")
28 import("//build/util/branding.gni") 32 import("//build/util/branding.gni")
29 import("//build/util/version.gni") 33 import("//build/util/version.gni")
30 import("//build_overrides/v8.gni") 34 import("//build_overrides/v8.gni")
31 import("//media/cdm/ppapi/cdm_paths.gni") 35 import("//media/cdm/ppapi/cdm_paths.gni")
32 import("//third_party/icu/config.gni") 36 import("//third_party/icu/config.gni")
33 } 37 }
34 38
35 if (enable_resource_whitelist_generation) {
36 chrome_resource_whitelist = "$target_gen_dir/chrome_resource_whitelist.txt"
37 }
38
39 if (is_win) { 39 if (is_win) {
40 action("reorder_imports") { 40 action("reorder_imports") {
41 script = "//build/win/reorder-imports.py" 41 script = "//build/win/reorder-imports.py"
42 42
43 # See comment in chrome_dll.gypi in the hardlink_to_output 43 # See comment in chrome_dll.gypi in the hardlink_to_output
44 # target for why this cannot be 'initial' like the DLL. 44 # target for why this cannot be 'initial' like the DLL.
45 inputs = [ 45 inputs = [
46 "$root_out_dir/initialexe/chrome.exe", 46 "$root_out_dir/initialexe/chrome.exe",
47 ] 47 ]
48 outputs = [ 48 outputs = [
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 ] 990 ]
991 991
992 public_deps = [ 992 public_deps = [
993 ":chrome_dll", 993 ":chrome_dll",
994 ] 994 ]
995 995
996 deps = [ 996 deps = [
997 ":chrome_framework_helpers", 997 ":chrome_framework_helpers",
998 ":chrome_framework_plugins", 998 ":chrome_framework_plugins",
999 ":chrome_framework_resources", 999 ":chrome_framework_resources",
1000 ":packed_resources", 1000 ":repack_locales_pack",
1001 ":widevine_cdm_library", 1001 ":widevine_cdm_library",
1002 "//build/config/sanitizers:deps", 1002 "//build/config/sanitizers:deps",
1003 "//chrome/app/nibs:chrome_xibs", 1003 "//chrome/app/nibs:chrome_xibs",
1004 ] 1004 ]
1005 1005
1006 if (is_chrome_branded) { 1006 if (is_chrome_branded) {
1007 deps += [ ":default_apps" ] 1007 deps += [ ":default_apps" ]
1008 } 1008 }
1009 1009
1010 ldflags = [ 1010 ldflags = [
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1333 outputs = [ 1333 outputs = [
1334 "{{bundle_root_dir}}/Default Apps/{{source_file_part}}", 1334 "{{bundle_root_dir}}/Default Apps/{{source_file_part}}",
1335 ] 1335 ]
1336 } 1336 }
1337 1337
1338 # Force anybody that depends on this to get the default apps as data files. 1338 # Force anybody that depends on this to get the default apps as data files.
1339 data = process_file_template(sources, outputs) 1339 data = process_file_template(sources, outputs)
1340 } 1340 }
1341 } 1341 }
1342 1342
1343 chrome_paks("packed_resources") { 1343 group("packed_resources") {
1344 if (is_mac) { 1344 public_deps = [
1345 output_dir = "$root_gen_dir/repack" 1345 ":repack_chrome_100_percent",
1346 copy_data_to_bundle = true 1346 ":repack_locales_pack",
1347 } else { 1347 ]
1348 output_dir = root_out_dir
1349 }
1350
1351 if (enable_resource_whitelist_generation) {
1352 repack_whitelist = chrome_resource_whitelist
1353 deps = [
1354 "//chrome:resource_whitelist",
1355 ]
1356 }
1357 1348
1358 if (is_chrome_branded && !is_mac && !is_android) { 1349 if (is_chrome_branded && !is_mac && !is_android) {
1359 public_deps += [ ":default_apps" ] 1350 public_deps += [ ":default_apps" ]
1360 } 1351 }
1352
1353 if (enable_hidpi) {
1354 public_deps += [ ":repack_chrome_200_percent" ]
1355 }
1361 } 1356 }
1362 1357
1363 chrome_extra_paks("packed_extra_resources") { 1358 repack("packed_extra_resources") {
1359 visibility = [ "./*" ]
1360 sources = [
1361 "$root_gen_dir/blink/public/resources/blink_resources.pak",
1362 "$root_gen_dir/chrome/browser_resources.pak",
1363 "$root_gen_dir/chrome/chrome_unscaled_resources.pak",
1364 "$root_gen_dir/chrome/common_resources.pak",
1365 "$root_gen_dir/chrome/invalidations_resources.pak",
1366 "$root_gen_dir/chrome/net_internals_resources.pak",
1367 "$root_gen_dir/chrome/password_manager_internals_resources.pak",
1368 "$root_gen_dir/chrome/policy_resources.pak",
1369 "$root_gen_dir/chrome/translate_internals_resources.pak",
1370 "$root_gen_dir/components/components_resources.pak",
1371 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
1372 "$root_gen_dir/content/content_resources.pak",
1373 "$root_gen_dir/net/net_resources.pak",
1374 "$root_gen_dir/ui/resources/webui_resources.pak",
1375 ]
1376 deps = [
1377 "//chrome/app/theme:chrome_unscaled_resources",
1378 "//chrome/browser:resources",
1379 "//chrome/browser/resources:invalidations_resources",
1380 "//chrome/browser/resources:net_internals_resources",
1381 "//chrome/browser/resources:password_manager_internals_resources",
1382 "//chrome/browser/resources:policy_resources",
1383 "//chrome/browser/resources:translate_internals_resources",
1384 "//chrome/common:resources",
1385 "//components/resources",
1386 "//content:resources",
1387 "//content/browser/tracing:resources",
1388 "//net:net_resources",
1389 "//third_party/WebKit/public:resources",
1390 "//ui/resources",
1391 ]
1392
1393 if (is_android) {
1394 sources += [ "$root_gen_dir/android_webview/aw_resources.pak" ]
1395 deps += [ "//android_webview:generate_aw_resources" ]
1396 } else { # Non-Android.
1397 # New paks should be added here by default.
1398 sources += [
1399 "$root_gen_dir/blink/devtools_resources.pak",
1400 "$root_gen_dir/chrome/component_extension_resources.pak",
1401 "$root_gen_dir/chrome/options_resources.pak",
1402 "$root_gen_dir/chrome/quota_internals_resources.pak",
1403 "$root_gen_dir/chrome/settings_resources.pak",
1404 "$root_gen_dir/chrome/sync_file_system_internals_resources.pak",
1405 ]
1406 deps += [
1407 "//chrome/browser/resources:component_extension_resources",
1408 "//chrome/browser/resources:options_resources",
1409 "//chrome/browser/resources:quota_internals_resources",
1410 "//chrome/browser/resources:settings_resources",
1411 "//chrome/browser/resources:sync_file_system_internals_resources",
1412 "//content/browser/devtools:devtools_resources",
1413 ]
1414 }
1415 if (is_chromeos) {
1416 sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ]
1417 deps += [ "//ui/file_manager:resources" ]
1418 }
1419 if (enable_extensions) {
1420 sources += [
1421 "$root_gen_dir/extensions/extensions_renderer_resources.pak",
1422 "$root_gen_dir/extensions/extensions_resources.pak",
1423 ]
1424 deps += [ "//extensions:extensions_resources" ]
1425 }
1426
1364 if (is_mac) { 1427 if (is_mac) {
1365 output_dir = "$root_gen_dir/repack" 1428 output = "$root_gen_dir/repack/resources.pak"
1366 copy_data_to_bundle = true
1367 } else { 1429 } else {
1368 output_dir = root_out_dir 1430 output = "$root_out_dir/resources.pak"
1369 } 1431 }
1370 1432
1371 copy_data_to_bundle = is_mac 1433 copy_data_to_bundle = is_mac
1372 if (enable_resource_whitelist_generation) { 1434 if (enable_resource_whitelist_generation) {
1373 repack_whitelist = chrome_resource_whitelist 1435 repack_whitelist = android_resource_whitelist
1374 deps = [ 1436 deps += [ ":resource_whitelist" ]
1375 ":resource_whitelist",
1376 ]
1377 } 1437 }
1378 } 1438 }
1379 1439
1380 # GYP version: chrome/chrome_resources.gyp:browser_tests_pak 1440 # GYP version: chrome/chrome_resources.gyp:browser_tests_pak
1381 repack("browser_tests_pak") { 1441 repack("browser_tests_pak") {
1382 sources = [ 1442 sources = [
1383 "$root_gen_dir/chrome/options_test_resources.pak", 1443 "$root_gen_dir/chrome/options_test_resources.pak",
1384 "$root_gen_dir/chrome/webui_test_resources.pak", 1444 "$root_gen_dir/chrome/webui_test_resources.pak",
1385 ] 1445 ]
1386 output = "$root_out_dir/browser_tests.pak" 1446 output = "$root_out_dir/browser_tests.pak"
1387 deps = [ 1447 deps = [
1388 "//chrome/browser/resources:options_test_resources", 1448 "//chrome/browser/resources:options_test_resources",
1389 "//chrome/test/data:webui_test_resources", 1449 "//chrome/test/data:webui_test_resources",
1390 ] 1450 ]
1391 } 1451 }
1392 1452
1453 # Collects per-locale grit files from many sources into global per-locale files.
1454 chrome_repack_locales("repack_locales_pack") {
1455 visibility = [ ":*" ]
1456
1457 input_locales = locales
1458 copy_data_to_bundle = is_mac
1459
1460 if (is_mac) {
1461 output_locales = locales_as_mac_outputs
1462 } else {
1463 output_locales = locales
1464 }
1465
1466 if (enable_resource_whitelist_generation) {
1467 repack_whitelist = android_resource_whitelist
1468 deps = [
1469 ":resource_whitelist",
1470 ]
1471 }
1472 }
1473
1474 # Generates a rule to repack a set of resources, substituting a given string
1475 # in for the percentage (e.g. "100", "200"). It generates the repacked files in
1476 # the "gen" directory, and then introduces a copy rule to copy it to the root
1477 # build directory.
1478 #
1479 # It's not clear why this two-step dance is necessary as opposed to just
1480 # generating the file in the destination. However, this is what the GYP build
1481 # does, and for maintenance purposes, this keeps the same files in the same
1482 # place between the two builds when possible.
1483 #
1484 # Argument:
1485 # percent [required]
1486 # String to substitute for the percentage.
1487 template("chrome_repack_percent") {
1488 percent = invoker.percent
1489
1490 repack_name = "${target_name}_repack"
1491 repack_output_file = "$root_gen_dir/repack/chrome_${percent}_percent.pak"
1492
1493 copy_name = target_name
1494
1495 repack(repack_name) {
1496 visibility = [ ":$copy_name" ]
1497
1498 # All sources should also have deps for completeness.
1499 sources = [
1500 "$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_per cent.pak",
1501 "$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak",
1502 "$root_gen_dir/chrome/theme_resources_${percent}_percent.pak",
1503 "$root_gen_dir/components/components_resources_${percent}_percent.pak",
1504 "$root_gen_dir/content/app/resources/content_resources_${percent}_percent. pak",
1505 "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
1506 ]
1507
1508 deps = [
1509 "//chrome/app/theme:theme_resources",
1510 "//chrome/renderer:resources",
1511 "//components/resources",
1512 "//components/strings",
1513 "//content/app/resources",
1514 "//net:net_resources",
1515 "//third_party/WebKit/public:image_resources",
1516 "//ui/resources",
1517 ]
1518
1519 if (use_ash) {
1520 sources +=
1521 [ "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak" ]
1522 deps += [ "//ash/resources" ]
1523 }
1524 if (toolkit_views) {
1525 sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_ percent.pak" ]
1526 deps += [ "//ui/views/resources" ]
1527 }
1528 if (is_chromeos) {
1529 sources += [ "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${ percent}_percent.pak" ]
1530 deps += [ "//ui/chromeos/resources" ]
1531 }
1532 if (enable_extensions) {
1533 sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${perc ent}_percent.pak" ]
1534 deps += [ "//extensions:extensions_browser_resources" ]
1535 }
1536 if (enable_app_list) {
1537 sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_${per cent}_percent.pak" ]
1538 deps += [ "//ui/app_list/resources" ]
1539 }
1540
1541 output = repack_output_file
1542 copy_data_to_bundle = is_mac
1543
1544 if (enable_resource_whitelist_generation) {
1545 repack_whitelist = android_resource_whitelist
1546 deps += [ ":resource_whitelist" ]
1547 }
1548 }
1549
1550 copy(copy_name) {
1551 visibility = [ ":*" ]
1552 deps = [
1553 ":$repack_name",
1554 ]
1555 sources = [
1556 repack_output_file,
1557 ]
1558 outputs = [
1559 "$root_build_dir/chrome_${percent}_percent.pak",
1560 ]
1561 }
1562 }
1563
1564 chrome_repack_percent("repack_chrome_100_percent") {
1565 percent = "100"
1566 }
1567
1568 if (enable_hidpi) {
1569 chrome_repack_percent("repack_chrome_200_percent") {
1570 percent = "200"
1571 }
1572 }
1573
1393 # GYP version: chrome/chrome_resources.gyp:chrome_strings 1574 # GYP version: chrome/chrome_resources.gyp:chrome_strings
1394 group("strings") { 1575 group("strings") {
1395 public_deps = [ 1576 public_deps = [
1396 "//chrome/app:chromium_strings", 1577 "//chrome/app:chromium_strings",
1397 "//chrome/app:generated_resources", 1578 "//chrome/app:generated_resources",
1398 "//chrome/app:google_chrome_strings", 1579 "//chrome/app:google_chrome_strings",
1399 "//chrome/app/resources:locale_settings", 1580 "//chrome/app/resources:locale_settings",
1400 ] 1581 ]
1401 } 1582 }
1402 1583
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 "//chrome/renderer", 1653 "//chrome/renderer",
1473 "//chrome/utility", 1654 "//chrome/utility",
1474 "//components/safe_browsing_db:safe_browsing_db_mobile", 1655 "//components/safe_browsing_db:safe_browsing_db_mobile",
1475 "//content/public/app:both", 1656 "//content/public/app:both",
1476 ] 1657 ]
1477 } 1658 }
1478 } 1659 }
1479 1660
1480 if (enable_resource_whitelist_generation) { 1661 if (enable_resource_whitelist_generation) {
1481 action("resource_whitelist") { 1662 action("resource_whitelist") {
1482 assert(is_android,
1483 "Resource whitelist currently implemented only on Android")
1484
1485 deps = [ 1663 deps = [
1486 "//chrome/android:chrome", 1664 "//chrome/android:chrome",
1487 ] 1665 ]
1488 script = "//tools/resources/generate_resource_whitelist.py" 1666 script = "//tools/resources/generate_resource_whitelist.py"
1489 1667
1490 _infile = "$root_out_dir/libchrome$shlib_extension.whitelist" 1668 _infile = "$root_out_dir/libchrome$shlib_extension.whitelist"
1491 inputs = [ 1669 inputs = [
1492 _infile, 1670 _infile,
1493 ] 1671 ]
1494 1672
1495 _outfile = chrome_resource_whitelist 1673 _outfile = android_resource_whitelist
1496 outputs = [ 1674 outputs = [
1497 _outfile, 1675 _outfile,
1498 ] 1676 ]
1499 1677
1500 args = [ 1678 args = [
1501 "-i", 1679 "-i",
1502 rebase_path(_infile, root_build_dir), 1680 rebase_path(_infile, root_build_dir),
1503 "-o", 1681 "-o",
1504 rebase_path(_outfile, root_build_dir), 1682 rebase_path(_outfile, root_build_dir),
1505 "--out-dir=.", 1683 "--out-dir=.",
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1584 "//chrome/app/theme/$branding_path_component/product_logo_48.png", 1762 "//chrome/app/theme/$branding_path_component/product_logo_48.png",
1585 "//chrome/tools/build/linux/chrome-wrapper", 1763 "//chrome/tools/build/linux/chrome-wrapper",
1586 "//third_party/xdg-utils/scripts/xdg-mime", 1764 "//third_party/xdg-utils/scripts/xdg-mime",
1587 "//third_party/xdg-utils/scripts/xdg-settings", 1765 "//third_party/xdg-utils/scripts/xdg-settings",
1588 ] 1766 ]
1589 outputs = [ 1767 outputs = [
1590 "$root_out_dir/{{source_file_part}}", 1768 "$root_out_dir/{{source_file_part}}",
1591 ] 1769 ]
1592 } 1770 }
1593 } 1771 }
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_paks.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698