Update Stocks.apk build tech

Instead of having a one-off //sky/apk/stocks, we now use the |sky_app| GN
template to create Stocks.apk directly from //sky/sdk/example/stocks.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1211883004.
This commit is contained in:
Adam Barth 2015-06-27 00:41:27 -07:00
parent ce5baf1e9d
commit 330f002b9e
7 changed files with 18 additions and 55 deletions

View File

@ -18,10 +18,6 @@ group("sky") {
":sky_apk",
]
if (is_android) {
deps += [ "//sky/apk/stocks" ]
}
if (!is_android) {
deps += [ "//third_party/mesa:osmesa" ]
}

View File

@ -1,25 +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.
assert(is_android)
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//sky/apk/rules.gni")
android_library("java") {
java_files = [ "org/domokit/stocks/StocksActivity.java" ]
deps = [
"//sky/shell:java",
]
}
sky_apk("stocks") {
apk_name = "Stocks"
android_manifest = "AndroidManifest.xml"
deps = [
":java",
]
}

View File

@ -1,23 +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.
package org.domokit.stocks;
import android.os.Bundle;
import org.domokit.sky.shell.SkyActivity;
/**
* Main activity for Stocks.
*/
public class StocksActivity extends SkyActivity {
/**
* @see android.app.Activity#onCreate(android.os.Bundle)
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
loadUrl("https://domokit.github.io/sky/sdk/example/stocks/index.sky");
}
}

View File

@ -187,7 +187,7 @@ Although it is possible to bundle the Sky Engine in your own app (instead of
running your code inside SkyDemo.apk), right now doing so is difficult.
There is one example of doing so if you're feeling brave:
https://github.com/domokit/mojo/tree/master/sky/apk/stocks
https://github.com/domokit/mojo/tree/master/sky/sdk/example/stocks
Eventually we plan to make this much easier and support platforms other than
Android, but that work is yet in progress.

View File

@ -8,6 +8,9 @@ group("example") {
deps = []
if (is_android) {
deps += [ "//sky/sdk/example/mine_digger" ]
deps += [
"//sky/sdk/example/mine_digger",
"//sky/sdk/example/stocks",
]
}
}

View File

@ -0,0 +1,12 @@
# 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.
assert(is_android)
import("//sky/apk/rules.gni")
sky_app("stocks") {
apk_name = "Stocks"
main_dart = "lib/main.dart"
}

View File

@ -10,7 +10,7 @@
<uses-permission android:name="android.permission.INTERNET"/>
<application android:name="org.domokit.sky.shell.SkyApplication" android:label="Stocks">
<activity android:name="StocksActivity"
<activity android:name="org.domokit.sky.shell.SkyActivity"
android:launchMode="singleTask"
android:theme="@android:style/Theme.Holo.Light.NoActionBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize"