From d60efb42899334b145f7178b01822d59da853384 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 28 Sep 2016 11:48:48 -0700 Subject: [PATCH] Update buildtools to latest, account for GN updates and use Clang on Android. (#3064) --- DEPS | 12 +-- lib/snapshot/toolchain.gni | 5 + lib/ui/ui_dart_state.h | 2 +- services/activity/BUILD.gn | 4 +- services/editing/BUILD.gn | 4 +- services/media/BUILD.gn | 4 +- services/platform/BUILD.gn | 4 +- services/semantics/BUILD.gn | 2 +- services/vsync/BUILD.gn | 5 +- shell/common/BUILD.gn | 1 + shell/platform/darwin/desktop/BUILD.gn | 17 +-- shell/platform/darwin/ios/BUILD.gn | 140 ++++++++++++------------- skia/BUILD.gn | 2 +- sky/dist/BUILD.gn | 2 + tools/gn | 2 +- 15 files changed, 110 insertions(+), 96 deletions(-) diff --git a/DEPS b/DEPS index 0d12727e5c1cf..e14b4000da379 100644 --- a/DEPS +++ b/DEPS @@ -22,18 +22,18 @@ vars = { 'fuchsia_git': 'https://fuchsia.googlesource.com', 'github_git': 'https://github.com', 'mojo_sdk_revision': '6b5fb1227c742f5ecc077486ebc029f2711c61fa', - 'base_revision': '672b04e54b937ec899429a6bd5409c5a6300d151', + 'base_revision': '75e70c3387cf327702a0533e93bc480446da0806', 'skia_revision': '5561e3ddbbf6c3e051075ada4a11ddc70760f03d', # Note: When updating the Dart revision, ensure that all entries that are # dependencies of dart are also updated - 'dart_revision': '43231d9ff416e301206239b76ad645ca38f34116', - 'dart_boringssl_gen_revision': 'e3a1b341a3890ab10d372dc2fe6d1c6798828293', + 'dart_revision': 'b29788329baab1183f6e430bc2cf3c4169b20621', + 'dart_boringssl_gen_revision': '922830c0aad900dd3d143eef1ba06faa83fe263b', 'dart_boringssl_revision': '8d343b44bbab829d1a28fdef650ca95f7db4412e', 'dart_observatory_packages_revision': '26aad88f1c1915d39bbcbff3cad589e2402fdcf1', 'dart_root_certificates_revision': 'aed07942ce98507d2be28cbd29e879525410c7fc', - 'buildtools_revision': '565d04e8741429fb1b4f26d102f2c6c3b849edeb', + 'buildtools_revision': '3d2e47bf14e4e67816a53e304dea422fa18f9180', } # Only these hosts are allowed for dependencies in this DEPS file. @@ -45,7 +45,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '2f656511ecc11565bd975b0f0ac7aa7383950132', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'a0b7e3ef735fd558146113820c1f52b8415f095e', # Fuchsia compatibility # @@ -77,7 +77,7 @@ deps = { # Chromium-style dependencies. 'src/base': - Var('chromium_git') + '/external/github.com/domokit/base' + '@' + Var('base_revision'), + Var('github_git') + '/flutter/base.git' + '@' + Var('base_revision'), 'src/buildtools': Var('chromium_git') + '/chromium/buildtools.git' + '@' + Var('buildtools_revision'), diff --git a/lib/snapshot/toolchain.gni b/lib/snapshot/toolchain.gni index 3fd5814017c8a..49ef9c1dea2cf 100644 --- a/lib/snapshot/toolchain.gni +++ b/lib/snapshot/toolchain.gni @@ -3,6 +3,11 @@ # found in the LICENSE file. import("//mojo/dart/packages/mojo/sdk_ext_sources.gni") +import("//flutter/common/config.gni") # for flutter_aot + +if (target_os == "ios") { + import("//build/config/ios/ios_sdk.gni") # For use_ios_simulator +} dart_host_toolchain = host_toolchain diff --git a/lib/ui/ui_dart_state.h b/lib/ui/ui_dart_state.h index a85e20030158a..fb403d7e1afcd 100644 --- a/lib/ui/ui_dart_state.h +++ b/lib/ui/ui_dart_state.h @@ -12,8 +12,8 @@ #include "lib/tonic/dart_state.h" namespace blink { +struct DartJniIsolateData; class FontSelector; -class DartJniIsolateData; class MojoServices; class Window; diff --git a/services/activity/BUILD.gn b/services/activity/BUILD.gn index a45b0570a31c6..caaf14fcee9ee 100644 --- a/services/activity/BUILD.gn +++ b/services/activity/BUILD.gn @@ -5,12 +5,12 @@ import("//mojo/public/tools/bindings/mojom.gni") group("activity") { - deps = [ + public_deps = [ ":interfaces", ] if (is_android || is_ios) { - deps += [ ":activity_lib" ] + public_deps += [ ":activity_lib" ] } } diff --git a/services/editing/BUILD.gn b/services/editing/BUILD.gn index 7153db452166b..a6cedac97d9ad 100644 --- a/services/editing/BUILD.gn +++ b/services/editing/BUILD.gn @@ -5,12 +5,12 @@ import("//mojo/public/tools/bindings/mojom.gni") group("editing") { - deps = [ + public_deps = [ ":interfaces", ] if (is_android || is_ios) { - deps += [ ":editing_lib" ] + public_deps += [ ":editing_lib" ] } } diff --git a/services/media/BUILD.gn b/services/media/BUILD.gn index 4c102d9995ace..34e8319c85645 100644 --- a/services/media/BUILD.gn +++ b/services/media/BUILD.gn @@ -5,12 +5,12 @@ import("//mojo/public/tools/bindings/mojom.gni") group("media") { - deps = [ + public_deps = [ ":interfaces", ] if (is_android || is_ios) { - deps += [ ":media_lib" ] + public_deps += [ ":media_lib" ] } } diff --git a/services/platform/BUILD.gn b/services/platform/BUILD.gn index bfaad95754d96..680b427d38683 100644 --- a/services/platform/BUILD.gn +++ b/services/platform/BUILD.gn @@ -62,10 +62,10 @@ if (is_ios) { } group("platform") { - deps = [ + public_deps = [ ":interfaces" ] if (is_android || is_ios) { - deps += [ ":platform_lib" ] + public_deps += [ ":platform_lib" ] } } diff --git a/services/semantics/BUILD.gn b/services/semantics/BUILD.gn index db20859ab9589..c0c98dd835ef7 100644 --- a/services/semantics/BUILD.gn +++ b/services/semantics/BUILD.gn @@ -5,7 +5,7 @@ import("//mojo/public/tools/bindings/mojom.gni") group("semantics") { - deps = [ + public_deps = [ ":interfaces", ] } diff --git a/services/vsync/BUILD.gn b/services/vsync/BUILD.gn index c019d815a6700..e7d7ef0f6af1b 100644 --- a/services/vsync/BUILD.gn +++ b/services/vsync/BUILD.gn @@ -19,7 +19,10 @@ source_set("vsync_lib_fallback") { } group("vsync") { - deps = [ ":vsync_lib", ":vsync_lib_fallback" ] + public_deps = [ + ":vsync_lib", + ":vsync_lib_fallback", + ] } if (is_android) { diff --git a/shell/common/BUILD.gn b/shell/common/BUILD.gn index 7e107c1973e6d..b67ba1c33b50d 100644 --- a/shell/common/BUILD.gn +++ b/shell/common/BUILD.gn @@ -63,6 +63,7 @@ source_set("common") { "//mojo/public/cpp/bindings:utility", "//mojo/public/interfaces/application", "//mojo/services/vsync/interfaces", + "//third_party/libjpeg", ":generate_embedder_diagnostic_server_resources_cc", ] } diff --git a/shell/platform/darwin/desktop/BUILD.gn b/shell/platform/darwin/desktop/BUILD.gn index cf2e8974fe8d6..3de52a84715cb 100644 --- a/shell/platform/darwin/desktop/BUILD.gn +++ b/shell/platform/darwin/desktop/BUILD.gn @@ -41,18 +41,21 @@ executable("shell_standalone") { ] } +resource_copy_mac("mac_desktop_resources") { + app_name = "SkyShell" + + resources = [ + "//third_party/icu/android/icudtl.dat", + ] + + bundle_directory = "." +} + mac_app("shell_application_bundle") { app_name = "SkyShell" info_plist = "Info.plist" xibs = [ "sky_mac.xib" ] - resource_copy_mac("mac_desktop_resources") { - resources = [ - "//third_party/icu/android/icudtl.dat", - ] - bundle_directory = "." - } - deps = [ ":mac_desktop_platform", ":mac_desktop_resources", diff --git a/shell/platform/darwin/ios/BUILD.gn b/shell/platform/darwin/ios/BUILD.gn index 595d00562ed9b..e0f0dc20ebd1f 100644 --- a/shell/platform/darwin/ios/BUILD.gn +++ b/shell/platform/darwin/ios/BUILD.gn @@ -7,6 +7,8 @@ assert(is_ios) import("//build/config/ios/rules.gni") import("//build/config/ios/ios_sdk.gni") +_flutter_framework_dir = "$root_out_dir/Flutter.framework" + shared_library("flutter_framework_dylib") { visibility = [ ":*" ] @@ -79,77 +81,75 @@ shared_library("flutter_framework_dylib") { ] } -group("flutter_framework") { - framework_dir = "$root_out_dir/Flutter.framework" - - copy("framework_dylib") { - visibility = [ ":*" ] - sources = [ "$root_out_dir/libFlutter.dylib" ] - outputs = [ "$framework_dir/Flutter" ] - - deps = [ - ":flutter_framework_dylib", - ] - } - - action("framework_install_name") { - visibility = [ ":*" ] - stamp_file = "$root_out_dir/flutter_install_name_stamp" - script = "//flutter/sky/tools/change_install_name.py" - - inputs = [ "$framework_dir/Flutter" ] - outputs = [ stamp_file ] - - args = [ - "--dylib", - rebase_path("$framework_dir/Flutter"), - "--install_name", - "@rpath/Flutter.framework/Flutter", - "--stamp", - rebase_path(stamp_file), - ] - - deps = [ - ":framework_dylib" - ] - } - - copy("framework_info_plist") { - visibility = [ ":*" ] - sources = [ "framework/Info.plist" ] - outputs = [ "$framework_dir/Info.plist" ] - } - - copy("framework_module_map") { - visibility = [ ":*" ] - sources = [ "framework/module.modulemap" ] - outputs = [ "$framework_dir/Modules/module.modulemap" ] - } - - copy("framework_headers") { - visibility = [ ":*" ] - sources = [ - "framework/Headers/Flutter.h", - "framework/Headers/FlutterAppDelegate.h", - "framework/Headers/FlutterAsyncMessageListener.h", - "framework/Headers/FlutterDartProject.h", - "framework/Headers/FlutterMacros.h", - "framework/Headers/FlutterMessageListener.h", - "framework/Headers/FlutterViewController.h", - ] - outputs = [ "$framework_dir/Headers/{{source_file_part}}" ] - } - - copy("framework_icu") { - visibility = [ ":*" ] - set_sources_assignment_filter([]) - sources = [ - "//third_party/icu/android/icudtl.dat", - ] - set_sources_assignment_filter(sources_assignment_filter) - outputs = [ "$framework_dir/{{source_file_part}}" ] - } +copy("framework_dylib") { + visibility = [ ":*" ] + sources = [ "$root_out_dir/libFlutter.dylib" ] + outputs = [ "$_flutter_framework_dir/Flutter" ] + + deps = [ + ":flutter_framework_dylib", + ] +} + +action("framework_install_name") { + visibility = [ ":*" ] + stamp_file = "$root_out_dir/flutter_install_name_stamp" + script = "//flutter/sky/tools/change_install_name.py" + + inputs = [ "$_flutter_framework_dir/Flutter" ] + outputs = [ stamp_file ] + + args = [ + "--dylib", + rebase_path("$_flutter_framework_dir/Flutter"), + "--install_name", + "@rpath/Flutter.framework/Flutter", + "--stamp", + rebase_path(stamp_file), + ] + + deps = [ + ":framework_dylib" + ] +} + +copy("framework_info_plist") { + visibility = [ ":*" ] + sources = [ "framework/Info.plist" ] + outputs = [ "$_flutter_framework_dir/Info.plist" ] +} + +copy("framework_module_map") { + visibility = [ ":*" ] + sources = [ "framework/module.modulemap" ] + outputs = [ "$_flutter_framework_dir/Modules/module.modulemap" ] +} +copy("framework_headers") { + visibility = [ ":*" ] + sources = [ + "framework/Headers/Flutter.h", + "framework/Headers/FlutterAppDelegate.h", + "framework/Headers/FlutterAsyncMessageListener.h", + "framework/Headers/FlutterDartProject.h", + "framework/Headers/FlutterMacros.h", + "framework/Headers/FlutterMessageListener.h", + "framework/Headers/FlutterViewController.h", + ] + outputs = [ "$_flutter_framework_dir/Headers/{{source_file_part}}" ] +} + +copy("framework_icu") { + visibility = [ ":*" ] + set_sources_assignment_filter([]) + sources = [ + "//third_party/icu/android/icudtl.dat", + ] + set_sources_assignment_filter(sources_assignment_filter) + outputs = [ "$_flutter_framework_dir/{{source_file_part}}" ] +} + +group("flutter_framework") { public_deps = [ ":framework_dylib", ":framework_headers", diff --git a/skia/BUILD.gn b/skia/BUILD.gn index ebdfcf650da6f..345a824c89a22 100644 --- a/skia/BUILD.gn +++ b/skia/BUILD.gn @@ -484,7 +484,7 @@ component("skia") { configs += [ "//build/config/compiler:optimize_max" ] } - if (use_glfw) { + if (is_linux) { deps += [ "//third_party/glfw" ] } } diff --git a/sky/dist/BUILD.gn b/sky/dist/BUILD.gn index cfc60ddf2834b..c417a65fcd18b 100644 --- a/sky/dist/BUILD.gn +++ b/sky/dist/BUILD.gn @@ -41,6 +41,7 @@ if (is_android) { deps = [ "//flutter/sky/packages/sky_engine", + "//flutter/sky/packages/sky_engine:sky_engine_pkg_helper", ] } @@ -62,6 +63,7 @@ if (is_android) { deps = [ "//flutter/sky/packages/sky_services", + "//flutter/sky/packages/sky_services:sky_services_pkg_helper", ] } } diff --git a/tools/gn b/tools/gn index b0723e94f0eb0..5024b5644b20c 100755 --- a/tools/gn +++ b/tools/gn @@ -47,7 +47,7 @@ def to_gn_args(args): gn_args = {} gn_args['is_debug'] = args.unoptimized - gn_args['is_clang'] = args.clang and args.target_os not in ['android'] + gn_args['is_clang'] = True ios_target_cpu = 'arm64'