Fix bug in package script and add dev_compiler to list of uploaded packages (flutter/engine#12785)
This commit is contained in:
@@ -81,17 +81,18 @@ if (is_fuchsia_host || is_fuchsia) {
|
||||
inputs = frontend_server_files
|
||||
|
||||
outputs = [
|
||||
"$root_build_dir/dist/packages/frontend_server/pubspec.yaml",
|
||||
"$root_build_dir/dist/packages/vm/pubspec.yaml",
|
||||
"$root_build_dir/dist/packages/build_integration/pubspec.yaml",
|
||||
|
||||
"$root_build_dir/dist/packages/front_end/pubspec.yaml",
|
||||
"$root_build_dir/dist/packages/kernel/pubspec.yaml",
|
||||
"$root_gen_dir/dart-pkg/frontend_server/pubspec.yaml",
|
||||
"$root_gen_dir/dart-pkg/vm/pubspec.yaml",
|
||||
"$root_gen_dir/dart-pkg/build_integration/pubspec.yaml",
|
||||
"$root_gen_dir/dart-pkg/front_end/pubspec.yaml",
|
||||
"$root_gen_dir/dart-pkg/kernel/pubspec.yaml",
|
||||
"$root_gen_dir/dart-pkg/dev_compiler/pubspec.yaml",
|
||||
]
|
||||
|
||||
args = [
|
||||
"--input-root=" + rebase_path("//third_party/dart/pkg"),
|
||||
"--output-root=" + rebase_path("$root_gen_dir/dart-pkg"),
|
||||
"--frontend-server=" + rebase_path("$flutter_root"),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,12 @@ import sys
|
||||
|
||||
# The list of packages copied from the Dart SDK.
|
||||
PACKAGES = [
|
||||
"vm", "build_integration", "kernel", "front_end", "frontend_server",
|
||||
"vm",
|
||||
"build_integration",
|
||||
"kernel",
|
||||
"front_end",
|
||||
"dev_compiler",
|
||||
"frontend_server",
|
||||
]
|
||||
|
||||
VM_PUBSPEC = r'''name: vm
|
||||
@@ -19,6 +24,7 @@ environment:
|
||||
sdk: ">=2.2.2 <3.0.0"
|
||||
|
||||
dependencies:
|
||||
dev_compiler: any
|
||||
front_end: any
|
||||
kernel: any
|
||||
meta: any
|
||||
@@ -66,22 +72,40 @@ dependencies:
|
||||
meta: any
|
||||
'''
|
||||
|
||||
DEV_COMPILER_PUBSPEC = r'''name: dev_compiler
|
||||
version: 0.0.1
|
||||
environment:
|
||||
sdk: '>=2.2.2 <3.0.0'
|
||||
dependencies:
|
||||
analyzer: any
|
||||
bazel_worker: any
|
||||
build_integration: any
|
||||
cli_util: any
|
||||
source_maps: any
|
||||
'''
|
||||
|
||||
PUBSPECS = {
|
||||
'vm': VM_PUBSPEC,
|
||||
'build_integration': BUILD_INTEGRATION_PUBSPEC,
|
||||
'frontend_server': FRONTEND_SERVER_PUBSPEC,
|
||||
'kernel': KERNEL_PUBSPEC,
|
||||
'front_end': FRONT_END_PUBSPEC,
|
||||
'dev_compiler': DEV_COMPILER_PUBSPEC,
|
||||
}
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--frontend-server', type=str, dest='frontend', action='store')
|
||||
parser.add_argument('--input-root', type=str, dest='input', action='store')
|
||||
parser.add_argument('--output-root', type=str, dest='output', action='store')
|
||||
|
||||
args = parser.parse_args()
|
||||
for package in PACKAGES:
|
||||
package_root = os.path.join(args.input, package)
|
||||
base = args.input
|
||||
# Handle different path for frontend_server
|
||||
if package == 'frontend_server':
|
||||
base = args.frontend
|
||||
package_root = os.path.join(base, package)
|
||||
for root, directories, files in os.walk(package_root):
|
||||
# We only care about actual source files, not generated code or tests.
|
||||
for skip_dir in ['.git', 'gen', 'test']:
|
||||
@@ -101,10 +125,10 @@ def main():
|
||||
os.makedirs(parent_path)
|
||||
shutil.copyfile(os.path.join(root, filename), destination_file)
|
||||
|
||||
# Write the overriden pubspec for each package.
|
||||
pubspec_file = os.path.join(args.output, package, 'pubspec.yaml')
|
||||
with open(pubspec_file, 'w+') as output_file:
|
||||
output_file.write(PUBSPECS[package])
|
||||
# Write the overriden pubspec for each package.
|
||||
pubspec_file = os.path.join(args.output, package, 'pubspec.yaml')
|
||||
with open(pubspec_file, 'w+') as output_file:
|
||||
output_file.write(PUBSPECS[package])
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
|
||||
Reference in New Issue
Block a user