Skip to content

Commit

Permalink
Allow the project to be mapped to a location other than //flutter. (f…
Browse files Browse the repository at this point in the history
…lutter#4203)

This is for Fuchsia where we would like it to be located at //third_party/flutter.
  • Loading branch information
pylaligand authored Oct 14, 2017
1 parent 6199211 commit 5fae5d5
Show file tree
Hide file tree
Showing 42 changed files with 329 additions and 216 deletions.
42 changes: 24 additions & 18 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,62 @@ group("flutter") {
testonly = true

deps = [
"//flutter/lib/snapshot:compile_platform",
"//flutter/lib/snapshot:generate_snapshot_bin",
"//flutter/sky",
"//flutter/third_party/txt",
"$flutter_root/lib/snapshot:compile_platform",
"$flutter_root/lib/snapshot:generate_snapshot_bin",
"$flutter_root/sky",
"$flutter_root/third_party/txt",
]

if (!is_fuchsia) {
if (current_toolchain == host_toolchain) {
deps += [
"//dart:create_sdk",
"//flutter/frontend_server",
"$flutter_root/frontend_server",
]
}
}

if (is_fuchsia) {
deps += [
"//flutter/content_handler",
"//flutter/content_handler:aot_content_handler",
"//flutter/examples",
"//flutter/flow",
"$flutter_root/content_handler",
"$flutter_root/content_handler:aot_content_handler",
"$flutter_root/examples",
"$flutter_root/flow",
]
}

# If on the host, compile all unittests targets.
if (current_toolchain == host_toolchain) {
if (is_mac) {
deps += [ "//flutter/shell/platform/darwin:flutter_channels_unittests" ]
deps += [ "$flutter_root/shell/platform/darwin:flutter_channels_unittests" ]
}
if (!is_win) {
deps += [ "//flutter/shell/platform/embedder:flutter_engine" ]
deps += [ "$flutter_root/shell/platform/embedder:flutter_engine" ]
}
deps += [
"//flutter/flow:flow_unittests",
"//flutter/fml:fml_unittests",
"//flutter/sky/engine/wtf:wtf_unittests",
"//flutter/synchronization:synchronization_unittests",
"//flutter/third_party/txt:txt_benchmarks",
"//flutter/third_party/txt:txt_unittests",
"$flutter_root/flow:flow_unittests",
"$flutter_root/fml:fml_unittests",
"$flutter_root/sky/engine/wtf:wtf_unittests",
"$flutter_root/synchronization:synchronization_unittests",
"$flutter_root/third_party/txt:txt_benchmarks",
"$flutter_root/third_party/txt:txt_unittests",
"//garnet/public/lib/fxl:fxl_unittests",
]
}
}

config("config") {
include_dirs = [
"..",
]
}

if (!is_fuchsia) {
group("dist") {
testonly = true

deps = [
"//flutter/sky/dist",
"$flutter_root/sky/dist",
]
}
}
6 changes: 5 additions & 1 deletion assets/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@ source_set("assets") {
]

deps = [
"//flutter/glue",
"$flutter_root/glue",
"//garnet/public/lib/fxl",
"//garnet/public/lib/zip",
]

public_deps = [
"//third_party/zlib:minizip",
]

public_configs = [
"$flutter_root:config",
]
}
6 changes: 3 additions & 3 deletions build/dart/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ template("dart_pkg_helper") {
sdk_ext_mappings += invoker.sdk_ext_mappings
}

