mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
commit
dc5fb44e3a
@ -1,65 +0,0 @@
|
||||
# Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import("//sky/engine/bindings/bindings.gni")
|
||||
|
||||
template("flx") {
|
||||
bundle_prefix = target_name
|
||||
bundle = "$target_gen_dir/${bundle_prefix}.flx"
|
||||
snapshot = "$target_gen_dir/${bundle_prefix}_snapshot.bin"
|
||||
|
||||
action("gen_${bundle_prefix}_bundle") {
|
||||
main_dart = invoker.main_dart
|
||||
asset_base = "//sky/packages/material_design_icons/lib/icons"
|
||||
|
||||
inputs = [
|
||||
main_dart,
|
||||
]
|
||||
outputs = [
|
||||
bundle,
|
||||
]
|
||||
|
||||
if (defined(invoker.sources)) {
|
||||
inputs += sources
|
||||
}
|
||||
|
||||
sky_snapshot_dir =
|
||||
get_label_info("//sky/tools/sky_snapshot($host_toolchain)", "root_out_dir")
|
||||
|
||||
script = "//sky/tools/sky_build.py"
|
||||
|
||||
args = [
|
||||
"--asset-base", rebase_path(asset_base, root_build_dir),
|
||||
"--compiler", rebase_path("$sky_snapshot_dir/sky_snapshot", root_build_dir),
|
||||
"--main", rebase_path(main_dart, root_build_dir),
|
||||
"--package-root", rebase_path("packages", root_build_dir),
|
||||
"--snapshot", rebase_path(snapshot, root_build_dir),
|
||||
"--output-file", rebase_path(bundle, root_build_dir),
|
||||
]
|
||||
|
||||
if(is_ios) {
|
||||
# This makes the tools bypass the script snapshot compiler
|
||||
args += [ "--precompiled" ]
|
||||
}
|
||||
|
||||
if (defined(invoker.manifest)) {
|
||||
inputs += [ invoker.manifest ]
|
||||
args += [
|
||||
"--manifest", rebase_path(invoker.manifest, root_build_dir),
|
||||
]
|
||||
}
|
||||
|
||||
deps = [ "//sky/tools/sky_snapshot($dart_host_toolchain)" ]
|
||||
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
}
|
||||
|
||||
group(target_name) {
|
||||
deps = [
|
||||
":gen_${bundle_prefix}_bundle",
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -1,184 +0,0 @@
|
||||
# Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import("//sky/build/flx.gni")
|
||||
|
||||
template("sky_app") {
|
||||
flx_target_name = target_name
|
||||
|
||||
if (is_android || is_ios || is_mac) {
|
||||
flx_target_name = "app"
|
||||
}
|
||||
|
||||
flx(flx_target_name) {
|
||||
main_dart = invoker.main_dart
|
||||
|
||||
if (defined(invoker.manifest)) {
|
||||
manifest = invoker.manifest
|
||||
}
|
||||
|
||||
if (defined(invoker.sources)) {
|
||||
sources = invoker.sources
|
||||
}
|
||||
}
|
||||
|
||||
if (is_android) {
|
||||
import("//build/config/android/rules.gni")
|
||||
|
||||
bundle_prefix = target_name
|
||||
|
||||
copy("gen_${bundle_prefix}_bundle") {
|
||||
sources = [
|
||||
"$target_gen_dir/app.flx",
|
||||
]
|
||||
outputs = [
|
||||
"$target_gen_dir/${bundle_prefix}.flx",
|
||||
]
|
||||
|
||||
deps = [
|
||||
":app",
|
||||
]
|
||||
}
|
||||
|
||||
copy_ex("assets") {
|
||||
clear_dir = true
|
||||
dest = "$target_gen_dir/assets"
|
||||
|
||||
sources = [
|
||||
"$root_build_dir/icudtl.dat",
|
||||
"$target_gen_dir/app.flx"
|
||||
]
|
||||
if (defined(invoker.manifest)) {
|
||||
sources += [ invoker.manifest ]
|
||||
}
|
||||
deps = [
|
||||
":$flx_target_name",
|
||||
":gen_${bundle_prefix}_bundle",
|
||||
"//third_party/icu:icudata",
|
||||
]
|
||||
|
||||
if (defined(invoker.bundles)) {
|
||||
foreach(bundle, invoker.bundles) {
|
||||
bundle_gen_dir = get_label_info(bundle, "target_gen_dir")
|
||||
bundle_dir = get_label_info(bundle, "dir")
|
||||
bundle_name = get_label_info(bundle, "name")
|
||||
sources += [ "$bundle_gen_dir/${bundle_name}.flx" ]
|
||||
deps += [
|
||||
"$bundle_dir:gen_${bundle_name}_bundle",
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android_apk(target_name) {
|
||||
apk_name = invoker.apk_name
|
||||
android_manifest = "apk/AndroidManifest.xml"
|
||||
|
||||
native_libs = [ "libsky_shell.so" ]
|
||||
asset_location = "$target_gen_dir/assets"
|
||||
|
||||
extensions_to_not_compress = ".flx"
|
||||
|
||||
deps = [
|
||||
"//base:base_java",
|
||||
"//sky/shell:assets",
|
||||
"//sky/shell:java",
|
||||
"//sky/shell:sky_shell",
|
||||
":assets",
|
||||
]
|
||||
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
}
|
||||
} else if (is_ios && defined(invoker.info_plist)) {
|
||||
import("//build/config/ios/rules.gni")
|
||||
import("//build/config/ios/ios_sdk.gni")
|
||||
import("//sky/engine/bindings/bindings.gni")
|
||||
|
||||
ios_app(target_name) {
|
||||
app_name = target_name + "_app"
|
||||
|
||||
code_signing_identity = ios_code_signing_identity
|
||||
|
||||
info_plist = invoker.info_plist
|
||||
|
||||
if (defined(invoker.entitlements_path)) {
|
||||
entitlements_path = invoker.entitlements_path
|
||||
} else {
|
||||
entitlements_path = "//sky/shell/platform/ios/Entitlements.xcent"
|
||||
}
|
||||
|
||||
resources_gen_target_name = target_name + "_res"
|
||||
resource_copy_ios(resources_gen_target_name) {
|
||||
resources = [
|
||||
"//third_party/icu/android/icudtl.dat",
|
||||
"$target_gen_dir/app.flx",
|
||||
]
|
||||
|
||||
if (defined(invoker.launcher_resources)) {
|
||||
resources += invoker.launcher_resources
|
||||
}
|
||||
|
||||
bundle_directory = "."
|
||||
deps = [ ":app" ]
|
||||
}
|
||||
|
||||
precompiled_gen_target = target_name + "_precompiled"
|
||||
dart_precompile(precompiled_gen_target) {
|
||||
dart_package_root = rebase_path("packages", root_build_dir)
|
||||
dart_script = invoker.main_dart
|
||||
}
|
||||
|
||||
deps = [
|
||||
"//sky/shell:ios_scaffolding",
|
||||
":$resources_gen_target_name",
|
||||
":$flx_target_name",
|
||||
":$precompiled_gen_target",
|
||||
]
|
||||
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
}
|
||||
} else if(is_mac && defined(invoker.info_plist)) {
|
||||
import("//build/config/mac/rules.gni")
|
||||
|
||||
mac_app(target_name) {
|
||||
|
||||
app_name = target_name + "_app"
|
||||
info_plist = invoker.info_plist
|
||||
xibs = invoker.xibs
|
||||
|
||||
resources_gen_target_name = target_name + "_res"
|
||||
resource_copy_mac(resources_gen_target_name) {
|
||||
resources = [
|
||||
"//third_party/icu/android/icudtl.dat",
|
||||
"$target_gen_dir/app.flx",
|
||||
]
|
||||
|
||||
if (defined(invoker.launcher_resources)) {
|
||||
resources += invoker.launcher_resources
|
||||
}
|
||||
|
||||
bundle_directory = "."
|
||||
deps = [ ":app" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
":$resources_gen_target_name",
|
||||
"//sky/shell:mac_scaffolding",
|
||||
]
|
||||
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
}
|
||||
|
||||
} else if(is_ios || is_mac) {
|
||||
# No Info.plist specified. But we still need an empty target
|
||||
group(target_name) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
SRC_ROOT = os.path.dirname(os.path.dirname(SKY_TOOLS_DIR))
|
||||
WORKBENCH = os.path.join(SRC_ROOT, 'sky', 'packages', 'workbench')
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Builds a Dart snapshot file')
|
||||
parser.add_argument('--main', type=str)
|
||||
parser.add_argument('--compiler', type=str)
|
||||
parser.add_argument('--package-root', type=str)
|
||||
parser.add_argument('--snapshot', type=str)
|
||||
args = parser.parse_args()
|
||||
|
||||
command = [
|
||||
os.path.abspath(args.compiler),
|
||||
'--package-root=%s' % os.path.abspath(args.package_root),
|
||||
'--snapshot=%s' % os.path.abspath(args.snapshot),
|
||||
os.path.abspath(args.main),
|
||||
]
|
||||
|
||||
subprocess.check_call(command, cwd=WORKBENCH)
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
@ -1,52 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
SRC_ROOT = os.path.dirname(os.path.dirname(SKY_TOOLS_DIR))
|
||||
DART_SDK = os.path.join(SRC_ROOT, 'third_party', 'dart-sdk', 'dart-sdk', 'bin')
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Packaging tool for Sky apps')
|
||||
parser.add_argument('--asset-base', type=str)
|
||||
parser.add_argument('--compiler', type=str)
|
||||
parser.add_argument('--main', type=str)
|
||||
parser.add_argument('--manifest', type=str)
|
||||
parser.add_argument('--output-file', type=str)
|
||||
parser.add_argument('--package-root', type=str)
|
||||
parser.add_argument('--snapshot', type=str)
|
||||
parser.add_argument('--precompiled', dest='precompiled', action='store_true')
|
||||
parser.set_defaults(precompiled=False)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
command = [
|
||||
'flutter',
|
||||
'build',
|
||||
'--asset-base', os.path.abspath(args.asset_base),
|
||||
'--compiler', os.path.abspath(args.compiler),
|
||||
'--main', os.path.abspath(args.main),
|
||||
'--output-file', os.path.abspath(args.output_file),
|
||||
'--package-root', os.path.abspath(args.package_root),
|
||||
'--snapshot', os.path.abspath(args.snapshot),
|
||||
'--private-key', os.path.abspath(os.path.join(args.package_root, '..', 'privatekey.der')),
|
||||
]
|
||||
|
||||
if args.precompiled:
|
||||
command += [
|
||||
'--precompiled'
|
||||
]
|
||||
|
||||
if args.manifest:
|
||||
command += ['--manifest', os.path.abspath(args.manifest)]
|
||||
|
||||
subprocess.check_call(command, cwd=os.path.join(args.package_root, '..'))
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright 2015 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import webbrowser
|
||||
|
||||
SKY_TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
SKY_ROOT = os.path.dirname(SKY_TOOLS_DIR)
|
||||
SRC_ROOT = os.path.dirname(SKY_ROOT)
|
||||
WORKBENCH_DIR = os.path.join(SRC_ROOT, 'sky', 'packages', 'workbench')
|
||||
SKY_PACKAGE = os.path.join(SRC_ROOT, 'sky', 'packages', 'sky')
|
||||
|
||||
DART_SDK = os.path.join(SRC_ROOT, 'third_party', 'dart-sdk', 'dart-sdk', 'bin')
|
||||
DARTDOC = os.path.join(DART_SDK, 'dartdoc')
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description='Sky Documentation Generator')
|
||||
parser.add_argument('--open', action='store_true',
|
||||
help='Open docs after building.')
|
||||
args = parser.parse_args()
|
||||
|
||||
doc_dir = os.path.join(SKY_PACKAGE, 'doc', 'api')
|
||||
|
||||
cmd = [
|
||||
DARTDOC,
|
||||
'--header', os.path.join(SKY_PACKAGE, 'doc', 'styles.html'),
|
||||
'--input', SKY_PACKAGE,
|
||||
'--output', doc_dir
|
||||
]
|
||||
subprocess.check_call(cmd, cwd=WORKBENCH_DIR)
|
||||
|
||||
if args.open:
|
||||
webbrowser.open(os.path.join(doc_dir, 'index.html'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(main())
|
||||
Loading…
x
Reference in New Issue
Block a user