Switch on building devtools from source when building the Dart SDK
Fixes https://github.com/flutter/devtools/issues/9786 See go/moving-devtools-to-dart-sdk-2025. In this change, we make the source of devtools be configurable, in actions like build_sdk. If `build_devtools_from_sources` is true, we build local devtools, and if false, we continue to use the prebuilt sources. This may be an intermediate step, while we test out building devtools from source. Or it may be permanently be a choice, if we keep building with CIPD. Change-Id: I7b46d6359c69b34f316e59dccc475e211a18f965 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498640 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
This commit is contained in:
committed by
dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent
a4290fbcb2
commit
d0d8184d1a
+9
-2
@@ -13,6 +13,7 @@
|
||||
# or ":copy_libraries" may delete/overwrite your addition, and the build will
|
||||
# fail.
|
||||
|
||||
import("../build/config/gclient_args.gni")
|
||||
import("../build/dart/copy_tree.gni")
|
||||
import("../build/executable_suffix.gni")
|
||||
import("../sdk_args.gni")
|
||||
@@ -310,7 +311,8 @@ copy_tree("copy_prebuilt_devtools") {
|
||||
|
||||
# This action compiles the devtools app from sources.
|
||||
action("build_devtools") {
|
||||
output = "$root_out_dir/$dart_sdk_output/web/devtools_app"
|
||||
visibility = [ ":create_common_sdk" ]
|
||||
output = "$root_out_dir/$dart_sdk_output/bin/resources/devtools"
|
||||
outputs = [ output ]
|
||||
script = "../tools/build_devtools.py"
|
||||
args = [
|
||||
@@ -881,7 +883,6 @@ group("create_common_sdk") {
|
||||
":copy_headers",
|
||||
":copy_libraries_specification",
|
||||
":copy_license",
|
||||
":copy_prebuilt_devtools",
|
||||
":copy_readme",
|
||||
":copy_sdk_packages_yaml",
|
||||
":copy_vm_dill_files",
|
||||
@@ -891,6 +892,12 @@ group("create_common_sdk") {
|
||||
":write_version_file",
|
||||
]
|
||||
|
||||
if (build_devtools_from_sources) {
|
||||
public_deps += [ ":build_devtools" ]
|
||||
} else {
|
||||
public_deps += [ ":copy_prebuilt_devtools" ]
|
||||
}
|
||||
|
||||
# We do not support AOT on ia32 and should therefore not add the
|
||||
# dart native compilation files since there is no AOT compiler/runtime
|
||||
# available.
|
||||
|
||||
@@ -93,6 +93,7 @@ def main():
|
||||
elif os.path.exists(args.output):
|
||||
os.remove(args.output)
|
||||
shutil.copytree(build_dir, args.output)
|
||||
shutil.rmtree(build_dir)
|
||||
|
||||
print('DevTools build successful.')
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user