| # Copyright 2016 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. |
| |
| import("//flutter/common/config.gni") |
| import("//flutter/shell/config.gni") |
| import("//build/config/android/config.gni") |
| import("//build/config/android/rules.gni") |
| |
| shared_library("flutter_shell_native") { |
| visibility = [ ":*" ] |
| |
| output_name = "flutter" |
| |
| sources = [ |
| "android_context_gl.cc", |
| "android_context_gl.h", |
| "android_environment_gl.cc", |
| "android_environment_gl.h", |
| "android_native_window.cc", |
| "android_native_window.h", |
| "android_surface.cc", |
| "android_surface.h", |
| "android_surface_gl.cc", |
| "android_surface_gl.h", |
| "flutter_main.cc", |
| "flutter_main.h", |
| "library_loader.cc", |
| "platform_view_android.cc", |
| "platform_view_android.h", |
| "platform_view_android_jni.cc", |
| "platform_view_android_jni.h", |
| "vsync_waiter_android.cc", |
| "vsync_waiter_android.h", |
| ] |
| |
| deps = [ |
| "//flutter/common", |
| "//flutter/flow", |
| "//flutter/fml", |
| "//flutter/lib/ui", |
| "//flutter/runtime", |
| "//flutter/shell/common", |
| "//flutter/shell/gpu", |
| "//lib/ftl", |
| "//third_party/skia", |
| ] |
| if (flutter_runtime_mode == "debug") { |
| deps += [ "//dart/runtime:libdart_jit" ] |
| } else { |
| deps += [ "//dart/runtime:libdart_precompiled_runtime" ] |
| } |
| |
| defines = [] |
| |
| if (shell_enable_vulkan) { |
| sources += [ |
| "android_surface_vulkan.cc", |
| "android_surface_vulkan.h", |
| ] |
| |
| deps += [ "//flutter/vulkan" ] |
| |
| defines += [ "SHELL_ENABLE_VULKAN" ] |
| } |
| |
| libs = [ |
| "android", |
| "EGL", |
| "GLESv2", |
| ] |
| } |
| |
| java_library("flutter_shell_java") { |
| supports_android = true |
| |
| java_files = [ |
| "io/flutter/app/FlutterActivity.java", |
| "io/flutter/app/FlutterApplication.java", |
| "io/flutter/plugin/common/ActivityLifecycleListener.java", |
| "io/flutter/plugin/common/BasicMessageChannel.java", |
| "io/flutter/plugin/common/BinaryCodec.java", |
| "io/flutter/plugin/common/BinaryMessenger.java", |
| "io/flutter/plugin/common/FlutterException.java", |
| "io/flutter/plugin/common/EventChannel.java", |
| "io/flutter/plugin/common/JSONMessageCodec.java", |
| "io/flutter/plugin/common/JSONMethodCodec.java", |
| "io/flutter/plugin/common/JSONUtil.java", |
| "io/flutter/plugin/common/MessageCodec.java", |
| "io/flutter/plugin/common/MethodCall.java", |
| "io/flutter/plugin/common/MethodChannel.java", |
| "io/flutter/plugin/common/MethodCodec.java", |
| "io/flutter/plugin/common/StandardMessageCodec.java", |
| "io/flutter/plugin/common/StandardMethodCodec.java", |
| "io/flutter/plugin/common/StringCodec.java", |
| "io/flutter/plugin/editing/InputConnectionAdaptor.java", |
| "io/flutter/plugin/editing/TextInputPlugin.java", |
| "io/flutter/plugin/platform/PlatformPlugin.java", |
| "io/flutter/util/PathUtils.java", |
| "io/flutter/view/AccessibilityBridge.java", |
| "io/flutter/view/FlutterMain.java", |
| "io/flutter/view/FlutterView.java", |
| "io/flutter/view/ResourceCleaner.java", |
| "io/flutter/view/ResourceExtractor.java", |
| "io/flutter/view/ResourcePaths.java", |
| "io/flutter/view/VsyncWaiter.java", |
| ] |
| |
| jar_path = "$root_out_dir/flutter_java.jar" |
| } |
| |
| copy("flutter_shell_assets") { |
| visibility = [ ":*" ] |
| |
| sources = [ |
| "$root_build_dir/icudtl.dat", |
| ] |
| |
| outputs = [ |
| "$root_build_dir/flutter_shell_assets/{{source_file_part}}", |
| ] |
| |
| deps = [ |
| "//third_party/icu:icudata", |
| ] |
| } |
| |
| action("android") { |
| script = "//build/android/gyp/create_flutter_jar.py" |
| |
| inputs = [ |
| "$root_build_dir/flutter_java.jar", |
| "$root_build_dir/lib.stripped/libflutter.so", |
| "$root_build_dir/flutter_shell_assets/icudtl.dat", |
| ] |
| |
| outputs = [ |
| "$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("lib.stripped/libflutter.so", root_build_dir, root_build_dir), |
| "--android_abi", |
| "$android_app_abi", |
| ] |
| |
| deps = [ |
| ":flutter_shell_assets", |
| ":flutter_shell_java", |
| ":flutter_shell_native", |
| ] |
| } |