提交 a40fd86b 编写于 作者: A Adam Barth

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 .
上级 c61f5461
......@@ -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",
]
}
}
......@@ -92,7 +92,8 @@ dart_pkg("sky") {
# List of mojom targets that the sky pkg exports
deps = [
"//sky/services/engine",
"//sky/services/engine:interfaces",
"//sky/services/activity:interfaces",
]
datadeps = [
......@@ -100,7 +101,8 @@ dart_pkg("sky") {
"//mojo/dart/mojom",
"//mojo/public/dart:mojo",
"//sky/engine/bindings",
"//sky/services/testing",
"//sky/services/testing:interfaces",
"//sky/services/media:interfaces",
"//third_party/dart-pkg",
]
......
......@@ -5,15 +5,11 @@
group("example") {
testonly = true
deps = []
if (is_android) {
deps += [
"//sky/sdk/example/demo_launcher",
"//sky/sdk/example/mine_digger",
"//sky/sdk/example/rendering",
"//sky/sdk/example/stocks",
"//sky/sdk/example/widgets",
]
}
deps = [
"//sky/sdk/example/rendering",
"//sky/sdk/example/demo_launcher",
"//sky/sdk/example/mine_digger",
"//sky/sdk/example/stocks",
"//sky/sdk/example/widgets",
]
}
......@@ -5,21 +5,22 @@
import("//sky/build/sky_app.gni")
sky_app("demo_launcher") {
apk_name = "SkyDemo"
main_dart = "lib/main.dart"
manifest = "sky.yaml"
if (enable_skyx) {
if (is_android) {
apk_name = "SkyDemo"
bundles = [
"//sky/sdk/example/mine_digger",
"//sky/sdk/example/rendering:interactive_flex",
"//sky/sdk/example/stocks",
"//sky/sdk/example/widgets:sector",
]
}
deps = [
"//sky/sdk/example/demo_launcher/apk:java",
"//sky/sdk/example/demo_launcher/apk:resources",
]
deps = [
"//sky/sdk/example/demo_launcher/apk:java",
"//sky/sdk/example/demo_launcher/apk:resources",
]
}
}
......@@ -2,11 +2,12 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_android)
import("//sky/build/sky_app.gni")
sky_app("mine_digger") {
apk_name = "MineDigger"
main_dart = "lib/main.dart"
if (is_android) {
apk_name = "MineDigger"
}
}
......@@ -2,12 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_android)
import("//sky/build/sky_app.gni")
sky_app("stocks") {
apk_name = "Stocks"
main_dart = "lib/main.dart"
manifest = "sky.yaml"
if (is_android) {
apk_name = "Stocks"
}
}
......@@ -16,6 +16,12 @@ group("activity") {
}
}
mojom("interfaces") {
sources = [
"activity.mojom",
]
}
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
......@@ -31,9 +37,3 @@ if (is_android) {
]
}
}
mojom("interfaces") {
sources = [
"activity.mojom",
]
}
......@@ -4,7 +4,7 @@
import("//mojo/public/tools/bindings/mojom.gni")
mojom("engine") {
mojom("interfaces") {
sources = [
"input_event.mojom",
"sky_engine.mojom",
......
......@@ -2,32 +2,18 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//mojo/public/tools/bindings/mojom.gni")
group("media") {
testonly = true
deps = [
":media_lib",
":interfaces",
]
}
android_library("media_lib") {
java_files = [
"src/org/domokit/media/MediaPlayerImpl.java",
"src/org/domokit/media/MediaServiceImpl.java",
]
deps = [
"//base:base_java",
"//mojo/java",
"//mojo/public/java:bindings",
"//mojo/public/java:system",
":interfaces_java",
]
if (is_android) {
deps += [ ":media_lib" ]
}
}
mojom("interfaces") {
......@@ -35,3 +21,23 @@ mojom("interfaces") {
"media.mojom",
]
}
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
android_library("media_lib") {
java_files = [
"src/org/domokit/media/MediaPlayerImpl.java",
"src/org/domokit/media/MediaServiceImpl.java",
]
deps = [
"//base:base_java",
"//mojo/java",
"//mojo/public/java:bindings",
"//mojo/public/java:system",
":interfaces_java",
]
}
}
......@@ -4,7 +4,7 @@
import("//mojo/public/tools/bindings/mojom.gni")
mojom("testing") {
mojom("interfaces") {
sources = [
"test_harness.mojom",
]
......
......@@ -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,
......
# 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",
]
}
......@@ -54,7 +54,7 @@ mojo_native_application("viewer") {
"//sky/engine/tonic",
"//sky/services/activity:interfaces",
"//sky/services/platform",
"//sky/services/testing",
"//sky/services/testing:interfaces",
"//sky/shell/dart",
"//sky/viewer/compositor",
"//third_party/icu",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册