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

Make SkyDemo.apk start offline

Offline support isn't complete, but after this CL, SkyDemo.apk is able to start
and show some UI offline.

R=eseidel@chromium.org, eseidel@google.com

Review URL: https://codereview.chromium.org/1225883002.
上级 07d3108e
...@@ -30,10 +30,7 @@ group("sky_apk") { ...@@ -30,10 +30,7 @@ group("sky_apk") {
] ]
if (is_android) { if (is_android) {
deps += [ deps += [ "//sky/services/intents" ]
"//sky/apk/demo",
"//sky/services/intents",
]
} }
if (is_linux) { if (is_linux) {
......
...@@ -2,27 +2,9 @@ ...@@ -2,27 +2,9 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni") import("//build/config/android/rules.gni")
import("//sky/build/skyx.gni") import("//sky/build/skyx.gni")
template("sky_apk") {
android_apk(target_name) {
apk_name = invoker.apk_name
android_manifest = invoker.android_manifest
native_libs = [ "libsky_shell.so" ]
asset_location = "$root_build_dir/sky_shell/assets"
deps = [
"//base:base_java",
"//sky/shell:assets",
"//sky/shell:java",
"//sky/shell:sky_shell",
] + invoker.deps
}
}
template("sky_app") { template("sky_app") {
skyx("app") { skyx("app") {
main_dart = invoker.main_dart main_dart = invoker.main_dart
......
...@@ -2,9 +2,15 @@ ...@@ -2,9 +2,15 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//sky/build/skyx.gni") import("//sky/build/sky_app.gni")
skyx("demo_launcher") { sky_app("demo_launcher") {
apk_name = "SkyDemo"
main_dart = "lib/main.dart" main_dart = "lib/main.dart"
manifest = "sky.yaml" manifest = "sky.yaml"
deps = [
"//sky/sdk/example/demo_launcher/apk:java",
"//sky/sdk/example/demo_launcher/apk:resources",
]
} }
...@@ -6,7 +6,6 @@ assert(is_android) ...@@ -6,7 +6,6 @@ assert(is_android)
import("//build/config/android/config.gni") import("//build/config/android/config.gni")
import("//build/config/android/rules.gni") import("//build/config/android/rules.gni")
import("//sky/apk/rules.gni")
android_library("java") { android_library("java") {
java_files = [ java_files = [
...@@ -30,16 +29,7 @@ android_library("java") { ...@@ -30,16 +29,7 @@ android_library("java") {
] ]
} }
sky_apk("demo") { android_resources("resources") {
apk_name = "SkyDemo"
android_manifest = "AndroidManifest.xml"
deps = [
":java",
":demo_resources",
]
}
android_resources("demo_resources") {
resource_dirs = [ "res" ] resource_dirs = [ "res" ]
android_manifest = "AndroidManifest.xml" android_manifest = "AndroidManifest.xml"
} }
...@@ -12,18 +12,11 @@ import org.domokit.sky.shell.SkyActivity; ...@@ -12,18 +12,11 @@ import org.domokit.sky.shell.SkyActivity;
* Main activity for SkyDemo. * Main activity for SkyDemo.
*/ */
public class SkyDemoActivity extends SkyActivity { public class SkyDemoActivity extends SkyActivity {
private static final String DEFAULT_URL = "https://domokit.github.io/example/demo_launcher/lib/main.dart";
@Override @Override
protected void onSkyReady() { protected void onSkyReady() {
Intent intent = getIntent(); Intent intent = getIntent();
String action = intent.getAction(); String action = intent.getAction();
if (Intent.ACTION_MAIN.equals(action)) {
loadUrl(DEFAULT_URL);
return;
}
if (Intent.ACTION_VIEW.equals(action)) { if (Intent.ACTION_VIEW.equals(action)) {
String bundleName = intent.getStringExtra("bundleName"); String bundleName = intent.getStringExtra("bundleName");
if (bundleName != null && loadBundleByName(bundleName)) { if (bundleName != null && loadBundleByName(bundleName)) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
assert(is_android) assert(is_android)
import("//sky/apk/rules.gni") import("//sky/build/sky_app.gni")
sky_app("mine_digger") { sky_app("mine_digger") {
apk_name = "MineDigger" apk_name = "MineDigger"
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
assert(is_android) assert(is_android)
import("//sky/apk/rules.gni") import("//sky/build/sky_app.gni")
sky_app("stocks") { sky_app("stocks") {
apk_name = "Stocks" apk_name = "Stocks"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册