Skip to content

Commit

Permalink
GN Format all files in the engine. (flutter#8369)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmaygarde authored Mar 29, 2019
1 parent 82c9104 commit a1a2129
Show file tree
Hide file tree
Showing 16 changed files with 156 additions and 95 deletions.
10 changes: 7 additions & 3 deletions build/dart/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ template("dart_pkg_helper") {
sdk_ext_mappings += invoker.sdk_ext_mappings
}

script = rebase_path("$flutter_root/build/dart/tools/dart_pkg.py", ".", "//")
script =
rebase_path("$flutter_root/build/dart/tools/dart_pkg.py", ".", "//")

entrypoints = []
if (defined(invoker.apps)) {
Expand All @@ -61,7 +62,8 @@ template("dart_pkg_helper") {
if (defined(invoker.sources)) {
sources += invoker.sources
} else if (defined(invoker.pkg_dir)) {
list_script = rebase_path("$flutter_root/build/dart/tools/ls.py", ".", "//")
list_script =
rebase_path("$flutter_root/build/dart/tools/ls.py", ".", "//")
extra_flags += [ "--read_only" ]
ls_sources = exec_script(list_script,
[
Expand Down Expand Up @@ -113,7 +115,9 @@ template("dart_pkg") {
pubspec_yaml_path = rebase_path("pubspec.yaml")
}
dart_package_name_script =
rebase_path("$flutter_root/build/dart/tools/dart_package_name.py", ".", "//")
rebase_path("$flutter_root/build/dart/tools/dart_package_name.py",
".",
"//")
dart_package_name = exec_script(dart_package_name_script,
[
"--pubspec",
Expand Down
8 changes: 4 additions & 4 deletions flow/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ source_set("flow") {
]

public_deps += [
"//sdk/fidl/fuchsia.ui.scenic",
"//garnet/public/lib/ui/scenic/cpp",
"//sdk/fidl/fuchsia.ui.scenic",
"//topaz/public/dart-pkg/zircon",
]

Expand All @@ -94,18 +94,18 @@ executable("flow_unittests") {

sources = [
"flow_run_all_unittests.cc",
"flow_test_utils.h",
"flow_test_utils.cc",
"flow_test_utils.h",
"layers/performance_overlay_layer_unittests.cc",
"matrix_decomposition_unittests.cc",
"raster_cache_unittests.cc",
"layers/performance_overlay_layer_unittests.cc",
]

deps = [
":flow",
"$flutter_root/fml",
"//third_party/googletest:gtest",
"//third_party/dart/runtime:libdart_jit", # for tracing
"//third_party/googletest:gtest",
"//third_party/skia",
]
}
2 changes: 1 addition & 1 deletion flutter_kernel_transformers/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ dart_library("flutter_kernel_transformers") {
]

deps = [
"//third_party/dart-pkg/pub/meta",
"//third_party/dart/pkg/front_end",
"//third_party/dart/pkg/kernel",
"//third_party/dart/pkg/vm",
"//third_party/dart-pkg/pub/meta",
]
}
40 changes: 29 additions & 11 deletions frontend_server/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ if (is_fuchsia_host || is_fuchsia) {
]

deps = [
"//third_party/dart-pkg/pub/args",
"//third_party/dart-pkg/pub/path",
"//third_party/dart-pkg/pub/usage",
"//third_party/dart/pkg/build_integration",
"//third_party/dart/pkg/front_end",
"//third_party/dart/pkg/kernel",
"//third_party/dart/pkg/vm",
"//third_party/dart-pkg/pub/args",
"//third_party/dart-pkg/pub/path",
"//third_party/dart-pkg/pub/usage",
"//third_party/flutter/flutter_kernel_transformers"
"//third_party/flutter/flutter_kernel_transformers",
]
}

Expand All @@ -48,16 +48,34 @@ if (is_fuchsia_host || is_fuchsia) {
]
dot_packages = rebase_path(".packages")
flutter_patched_sdk = rebase_path("$root_out_dir/flutter_patched_sdk")
training_args = [ "--train", "--sdk-root=$flutter_patched_sdk" ]
training_args = [
"--train",
"--sdk-root=$flutter_patched_sdk",
]

frontend_server_files = exec_script("//third_party/dart/tools/list_dart_files.py",
[ "absolute", rebase_path("."), ], "list lines")
frontend_server_files =
exec_script("//third_party/dart/tools/list_dart_files.py",
[
"absolute",
rebase_path("."),
],
"list lines")

frontend_server_files += exec_script("//third_party/dart/tools/list_dart_files.py",
[ "absolute", rebase_path("../flutter_kernel_transformers"), ], "list lines")
frontend_server_files +=
exec_script("//third_party/dart/tools/list_dart_files.py",
[
"absolute",
rebase_path("../flutter_kernel_transformers"),
],
"list lines")

frontend_server_files += exec_script("//third_party/dart/tools/list_dart_files.py",
[ "absolute", rebase_path("../../third_party/dart/pkg"), ], "list lines")
frontend_server_files +=
exec_script("//third_party/dart/tools/list_dart_files.py",
[
"absolute",
rebase_path("../../third_party/dart/pkg"),
],
"list lines")

inputs = frontend_server_files
}
Expand Down
27 changes: 14 additions & 13 deletions lib/snapshot/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ compiled_action("generate_snapshot_bin") {
tool = "//third_party/dart/runtime/bin:gen_snapshot"

if (is_fuchsia || is_fuchsia_host) {
platform_kernel = "$root_out_dir/flutter_runner_patched_sdk/platform_strong.dill"
platform_kernel =
"$root_out_dir/flutter_runner_patched_sdk/platform_strong.dill"
} else {
platform_kernel = "$root_out_dir/flutter_patched_sdk/platform_strong.dill"
}
Expand Down Expand Up @@ -55,12 +56,10 @@ compiled_action("generate_snapshot_bin") {
]

if (is_debug) {
args += [
"--enable_asserts",
]
args += [ "--enable_asserts" ]
}

args += [rebase_path(platform_kernel)]
args += [ rebase_path(platform_kernel) ]
}

# Generates an assembly file defining a given symbol with the bytes from a
Expand Down Expand Up @@ -219,21 +218,22 @@ source_set("snapshot") {
deps = [
":isolate_snapshot_data_linkable",
":isolate_snapshot_instructions_linkable",
":platform_strong_dill_linkable",
":vm_snapshot_data_linkable",
":vm_snapshot_instructions_linkable",
":platform_strong_dill_linkable",
]
sources = get_target_outputs(":isolate_snapshot_data_linkable") +
get_target_outputs(":isolate_snapshot_instructions_linkable") +
get_target_outputs(":vm_snapshot_data_linkable") +
get_target_outputs(":vm_snapshot_instructions_linkable") +
get_target_outputs(":platform_strong_dill_linkable")
get_target_outputs(":isolate_snapshot_instructions_linkable") +
get_target_outputs(":vm_snapshot_data_linkable") +
get_target_outputs(":vm_snapshot_instructions_linkable") +
get_target_outputs(":platform_strong_dill_linkable")
}

compile_platform("non_strong_platform") {
single_root_scheme = "org-dartlang-sdk"
single_root_base = rebase_path("../../../")
libraries_specification_uri = "org-dartlang-sdk:///flutter/lib/snapshot/libraries.json"
libraries_specification_uri =
"org-dartlang-sdk:///flutter/lib/snapshot/libraries.json"

outputs = [
"$root_out_dir/flutter_patched_sdk/platform.dill",
Expand All @@ -249,7 +249,8 @@ compile_platform("non_strong_platform") {
compile_platform("strong_platform") {
single_root_scheme = "org-dartlang-sdk"
single_root_base = rebase_path("../../../")
libraries_specification_uri = "org-dartlang-sdk:///flutter/lib/snapshot/libraries.json"
libraries_specification_uri =
"org-dartlang-sdk:///flutter/lib/snapshot/libraries.json"

outputs = [
"$root_out_dir/flutter_patched_sdk/platform_strong.dill",
Expand All @@ -266,7 +267,7 @@ compile_platform("strong_platform") {
if (is_fuchsia || is_fuchsia_host) {
group("kernel_platform_files") {
public_deps = [
"//topaz/runtime/flutter_runner/kernel:kernel_platform_files"
"//topaz/runtime/flutter_runner/kernel:kernel_platform_files",
]
}
} else {
Expand Down
4 changes: 3 additions & 1 deletion runtime/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ source_set("runtime") {
flutter_runtime_mode != "dynamic_release" && !is_fuchsia) {
# Only link in Observatory in non-release modes on non-Fuchsia. Fuchsia
# instead puts Observatory into the runner's package.
deps += [ "//third_party/dart/runtime/observatory:embedded_observatory_archive" ]
deps += [
"//third_party/dart/runtime/observatory:embedded_observatory_archive",
]
}
}

Expand Down
2 changes: 1 addition & 1 deletion shell/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("$flutter_root/testing/testing.gni")
import("$flutter_root/shell/gpu/gpu.gni")
import("$flutter_root/testing/testing.gni")

# Template to generate a dart embedder resource.cc file.
# Required invoker inputs:
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ group("platform") {
deps = [
"windows",
]
} else if ( is_fuchsia) {
} else if (is_fuchsia) {
# Fuchsia has its own runner implementation.
deps = []
} else {
Expand Down
34 changes: 19 additions & 15 deletions shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("$flutter_root/common/config.gni")
import("$flutter_root/shell/config.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("$flutter_root/common/config.gni")
import("$flutter_root/shell/config.gni")
import("$flutter_root/shell/gpu/gpu.gni")

shell_gpu_configuration("android_gpu_configuration") {
Expand All @@ -20,6 +20,7 @@ shared_library("flutter_shell_native") {
output_name = "flutter"

sources = [
"$root_build_dir/flutter_icu/icudtl.o",
"android_context_gl.cc",
"android_context_gl.h",
"android_environment_gl.cc",
Expand Down Expand Up @@ -49,7 +50,6 @@ shared_library("flutter_shell_native") {
"platform_view_android_jni.h",
"vsync_waiter_android.cc",
"vsync_waiter_android.h",
"$root_build_dir/flutter_icu/icudtl.o",
]

deps = [
Expand Down Expand Up @@ -96,7 +96,7 @@ shared_library("flutter_shell_native") {
"GLESv2",
]

ldflags = ["-Wl,--version-script=" + rebase_path("android_exports.lst")]
ldflags = [ "-Wl,--version-script=" + rebase_path("android_exports.lst") ]
}

java_library("flutter_shell_java") {
Expand Down Expand Up @@ -181,17 +181,16 @@ java_library("flutter_shell_java") {
"io/flutter/view/VsyncWaiter.java",
]

java_files += [
"$flutter_root/third_party/bsdiff/io/flutter/util/BSDiff.java",
]
java_files +=
[ "$flutter_root/third_party/bsdiff/io/flutter/util/BSDiff.java" ]

deps = [
":android_support_v13",
":android_arch_lifecycle_common",
":android_arch_lifecycle_viewmodel",
":android_support_annotations",
":android_support_compat",
":android_support_fragment",
":android_arch_lifecycle_common",
":android_arch_lifecycle_viewmodel",
":android_support_v13",
]

jar_path = "$root_out_dir/flutter_java.jar"
Expand Down Expand Up @@ -230,7 +229,8 @@ java_prebuilt("android_arch_lifecycle_common") {
java_prebuilt("android_arch_lifecycle_viewmodel") {
supports_android = true

jar_path = "//third_party/android_support/android_arch_lifecycle_viewmodel.jar"
jar_path =
"//third_party/android_support/android_arch_lifecycle_viewmodel.jar"
}

action("icudtl_object") {
Expand All @@ -248,10 +248,14 @@ action("icudtl_object") {
]

args = [
"--objcopy", rebase_path(android_objcopy),
"--input", rebase_path(icudtl_input),
"--output", rebase_path(icudtl_output),
"--arch", current_cpu,
"--objcopy",
rebase_path(android_objcopy),
"--input",
rebase_path(icudtl_input),
"--output",
rebase_path(icudtl_output),
"--arch",
current_cpu,
]
}

Expand Down
3 changes: 2 additions & 1 deletion shell/platform/darwin/framework_shared.gni
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

framework_shared_headers = get_path_info(
framework_shared_headers =
get_path_info(
[
# TODO: Move these files, and their implementations, to a shared
# location.
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/darwin/ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

assert(is_ios)

import("$flutter_root/common/config.gni")
import("//build/config/ios/ios_sdk.gni")
import("$flutter_root/common/config.gni")
import("$flutter_root/shell/gpu/gpu.gni")

_flutter_framework_dir = "$root_out_dir/Flutter.framework"
Expand Down Expand Up @@ -61,9 +61,9 @@ shared_library("create_flutter_framework_dylib") {
"framework/Source/FlutterOverlayView.mm",
"framework/Source/FlutterPlatformPlugin.h",
"framework/Source/FlutterPlatformPlugin.mm",
"framework/Source/FlutterPlatformViews.mm",
"framework/Source/FlutterPlatformViews_Internal.h",
"framework/Source/FlutterPlatformViews_Internal.mm",
"framework/Source/FlutterPlatformViews.mm",
"framework/Source/FlutterPluginAppLifeCycleDelegate.mm",
"framework/Source/FlutterStandardCodec.mm",
"framework/Source/FlutterStandardCodec_Internal.h",
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ assert(is_linux)
group("linux") {
deps = [
":flutter_linux",
"$flutter_root/shell/platform/glfw:publish_headers_glfw",
"$flutter_root/shell/platform/common/cpp/client_wrapper:publish_wrapper",
"$flutter_root/shell/platform/glfw:publish_headers_glfw",
"$flutter_root/shell/platform/glfw/client_wrapper:publish_wrapper_glfw",
]
}
Expand Down
2 changes: 1 addition & 1 deletion shell/platform/windows/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ assert(is_win)
group("windows") {
deps = [
":flutter_windows",
"$flutter_root/shell/platform/glfw:publish_headers_glfw",
"$flutter_root/shell/platform/common/cpp/client_wrapper:publish_wrapper",
"$flutter_root/shell/platform/glfw:publish_headers_glfw",
"$flutter_root/shell/platform/glfw/client_wrapper:publish_wrapper_glfw",
]
}
Expand Down
Loading

0 comments on commit a1a2129

Please sign in to comment.