Build skyx packages by default
Now that we have all the Dart packages we need in //third_party, we can build skyx bundles by default. As part of this change, I've made it possible to build skyx bundles on Linux and I've made the gn target names of the mojoms in //sky/services consistent with each other and with //mojo/services/public. TBR=eseidel@google.com Review URL: https://codereview.chromium.org/1227973002 .
This commit is contained in:
@@ -2,11 +2,16 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import("//build/config/android/rules.gni")
|
||||
import("//sky/build/skyx.gni")
|
||||
|
||||
template("sky_app") {
|
||||
skyx("app") {
|
||||
skyx_target_name = target_name
|
||||
|
||||
if (is_android) {
|
||||
skyx_target_name = "app"
|
||||
}
|
||||
|
||||
skyx(skyx_target_name) {
|
||||
main_dart = invoker.main_dart
|
||||
|
||||
if (defined(invoker.manifest)) {
|
||||
@@ -18,65 +23,65 @@ template("sky_app") {
|
||||
}
|
||||
}
|
||||
|
||||
bundle_prefix = target_name
|
||||
if (is_android) {
|
||||
import("//build/config/android/rules.gni")
|
||||
|
||||
copy("copy_${bundle_prefix}_bundle") {
|
||||
sources = [
|
||||
"$target_gen_dir/app.skyx",
|
||||
]
|
||||
outputs = [
|
||||
"$target_gen_dir/${bundle_prefix}.skyx",
|
||||
]
|
||||
bundle_prefix = target_name
|
||||
|
||||
deps = [
|
||||
":app",
|
||||
]
|
||||
}
|
||||
copy("copy_${bundle_prefix}_bundle") {
|
||||
sources = [
|
||||
"$target_gen_dir/app.skyx",
|
||||
]
|
||||
outputs = [
|
||||
"$target_gen_dir/${bundle_prefix}.skyx",
|
||||
]
|
||||
|
||||
copy_ex("assets") {
|
||||
clear_dir = true
|
||||
dest = "$target_gen_dir/assets"
|
||||
deps = [
|
||||
":app",
|
||||
]
|
||||
}
|
||||
|
||||
sources = [
|
||||
"$root_build_dir/icudtl.dat",
|
||||
]
|
||||
deps = [
|
||||
"//third_party/icu",
|
||||
]
|
||||
copy_ex("assets") {
|
||||
clear_dir = true
|
||||
dest = "$target_gen_dir/assets"
|
||||
|
||||
if (enable_skyx) {
|
||||
sources += [ "$target_gen_dir/app.skyx" ]
|
||||
deps += [ ":copy_${bundle_prefix}_bundle" ]
|
||||
sources = [
|
||||
"$root_build_dir/icudtl.dat",
|
||||
"$target_gen_dir/app.skyx",
|
||||
]
|
||||
deps = [
|
||||
"//third_party/icu",
|
||||
":copy_${bundle_prefix}_bundle",
|
||||
]
|
||||
|
||||
if (defined(invoker.bundles)) {
|
||||
foreach(bundle, invoker.bundles) {
|
||||
bundle_gen_dir = get_label_info(bundle, "target_gen_dir")
|
||||
bundle_name = get_label_info(bundle, "name")
|
||||
|
||||
sources += [ "$bundle_gen_dir/${bundle_name}.skyx" ]
|
||||
deps += [ bundle ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
android_apk(target_name) {
|
||||
apk_name = invoker.apk_name
|
||||
android_manifest = "apk/AndroidManifest.xml"
|
||||
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"
|
||||
native_libs = [ "libsky_shell.so" ]
|
||||
asset_location = "$target_gen_dir/assets"
|
||||
|
||||
deps = [
|
||||
"//base:base_java",
|
||||
"//sky/shell:assets",
|
||||
"//sky/shell:java",
|
||||
"//sky/shell:sky_shell",
|
||||
":assets",
|
||||
]
|
||||
deps = [
|
||||
"//base:base_java",
|
||||
"//sky/shell:assets",
|
||||
"//sky/shell:java",
|
||||
"//sky/shell:sky_shell",
|
||||
":assets",
|
||||
]
|
||||
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
if (defined(invoker.deps)) {
|
||||
deps += invoker.deps
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,6 @@
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
declare_args() {
|
||||
# Controls whether we build app.skyx bundles in the sky_app template below.
|
||||
# An app.skyx bundle contains all the code an resources needed to run a Sky
|
||||
# app offline. Unfortunately, we don't yet have all the Dart packages we need
|
||||
# to create skyx packages installed on the build bots, so this functionality
|
||||
# is currently disabled. This flag allows for local testing of this feature.
|
||||
enable_skyx = false
|
||||
}
|
||||
|
||||
package_root = "$root_gen_dir/dart-pkg/packages"
|
||||
|
||||
template("skyx") {
|
||||
@@ -75,6 +66,8 @@ template("skyx") {
|
||||
|
||||
script = "//sky/tools/skyx.py"
|
||||
args = [
|
||||
"--package-root",
|
||||
rebase_path(package_root, root_build_dir),
|
||||
"--asset-base",
|
||||
rebase_path(asset_base, root_build_dir),
|
||||
"--snapshot",
|
||||
@@ -93,14 +86,13 @@ template("skyx") {
|
||||
|
||||
deps = [
|
||||
":gen_${bundle_prefix}_snapshot",
|
||||
"//third_party/dart-pkg",
|
||||
]
|
||||
}
|
||||
|
||||
group(target_name) {
|
||||
if (enable_skyx) {
|
||||
deps = [
|
||||
":gen_${bundle_prefix}_bundle",
|
||||
]
|
||||
}
|
||||
deps = [
|
||||
":gen_${bundle_prefix}_bundle",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ common_deps = [
|
||||
"//sky/engine",
|
||||
"//sky/engine/tonic",
|
||||
"//sky/engine/wtf",
|
||||
"//sky/services/engine",
|
||||
"//sky/services/engine:interfaces",
|
||||
"//sky/services/platform",
|
||||
"//sky/shell/dart",
|
||||
"//ui/gfx/geometry",
|
||||
@@ -120,7 +120,7 @@ if (is_android) {
|
||||
"//services/keyboard",
|
||||
"//sky/services/activity:activity_lib",
|
||||
"//sky/services/activity:interfaces_java",
|
||||
"//sky/services/engine:engine_java",
|
||||
"//sky/services/engine:interfaces_java",
|
||||
"//sky/services/oknet",
|
||||
]
|
||||
}
|
||||
@@ -191,7 +191,7 @@ if (is_android) {
|
||||
|
||||
deps = common_deps + [
|
||||
":common",
|
||||
"//sky/services/testing",
|
||||
"//sky/services/testing:interfaces",
|
||||
]
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -14,6 +14,7 @@ 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('--package-root', type=str)
|
||||
parser.add_argument('--manifest', type=str)
|
||||
parser.add_argument('--asset-base', type=str)
|
||||
parser.add_argument('--snapshot', type=str)
|
||||
@@ -22,6 +23,7 @@ def main():
|
||||
|
||||
command = [
|
||||
os.path.join(DART_SDK, 'dart'),
|
||||
'--package-root=%s' % args.package_root,
|
||||
os.path.join(SKY_TOOLS_DIR, 'skyx', 'bin', 'skyx.dart'),
|
||||
'--asset-base', args.asset_base,
|
||||
'--snapshot', args.snapshot,
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
# Generated by pub
|
||||
# See http://pub.dartlang.org/doc/glossary.html#lockfile
|
||||
packages:
|
||||
archive:
|
||||
description: archive
|
||||
source: hosted
|
||||
version: "1.0.20"
|
||||
args:
|
||||
description: args
|
||||
source: hosted
|
||||
version: "0.13.2"
|
||||
collection:
|
||||
description: collection
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
crypto:
|
||||
description: crypto
|
||||
source: hosted
|
||||
version: "0.9.0"
|
||||
path:
|
||||
description: path
|
||||
source: hosted
|
||||
version: "1.3.5"
|
||||
source_span:
|
||||
description: source_span
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
string_scanner:
|
||||
description: string_scanner
|
||||
source: hosted
|
||||
version: "0.1.3+1"
|
||||
yaml:
|
||||
description: yaml
|
||||
source: hosted
|
||||
version: "2.1.3"
|
||||
@@ -26,6 +26,6 @@ mojo_native_application("tester") {
|
||||
"//mojo/services/input_events/public/interfaces",
|
||||
"//mojo/services/view_manager/public/cpp",
|
||||
"//services/window_manager:lib",
|
||||
"//sky/services/testing",
|
||||
"//sky/services/testing:interfaces",
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user