diff --git a/engine/src/flutter/.ci.yaml b/engine/src/flutter/.ci.yaml index 45fa508518..d3a83a92a3 100644 --- a/engine/src/flutter/.ci.yaml +++ b/engine/src/flutter/.ci.yaml @@ -50,7 +50,6 @@ platform_properties: # You may use those names for the android_virtual_device version. targets: - name: Linux local_engine_builds - bringup: true enabled_branches: - main recipe: engine_v2/engine_v2 diff --git a/engine/src/flutter/ci/builders/local_engine.json b/engine/src/flutter/ci/builders/local_engine.json index 679b566f3d..a499692368 100644 --- a/engine/src/flutter/ci/builders/local_engine.json +++ b/engine/src/flutter/ci/builders/local_engine.json @@ -118,10 +118,14 @@ } }, { + "cas_archive": false, "drone_dimensions": [ "os=Mac-13", "device_type=none" ], + "gclient_variables": { + "use_rbe": true + }, "gn": [ "--runtime-mode", "profile", diff --git a/engine/src/flutter/shell/platform/android/BUILD.gn b/engine/src/flutter/shell/platform/android/BUILD.gn index 4b537f4df4..28c78d3c85 100644 --- a/engine/src/flutter/shell/platform/android/BUILD.gn +++ b/engine/src/flutter/shell/platform/android/BUILD.gn @@ -64,7 +64,8 @@ shared_library("flutter_shell_native") { inputs = [ "android_exports.lst" ] output_name = "flutter" deps = [ ":flutter_shell_native_src" ] - ldflags = [ "-Wl,--version-script=" + rebase_path("android_exports.lst") ] + ldflags = [ "-Wl,--version-script=" + + rebase_path("android_exports.lst", root_build_dir) ] } bin_to_assembly("icudtl_asm") { diff --git a/engine/src/flutter/testing/android/native_activity/native_activity_apk.py b/engine/src/flutter/testing/android/native_activity/native_activity_apk.py index 23813ab969..2286d86879 100644 --- a/engine/src/flutter/testing/android/native_activity/native_activity_apk.py +++ b/engine/src/flutter/testing/android/native_activity/native_activity_apk.py @@ -2,22 +2,39 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import sys - import argparse import os -import zipfile import subprocess +import sys +import zipfile -def run_command_checked(command): +def run_command_checked(command, env=None): try: - subprocess.check_output(command, stderr=subprocess.STDOUT, text=True) + env = env if env is not None else os.environ + subprocess.check_output(command, stderr=subprocess.STDOUT, text=True, env=env) except subprocess.CalledProcessError as cpe: print(cpe.output) raise cpe +def is_mac(): + return sys.platform == 'darwin' + + +def java_home(): + script_path = os.path.dirname(os.path.realpath(__file__)) + if is_mac(): + return os.path.join( + script_path, '..', '..', '..', '..', 'third_party', 'java', 'openjdk', 'Contents', 'Home' + ) + return os.path.join(script_path, '..', '..', 'third_party', 'java', 'openjdk') + + +def java_bin(): + return os.path.join(java_home(), 'bin') + + def main(): parser = argparse.ArgumentParser() @@ -55,6 +72,9 @@ def main(): unsigned_apk_path = os.path.join(args.gen_dir, '%s.unsigned' % apk_name) apk_path = args.output_path + java_path = ':'.join([java_bin(), os.environ['PATH']]) + env = dict(os.environ, PATH=java_path, JAVA_HOME=java_home()) + # Create the skeleton of the APK using aapt2. aapt2_command = [ args.aapt2_bin, @@ -66,7 +86,7 @@ def main(): '-o', unaligned_apk_path, ] - run_command_checked(aapt2_command) + run_command_checked(aapt2_command, env=env) # Stuff the library in the APK which is just a regular ZIP file. Libraries are not compressed. with zipfile.ZipFile(unaligned_apk_path, 'a', compression=zipfile.ZIP_STORED) as zipf: @@ -81,14 +101,14 @@ def main(): unaligned_apk_path, unsigned_apk_path, ] - run_command_checked(zipalign_command) + run_command_checked(zipalign_command, env=env) # Sign the APK. apksigner_command = [ args.apksigner_bin, 'sign', '--ks', args.keystore, '--ks-pass', 'pass:android', '--out', apk_path, unsigned_apk_path ] - run_command_checked(apksigner_command) + run_command_checked(apksigner_command, env=env) return 0