script = rebase_path("flutter/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 +61,7 @@ template("dart_pkg_helper") {
if (defined(invoker.sources)) {
sources += invoker.sources
} else if (defined(invoker.pkg_dir)) {
list_script = rebase_path("flutter/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 @@ -112,7 +112,7 @@ template("dart_pkg") {
pubspec_yaml_path = rebase_path("pubspec.yaml")
}
dart_package_name_script =
rebase_path("flutter/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
30 changes: 15 additions & 15 deletions build/flutter_app.gni
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
assert(is_fuchsia)

import("//build/dart/dart_package.gni")
import("//flutter/lib/ui/dart_ui.gni")
import("$flutter_root/lib/ui/dart_ui.gni")
import("//topaz/public/dart-pkg/fuchsia/sdk_ext.gni")
import("//topaz/public/dart-pkg/zircon/sdk_ext.gni")
import("//topaz/public/lib/ui/flutter/sdk_ext/sdk_ext.gni")
Expand All @@ -18,9 +18,9 @@ gen_snapshot_label = "//dart/runtime/bin:gen_snapshot($host_toolchain)"
gen_snapshot_dir = get_label_info(gen_snapshot_label, "root_out_dir")
gen_snapshot = "$gen_snapshot_dir/gen_snapshot"

flutter_root = "//lib/flutter"
flutter_base = "//lib/flutter"
flutter_tools_label =
"$flutter_root/packages/flutter_tools:fuchsia_builder($host_toolchain)"
"$flutter_base/packages/flutter_tools:fuchsia_builder($host_toolchain)"
flutter_tools_out_dir = get_label_info(flutter_tools_label, "root_out_dir")
flutter_tools_bin = "$flutter_tools_out_dir/dart-tools/fuchsia_builder"

Expand Down Expand Up @@ -50,7 +50,7 @@ template("flutter_jit_app") {
bundle_name = "${target_name}.flx"
}

flutter_core_snapshot_label = "//flutter/lib/snapshot:generate_snapshot_bin"
flutter_core_snapshot_label = "$flutter_root/lib/snapshot:generate_snapshot_bin"
flutter_core_snapshot_gen_dir =
get_label_info(flutter_core_snapshot_label, "target_gen_dir")
flutter_core_snapshot_vm_data =
Expand Down Expand Up @@ -91,7 +91,7 @@ template("flutter_jit_app") {
sources = invoker.sources
}

script = "//flutter/build/script_snapshot.py"
script = "$flutter_root/build/script_snapshot.py"

args = [
"--snapshotter-path",
Expand Down Expand Up @@ -144,11 +144,11 @@ template("flutter_jit_app") {
bundle_path,
]

script = "//flutter/build/package.py"
script = "$flutter_root/build/package.py"

args = [
"--flutter-root",
rebase_path(flutter_root),
rebase_path(flutter_base),
"--flutter-tools",
rebase_path(flutter_tools_bin),
"--working-dir",
Expand Down Expand Up @@ -225,8 +225,8 @@ template("flutter_aot_app") {
mozart_dart_sdk_ext_files +
[
main_dart,
"//flutter/runtime/dart_vm_entry_points.txt",
"//flutter/runtime/dart_vm_entry_points_fuchsia.txt",
"$flutter_root/runtime/dart_vm_entry_points.txt",
"$flutter_root/runtime/dart_vm_entry_points_fuchsia.txt",
"//dart/runtime/bin/dart_io_entries.txt",
]

Expand All @@ -238,7 +238,7 @@ template("flutter_aot_app") {
sources = invoker.sources
}

script = "//flutter/build/aot_snapshot.py"
script = "$flutter_root/build/aot_snapshot.py"
args = [
"--snapshotter-path",
rebase_path(gen_snapshot),
Expand All @@ -262,9 +262,9 @@ template("flutter_aot_app") {
"$root_gen_dir/dart-pkg/sky_engine/sdk_ext/vmservice_io.dart"),

"--entry-points-manifest",
rebase_path("//flutter/runtime/dart_vm_entry_points.txt"),
rebase_path("$flutter_root/runtime/dart_vm_entry_points.txt"),
"--entry-points-manifest",
rebase_path("//flutter/runtime/dart_vm_entry_points_fuchsia.txt"),
rebase_path("$flutter_root/runtime/dart_vm_entry_points_fuchsia.txt"),
"--entry-points-manifest",
rebase_path("//dart/runtime/bin/dart_io_entries.txt"),

Expand All @@ -279,7 +279,7 @@ template("flutter_aot_app") {

deps = [
":$dart_package_name",
"//flutter/lib/snapshot:generate_dart_ui",
"$flutter_root/lib/snapshot:generate_dart_ui",
gen_snapshot_label,
]

Expand Down Expand Up @@ -323,11 +323,11 @@ template("flutter_aot_app") {
bundle_path,
]

script = "//flutter/build/package.py"
script = "$flutter_root/build/package.py"

args = [
"--flutter-root",
rebase_path(flutter_root),
rebase_path(flutter_base),
"--flutter-tools",
rebase_path(flutter_tools_bin),
"--working-dir",
Expand Down
5 changes: 4 additions & 1 deletion common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ source_set("common") {
"//garnet/public/lib/fxl",
]

public_configs = [ ":flutter_config" ]
public_configs = [
":flutter_config",
"$flutter_root:config",
]
}
16 changes: 8 additions & 8 deletions content_handler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ template("flutter_content_handler") {
deps = [
"//dart/runtime/bin:libdart_builtin",
"//dart/runtime/platform:libdart_platform",
"//flutter/assets",
"//flutter/common",
"//flutter/flow",
"//flutter/glue",
"//flutter/lib/ui",
"//flutter/runtime",
"//flutter/sky/engine/platform",
"//flutter/vulkan",
"$flutter_root/assets",
"$flutter_root/common",
"$flutter_root/flow",
"$flutter_root/glue",
"$flutter_root/lib/ui",
"$flutter_root/runtime",
"$flutter_root/sky/engine/platform",
"$flutter_root/vulkan",
"//garnet/public/lib/app/cpp",
"//garnet/public/lib/fsl",
"//garnet/public/lib/fxl",
Expand Down
2 changes: 1 addition & 1 deletion examples/hello_flutter/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//flutter/build/flutter_app.gni")
import("$flutter_root/build/flutter_app.gni")

flutter_jit_app("hello_flutter") {
main_dart = "lib/main.dart"
Expand Down
2 changes: 1 addition & 1 deletion examples/spinning_square/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//flutter/build/flutter_app.gni")
import("$flutter_root/build/flutter_app.gni")

flutter_app("spinning_square") {
main_dart = "lib/main.dart"
Expand Down
12 changes: 8 additions & 4 deletions flow/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,14 @@ source_set("flow") {
"//garnet/public/lib/fxl",
]

public_configs = [
"$flutter_root:config",
]

deps = [
"//flutter/common",
"//flutter/glue",
"//flutter/synchronization",
"$flutter_root/common",
"$flutter_root/glue",
"$flutter_root/synchronization",
"//third_party/skia",
"//third_party/skia:gpu",
]
Expand Down Expand Up @@ -96,7 +100,7 @@ executable("flow_unittests") {
deps = [
":flow",
"//dart/runtime:libdart_jit", # for tracing
"//flutter/testing",
"$flutter_root/testing",
"//third_party/skia",
]
}
8 changes: 6 additions & 2 deletions fml/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ source_set("fml") {

configs += [ "//third_party/icu:icu_config" ]

public_configs = [
"$flutter_root:config",
]

libs = []

if (is_ios || is_mac) {
Expand Down Expand Up @@ -111,8 +115,8 @@ executable("fml_unittests") {

deps = [
"//dart/runtime:libdart_jit",
"//flutter/fml",
"//flutter/testing",
"$flutter_root/fml",
"$flutter_root/testing",
"//garnet/public/lib/fxl",
]
}
6 changes: 5 additions & 1 deletion glue/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ source_set("glue") {
"//garnet/public/lib/fxl",
]

public_configs = [
"$flutter_root:config",
]

if (is_fuchsia) {
sources += [ "stack_trace_fuchsia.cc" ]

Expand All @@ -21,6 +25,6 @@ source_set("glue") {
} else {
sources += [ "stack_trace_base.cc" ]

deps += [ "//flutter/fml" ]
deps += [ "$flutter_root/fml" ]
}
}
4 changes: 4 additions & 0 deletions lib/io/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ source_set("io") {
configs += [
"//dart/runtime:dart_config",
]

public_configs = [
"$flutter_root:config",
]
}
2 changes: 1 addition & 1 deletion lib/snapshot/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//flutter/lib/ui/dart_ui.gni")
import("$flutter_root/lib/ui/dart_ui.gni")

import("//dart/runtime/bin/io_sources.gni")
import("//dart/runtime/lib/async_sources.gni")
Expand Down
18 changes: 11 additions & 7 deletions lib/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,19 @@ source_set("ui") {
"window/window.h",
]

public_configs = [
"$flutter_root:config",
]

deps = [
"//dart/runtime/bin:embedded_dart_io",
"//flutter/assets",
"//flutter/common",
"//flutter/flow",
"//flutter/glue",
"//flutter/runtime:test_font",
"//flutter/sky/engine",
"//flutter/third_party/txt",
"$flutter_root/assets",
"$flutter_root/common",
"$flutter_root/flow",
"$flutter_root/glue",
"$flutter_root/runtime:test_font",
"$flutter_root/sky/engine",
"$flutter_root/third_party/txt",
"//third_party/rapidjson",
"//third_party/skia",
"//third_party/skia:gpu",
Expand Down
Loading

0 comments on commit 5fae5d5

Please sign in to comment.