Directly generate flutter.jar without APK generation. (#3516)

This commit is contained in:
Chinmay Garde 2017-03-24 15:51:51 -07:00 committed by GitHub
parent b9bdb09806
commit 809ad59a59

View File

@ -6,9 +6,11 @@ import("//flutter/shell/config.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
shared_library("sky_shell") {
shared_library("flutter_shell_native") {
visibility = [ ":*" ]
output_name = "sky_shell"
sources = [
"android_context_gl.cc",
"android_context_gl.h",
@ -58,15 +60,15 @@ shared_library("sky_shell") {
defines += [ "SHELL_ENABLE_VULKAN" ]
}
ldflags = [
"-landroid",
"-lEGL",
"-lGLESv2",
libs = [
"android",
"EGL",
"GLESv2",
]
}
android_library("java") {
visibility = [ ":*" ]
java_library("flutter_shell_java") {
supports_android = true
java_files = [
"io/flutter/app/FlutterActivity.java",
@ -96,35 +98,55 @@ android_library("java") {
"io/flutter/view/ResourcePaths.java",
"io/flutter/view/VsyncWaiter.java",
]
jar_path = "$root_out_dir/flutter_java.jar"
}
copy_ex("assets") {
copy("flutter_shell_assets") {
visibility = [ ":*" ]
clear_dir = true
dest = "$root_build_dir/sky_shell/assets"
sources = [
"$root_build_dir/icudtl.dat",
]
outputs = [
"$root_build_dir/flutter_shell_assets/{{source_file_part}}",
]
deps = [
"//third_party/icu:icudata",
]
}
android_apk("android") {
apk_name = "SkyShell"
android_manifest = "AndroidManifest.xml"
action("android") {
script = "//build/android/gyp/create_flutter_jar.py"
native_libs = [ "libsky_shell.so" ]
asset_location = "$root_build_dir/sky_shell/assets"
inputs = [
"$root_build_dir/flutter_java.jar",
"$root_build_dir/libsky_shell.so",
"$root_build_dir/flutter_shell_assets/icudtl.dat",
]
extensions_to_not_compress = ".flx"
outputs = [
"$root_build_dir/flutter.jar",
]
flutter_dist_jar = "$root_build_dir/flutter.jar"
args = [
"--output",
rebase_path("flutter.jar", root_build_dir, root_build_dir),
"--dist_jar",
rebase_path("flutter_java.jar", root_build_dir, root_build_dir),
"--asset_dir",
rebase_path("flutter_shell_assets", root_build_dir, root_build_dir),
"--native_lib",
rebase_path("libsky_shell.so", root_build_dir, root_build_dir),
"--android_abi",
"$android_app_abi",
]
deps = [
":assets",
":java",
":sky_shell",
":flutter_shell_assets",
":flutter_shell_java",
":flutter_shell_native",
]
}