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