Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 35 additions & 48 deletions shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# found in the LICENSE file.

import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("$flutter_root/common/config.gni")
import("$flutter_root/shell/config.gni")
import("$flutter_root/shell/gpu/gpu.gni")
Expand Down Expand Up @@ -90,10 +89,13 @@ shared_library("flutter_shell_native") {
ldflags = [ "-Wl,--version-script=" + rebase_path("android_exports.lst") ]
}

java_library("flutter_shell_java") {
supports_android = true
action("flutter_shell_java") {
script = "//build/android/gyp/javac.py"
depfile = "$target_gen_dir/$target_name.d"

java_files = [
jar_path = "$root_out_dir/flutter_java.jar"

sources = [
"io/flutter/app/FlutterActivity.java",
"io/flutter/app/FlutterActivityDelegate.java",
"io/flutter/app/FlutterActivityEvents.java",
Expand Down Expand Up @@ -171,56 +173,41 @@ java_library("flutter_shell_java") {
"io/flutter/view/VsyncWaiter.java",
]

java_files +=
[ "$flutter_root/third_party/bsdiff/io/flutter/util/BSDiff.java" ]
sources += [ "$flutter_root/third_party/bsdiff/io/flutter/util/BSDiff.java" ]

deps = [
":android_arch_lifecycle_common",
":android_arch_lifecycle_viewmodel",
":android_support_annotations",
":android_support_compat",
":android_support_fragment",
":android_support_v13",
android_support_jars = [
"//third_party/android_support/android_support_v13.jar",
"//third_party/android_support/android_support_compat.jar",
"//third_party/android_support/android_support_annotations.jar",
"//third_party/android_support/android_support_fragment.jar",
"//third_party/android_support/android_arch_lifecycle_common.jar",
"//third_party/android_support/android_arch_lifecycle_viewmodel.jar",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dnfield do we know who is using this? The lifecycle_common is needed for the new plugin API proposal, but I don't think lifecycle_viewmodel is required for that purpose. I wasn't sure if someone else was using it for something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are used by the embedding since the roll to sdk 28

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure exactly which classes consume them - some of them are transitive deps as well. But if you remove any javac will fail.

]

jar_path = "$root_out_dir/flutter_java.jar"
}

java_prebuilt("android_support_v13") {
supports_android = true

jar_path = "//third_party/android_support/android_support_v13.jar"
}

java_prebuilt("android_support_compat") {
supports_android = true

jar_path = "//third_party/android_support/android_support_compat.jar"
}

java_prebuilt("android_support_annotations") {
supports_android = true

jar_path = "//third_party/android_support/android_support_annotations.jar"
}

java_prebuilt("android_support_fragment") {
supports_android = true

jar_path = "//third_party/android_support/android_support_fragment.jar"
}

java_prebuilt("android_arch_lifecycle_common") {
supports_android = true
outputs = [
depfile,
jar_path,
jar_path + ".md5.stamp",
]
inputs = [
android_sdk_jar,
]
inputs += android_support_jars

jar_path = "//third_party/android_support/android_arch_lifecycle_common.jar"
}
_rebased_jar_path = rebase_path(jar_path, root_build_dir)
_rebased_depfile = rebase_path(depfile, root_build_dir)
_rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir)
_rebased_classpath = [ _rebased_android_sdk_jar ] +
rebase_path(android_support_jars, root_build_dir)

java_prebuilt("android_arch_lifecycle_viewmodel") {
supports_android = true
args = [
"--depfile=$_rebased_depfile",
"--jar-path=$_rebased_jar_path",
"--classpath=$_rebased_classpath",
"--bootclasspath=$_rebased_android_sdk_jar",
]

jar_path =
"//third_party/android_support/android_arch_lifecycle_viewmodel.jar"
args += rebase_path(sources, root_build_dir)
}

action("icudtl_object") {
Expand Down