mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
ce5baf1e9d
commit
330f002b9e
4
BUILD.gn
4
BUILD.gn
@ -18,10 +18,6 @@ group("sky") {
|
||||
":sky_apk",
|
||||
]
|
||||
|
||||
if (is_android) {
|
||||
deps += [ "//sky/apk/stocks" ]
|
||||
}
|
||||
|
||||
if (!is_android) {
|
||||
deps += [ "//third_party/mesa:osmesa" ]
|
||||
}
|
||||
|
||||
@ -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",
|
||||
]
|
||||
}
|
||||
@ -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");
|
||||
}
|
||||
}
|
||||
@ -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.
|
||||
|
||||
@ -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",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
12
sdk/example/stocks/BUILD.gn
Normal file
12
sdk/example/stocks/BUILD.gn
Normal 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"
|
||||
}
|
||||
@ -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"
|
||||
Loading…
x
Reference in New Issue
Block a user