From 23f541ae48151dd210fedd9ad4620f254f0eee8a Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 10 Apr 2024 13:12:44 -0700 Subject: [PATCH 1/8] WIP --- DEPS | 6 +++--- .../{ => flutter}/third_party/android_tools/BUILD.gn | 0 build/secondary/third_party/android_ndk/BUILD.gn | 5 +++-- build/secondary/third_party/cpu-features/BUILD.gn | 5 +++-- ci/binary_size_treemap.sh | 4 ++-- sky/tools/flutter_gdb | 6 +++--- testing/analyze_core_dump.sh | 2 +- testing/android/native_activity/native_activity.gni | 6 ++++-- testing/android_systrace_test.py | 2 +- testing/scenario_app/android/README.md | 6 +++--- testing/scenario_app/bin/utils/options.dart | 10 +++++++--- tools/android_lint/bin/main.dart | 5 +++-- tools/javadoc/gen_javadoc.py | 2 +- 13 files changed, 34 insertions(+), 25 deletions(-) rename build/secondary/{ => flutter}/third_party/android_tools/BUILD.gn (100%) diff --git a/DEPS b/DEPS index 855138f7c6ef7..3764a36b161f9 100644 --- a/DEPS +++ b/DEPS @@ -745,7 +745,7 @@ deps = { 'dep_type': 'cipd' }, - 'src/third_party/android_tools/trace_to_text': { + 'src/flutter/third_party/android_tools/trace_to_text': { 'packages': [ { # 25.0 downloads for both mac-amd64 and mac-arm64 @@ -759,7 +759,7 @@ deps = { 'dep_type': 'cipd' }, - 'src/third_party/android_tools/google-java-format': { + 'src/flutter/third_party/android_tools/google-java-format': { 'packages': [ { 'package': 'flutter/android/google-java-format', @@ -773,7 +773,7 @@ deps = { 'dep_type': 'cipd', }, - 'src/third_party/android_tools': { + 'src/flutter/third_party/android_tools': { 'packages': [ { 'package': 'flutter/android/sdk/all/${{platform}}', diff --git a/build/secondary/third_party/android_tools/BUILD.gn b/build/secondary/flutter/third_party/android_tools/BUILD.gn similarity index 100% rename from build/secondary/third_party/android_tools/BUILD.gn rename to build/secondary/flutter/third_party/android_tools/BUILD.gn diff --git a/build/secondary/third_party/android_ndk/BUILD.gn b/build/secondary/third_party/android_ndk/BUILD.gn index 697d2873a5e39..84f309869e1bd 100644 --- a/build/secondary/third_party/android_ndk/BUILD.gn +++ b/build/secondary/third_party/android_ndk/BUILD.gn @@ -3,6 +3,7 @@ # found in the LICENSE file. source_set("cpu_features") { - public_configs = [ "//third_party/android_tools:cpu_features_include" ] - deps = [ "//third_party/android_tools:cpu_features" ] + public_configs = + [ "//flutter/third_party/android_tools:cpu_features_include" ] + deps = [ "//flutter/third_party/android_tools:cpu_features" ] } diff --git a/build/secondary/third_party/cpu-features/BUILD.gn b/build/secondary/third_party/cpu-features/BUILD.gn index dadee56df8cff..68cdbbfc3a41b 100644 --- a/build/secondary/third_party/cpu-features/BUILD.gn +++ b/build/secondary/third_party/cpu-features/BUILD.gn @@ -3,6 +3,7 @@ # found in the LICENSE file. source_set("cpu-features") { - public_configs = [ "//third_party/android_tools:cpu_features_include" ] - deps = [ "//third_party/android_tools:cpu_features" ] + public_configs = + [ "//flutter/third_party/android_tools:cpu_features_include" ] + deps = [ "//flutter/third_party/android_tools:cpu_features" ] } diff --git a/ci/binary_size_treemap.sh b/ci/binary_size_treemap.sh index 971b16b193543..769423c5c46b5 100755 --- a/ci/binary_size_treemap.sh +++ b/ci/binary_size_treemap.sh @@ -22,8 +22,8 @@ if [ "$(uname)" == "Darwin" ]; then else NDK_PLATFORM="linux-x86_64" fi -ADDR2LINE="third_party/android_tools/ndk/toolchains/llvm/prebuilt/$NDK_PLATFORM/bin/llvm-addr2line" -NM="third_party/android_tools/ndk/toolchains/llvm/prebuilt/$NDK_PLATFORM/bin/llvm-nm" +ADDR2LINE="flutter/third_party/android_tools/ndk/toolchains/llvm/prebuilt/$NDK_PLATFORM/bin/llvm-addr2line" +NM="flutter/third_party/android_tools/ndk/toolchains/llvm/prebuilt/$NDK_PLATFORM/bin/llvm-nm" # Run the binary size script from the buildroot directory so the treemap path # navigation will start from there. diff --git a/sky/tools/flutter_gdb b/sky/tools/flutter_gdb index ee62dc52fbd6e..b27e8d9b734b7 100755 --- a/sky/tools/flutter_gdb +++ b/sky/tools/flutter_gdb @@ -25,7 +25,7 @@ previous run for a given device, then you can skip this step by passing --no-pull-libs. """ -ADB_LOCAL_PATH = 'third_party/android_tools/sdk/platform-tools/adb' +ADB_LOCAL_PATH = 'flutter/third_party/android_tools/sdk/platform-tools/adb' def _get_flutter_root(): @@ -86,7 +86,7 @@ class GdbClient(object): SYSTEM_LIBS_PATH = '/tmp/flutter_gdb_device_libs' def _gdb_local_path(self): - GDB_LOCAL_PATH = ('third_party/android_tools/ndk/prebuilt/%s-x86_64/bin/gdb') + GDB_LOCAL_PATH = ('flutter/third_party/android_tools/ndk/prebuilt/%s-x86_64/bin/gdb') if sys.platform.startswith('darwin'): return GDB_LOCAL_PATH % 'darwin' else: @@ -194,7 +194,7 @@ class GdbServer(object): return 1 abi = _get_device_abi(adb_command) - gdb_server_local_path = 'third_party/android_tools/ndk/prebuilt/android-%s/gdbserver/gdbserver' % abi + gdb_server_local_path = 'flutter/third_party/android_tools/ndk/prebuilt/android-%s/gdbserver/gdbserver' % abi # Copy gdbserver to the package's data directory. subprocess.check_call(adb_command + ['push', diff --git a/testing/analyze_core_dump.sh b/testing/analyze_core_dump.sh index 26ec902414c57..0cf2c9b70b21a 100755 --- a/testing/analyze_core_dump.sh +++ b/testing/analyze_core_dump.sh @@ -15,7 +15,7 @@ if [ "$UNAME" == "Linux" ]; then if [ -x "$(command -v gdb)" ]; then GDB=gdb else - GDB=$BUILDROOT/third_party/android_tools/ndk/prebuilt/linux-x86_64/bin/gdb + GDB=$BUILDROOT/flutter/third_party/android_tools/ndk/prebuilt/linux-x86_64/bin/gdb fi echo "GDB=$GDB" $GDB $EXE $CORE --batch -ex "thread apply all bt" > $OUTPUT diff --git a/testing/android/native_activity/native_activity.gni b/testing/android/native_activity/native_activity.gni index cbf4d3e75141d..d5af82452a2d6 100644 --- a/testing/android/native_activity/native_activity.gni +++ b/testing/android/native_activity/native_activity.gni @@ -5,11 +5,13 @@ import("//build/config/android/config.gni") import("//flutter/tools/templater/templater.gni") -android_buildtools = "//third_party/android_tools/sdk/build-tools/34.0.0" +android_buildtools = + "//flutter/third_party/android_tools/sdk/build-tools/34.0.0" aapt2 = "$android_buildtools/aapt2" zipalign = "$android_buildtools/zipalign" apksigner = "$android_buildtools/apksigner" -android_jar = "//third_party/android_tools/sdk/platforms/android-34/android.jar" +android_jar = + "//flutter/third_party/android_tools/sdk/platforms/android-34/android.jar" src_root = "//flutter/testing/android/native_activity" # A drop in replacement for an executable or shared library target. Providing a diff --git a/testing/android_systrace_test.py b/testing/android_systrace_test.py index 2875409703e92..9acf9b1c01635 100755 --- a/testing/android_systrace_test.py +++ b/testing/android_systrace_test.py @@ -83,7 +83,7 @@ def collect_and_validate_trace(adb_path='adb'): print('Validating trace') traceconv = os.path.join( - BUILDROOT_DIR, 'third_party', 'android_tools', 'trace_to_text', 'trace_to_text' + BUILDROOT_DIR, 'flutter', 'third_party', 'android_tools', 'trace_to_text', 'trace_to_text' ) traceconv_output = subprocess.check_output([traceconv, 'systrace', 'trace.pb'], stderr=subprocess.STDOUT, diff --git a/testing/scenario_app/android/README.md b/testing/scenario_app/android/README.md index d4e4627eec5f2..dc6f0049b368f 100644 --- a/testing/scenario_app/android/README.md +++ b/testing/scenario_app/android/README.md @@ -104,14 +104,14 @@ See also: It's highly recommended to use the engine's vendored Android SDK, which once you have the engine set up, you can find at -`$ENGINE/src/third_party/android_tools/sdk`. Testing or running with other -versions of the SDK may work, but it's _not guaranteed_, and might have +`$ENGINE/src/flutter/third_party/android_tools/sdk`. Testing or running with +other versions of the SDK may work, but it's _not guaranteed_, and might have different results. Consider also placing this directory in the `ANDROID_HOME` environment variable: ```sh -export ANDROID_HOME=$ENGINE/src/third_party/android_tools/sdk +export ANDROID_HOME=$ENGINE/src/flutter/third_party/android_tools/sdk ``` ### Device or Emulator diff --git a/testing/scenario_app/bin/utils/options.dart b/testing/scenario_app/bin/utils/options.dart index 852460da64397..8de3199dda390 100644 --- a/testing/scenario_app/bin/utils/options.dart +++ b/testing/scenario_app/bin/utils/options.dart @@ -186,10 +186,12 @@ extension type const Options._(ArgResults _args) { 'adb', help: 'Path to the Android Debug Bridge (adb) executable. ' 'If the current working directory is within the engine repository, ' - 'defaults to ./third_party/android_tools/sdk/platform-tools/adb.', + 'defaults to ' + './flutter/third_party/android_tools/sdk/platform-tools/adb.', defaultsTo: localEngine != null ? p.join( localEngine.srcDir.path, + 'flutter', 'third_party', 'android_tools', 'sdk', @@ -204,14 +206,16 @@ extension type const Options._(ArgResults _args) { 'ndk-stack', help: 'Path to the NDK stack tool. Defaults to the checked-in version in ' - 'third_party/android_tools if the current working directory is ' - 'within the engine repository on a supported platform.', + 'flutter/third_party/android_tools if the current working ' + 'directory is within the engine repository on a supported ' + 'platform.', defaultsTo: localEngine != null && (io.Platform.isLinux || io.Platform.isMacOS || io.Platform.isWindows) ? p.join( localEngine.srcDir.path, + 'flutter', 'third_party', 'android_tools', 'ndk', diff --git a/tools/android_lint/bin/main.dart b/tools/android_lint/bin/main.dart index d6b6191b73e98..838b17da6bfd6 100644 --- a/tools/android_lint/bin/main.dart +++ b/tools/android_lint/bin/main.dart @@ -48,12 +48,13 @@ Future runLint(ArgParser argParser, ArgResults argResults) async { } final Directory androidSdkDir = Directory( - path.join(inArgument, 'third_party', 'android_tools', 'sdk'), + path.join(inArgument, 'flutter', 'third_party', 'android_tools', 'sdk'), ); if (!androidSdkDir.existsSync()) { print('The Android SDK for this engine is missing from the ' - 'third_party/android_tools directory. Have you run gclient sync?\n'); + 'flutter/third_party/android_tools directory. Have you run gclient ' + 'sync?\n'); print(argParser.usage); return -1; } diff --git a/tools/javadoc/gen_javadoc.py b/tools/javadoc/gen_javadoc.py index 357bc285fdca9..424602ca5e3ce 100755 --- a/tools/javadoc/gen_javadoc.py +++ b/tools/javadoc/gen_javadoc.py @@ -51,7 +51,7 @@ def main(): classpath = [ args.android_source_root, - os.path.join(args.third_party, 'android_tools/sdk/platforms/android-34/android.jar'), + os.path.join('flutter', 'third_party', 'android_tools', 'sdk', 'platforms', 'android-34', 'android.jar'), os.path.join(args.third_party, 'android_embedding_dependencies', 'lib', '*'), ] if args.build_config_path: From d45dfbbb5412540f1e93b4a93392598b8c5ce80a Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 10 Apr 2024 13:33:06 -0700 Subject: [PATCH 2/8] Fix the tools. --- shell/platform/android/BUILD.gn | 4 ++-- testing/rules/run_gradle.py | 2 +- tools/javadoc/gen_javadoc.py | 11 ++++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/shell/platform/android/BUILD.gn b/shell/platform/android/BUILD.gn index 28c78d3c8598a..0829a94c73052 100644 --- a/shell/platform/android/BUILD.gn +++ b/shell/platform/android/BUILD.gn @@ -646,8 +646,8 @@ action("gen_android_javadoc") { rebase_path("."), "--build-config-path", rebase_path(target_gen_dir), - "--third-party", - rebase_path("//third_party"), + "--src-dir", + rebase_path("//"), "--quiet", ] diff --git a/testing/rules/run_gradle.py b/testing/rules/run_gradle.py index d07cbd3c7e891..4e23ea5add407 100644 --- a/testing/rules/run_gradle.py +++ b/testing/rules/run_gradle.py @@ -21,7 +21,7 @@ ) ANDROID_HOME = os.path.normpath( - os.path.join(SCRIPT_PATH, '..', '..', '..', 'third_party', 'android_tools', 'sdk') + os.path.join(SCRIPT_PATH, '..', '..', 'third_party', 'android_tools', 'sdk') ) if platform.system() == 'Darwin': diff --git a/tools/javadoc/gen_javadoc.py b/tools/javadoc/gen_javadoc.py index 424602ca5e3ce..516d472d79a65 100755 --- a/tools/javadoc/gen_javadoc.py +++ b/tools/javadoc/gen_javadoc.py @@ -35,7 +35,7 @@ def main(): parser.add_argument('--out-dir', type=str, required=True) parser.add_argument('--android-source-root', type=str, default=ANDROID_SRC_ROOT) parser.add_argument('--build-config-path', type=str) - parser.add_argument('--third-party', type=str, default='third_party') + parser.add_argument('--src-dir', type=str, default='.') parser.add_argument('--quiet', default=False, action='store_true') args = parser.parse_args() @@ -48,11 +48,16 @@ def main(): if not os.path.exists(args.out_dir): os.makedirs(args.out_dir) + + android_jar_path = os.path.join(args.src_dir, 'flutter', 'third_party', 'android_tools', 'sdk', 'platforms', 'android-34', 'android.jar') + if not os.path.exists(android_jar_path): + print('Android SDK not found at %s' % android_jar_path) + return 1 classpath = [ args.android_source_root, - os.path.join('flutter', 'third_party', 'android_tools', 'sdk', 'platforms', 'android-34', 'android.jar'), - os.path.join(args.third_party, 'android_embedding_dependencies', 'lib', '*'), + android_jar_path, + os.path.join(args.src_dir, 'third_party', 'android_embedding_dependencies', 'lib', '*'), ] if args.build_config_path: classpath.append(args.build_config_path) From e3c0f1fd7accca3e2e1d2ad3a85f6608173ffb64 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 10 Apr 2024 13:33:28 -0700 Subject: [PATCH 3/8] Fmt. --- tools/javadoc/gen_javadoc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/javadoc/gen_javadoc.py b/tools/javadoc/gen_javadoc.py index 516d472d79a65..cd30594215a28 100755 --- a/tools/javadoc/gen_javadoc.py +++ b/tools/javadoc/gen_javadoc.py @@ -48,8 +48,11 @@ def main(): if not os.path.exists(args.out_dir): os.makedirs(args.out_dir) - - android_jar_path = os.path.join(args.src_dir, 'flutter', 'third_party', 'android_tools', 'sdk', 'platforms', 'android-34', 'android.jar') + + android_jar_path = os.path.join( + args.src_dir, 'flutter', 'third_party', 'android_tools', 'sdk', 'platforms', 'android-34', + 'android.jar' + ) if not os.path.exists(android_jar_path): print('Android SDK not found at %s' % android_jar_path) return 1 From a2cfd0d0098038fc900357c75d3e12ce81b58697 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 23 Apr 2024 13:19:53 -0700 Subject: [PATCH 4/8] Update ANDROID_HOME in run_tests.py. --- testing/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/run_tests.py b/testing/run_tests.py index 1a0f4526be532..1fbcd31f84995 100755 --- a/testing/run_tests.py +++ b/testing/run_tests.py @@ -710,7 +710,7 @@ def run_java_tests(executable_filter, android_variant='android_debug_unopt'): BUILDROOT_DIR, 'third_party', 'gradle', 'bin', 'gradle.bat' if is_windows() else 'gradle' ) flutter_jar = os.path.join(OUT_DIR, android_variant, 'flutter.jar') - android_home = os.path.join(BUILDROOT_DIR, 'third_party', 'android_tools', 'sdk') + android_home = os.path.join(BUILDROOT_DIR, 'flutter', 'third_party', 'android_tools', 'sdk') build_dir = os.path.join(OUT_DIR, android_variant, 'robolectric_tests', 'build') gradle_cache_dir = os.path.join(OUT_DIR, android_variant, 'robolectric_tests', '.gradle') From f1d0d4a3396b7f9b967a6dc82e6c38702646a4a2 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 23 Apr 2024 14:50:15 -0700 Subject: [PATCH 5/8] Exclude the new directory. --- ci/licenses_golden/excluded_files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/licenses_golden/excluded_files b/ci/licenses_golden/excluded_files index 36c5b50ffc61a..415883a4a817d 100644 --- a/ci/licenses_golden/excluded_files +++ b/ci/licenses_golden/excluded_files @@ -775,6 +775,7 @@ ../../../flutter/third_party/accessibility/gfx/geometry/vector2d_unittest.cc ../../../flutter/third_party/accessibility/gfx/range/range_unittest.cc ../../../flutter/third_party/accessibility/gfx/test +../../../flutter/third_party/android_tools ../../../flutter/third_party/angle/.clang-format ../../../flutter/third_party/angle/.git ../../../flutter/third_party/angle/.gitattributes @@ -3506,7 +3507,6 @@ ../../../fuchsia/sdk/linux/version_history.json ../../../out ../../../third_party/android_embedding_dependencies -../../../third_party/android_tools ../../../third_party/gradle ../../../third_party/java ../../../third_party/libcxx/.clang-format From ca8ea3815b58b339c6e084ce2843a94ff2112948 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 6 May 2024 19:16:59 +0000 Subject: [PATCH 6/8] roll buildroot --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 3764a36b161f9..47834fff54f87 100644 --- a/DEPS +++ b/DEPS @@ -277,7 +277,7 @@ allowed_hosts = [ ] deps = { - 'src': 'https://github.com/flutter/buildroot.git' + '@' + '915f67999bfb4eb77cf596bbadacdce7868ede49', + 'src': 'https://github.com/flutter/buildroot.git' + '@' + 'c5f0206b6fd70a85a41718f0bc6481b7c5348026', 'src/flutter/third_party/depot_tools': Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '580b4ff3f5cd0dcaa2eacda28cefe0f45320e8f7', From 3d8561986e1bb5bc4c7dfe52d7fa5d76b9b2a2f3 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 6 May 2024 19:27:45 +0000 Subject: [PATCH 7/8] licenses --- tools/licenses/lib/paths.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/licenses/lib/paths.dart b/tools/licenses/lib/paths.dart index fe0e22c03d1f4..65aa3a2200a13 100644 --- a/tools/licenses/lib/paths.dart +++ b/tools/licenses/lib/paths.dart @@ -31,6 +31,7 @@ final Set skippedPaths = { r'flutter/lib/web_ui/dev', // these are build tools; they do not end up in Engine artifacts r'flutter/prebuilts', r'flutter/sky/packages/sky_engine/LICENSE', + r'flutter/third_party/android_tools', // excluded on advice r'flutter/third_party/angle/android', r'flutter/third_party/angle/doc', r'flutter/third_party/angle/extensions', From 452326042977de15c3c711dc9a69c7a808fe5502 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Mon, 6 May 2024 19:54:46 +0000 Subject: [PATCH 8/8] dart licenses and license tool signature --- ci/licenses_golden/licenses_dart | 2 +- ci/licenses_golden/tool_signature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/licenses_golden/licenses_dart b/ci/licenses_golden/licenses_dart index cc07f77b1bc34..56ada58ec70d2 100644 --- a/ci/licenses_golden/licenses_dart +++ b/ci/licenses_golden/licenses_dart @@ -4741,7 +4741,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. -You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/33bb0f4b07706af716be119d53dcb085ffbb1e52 +You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/a9cf6a411c717916c4a170fcf7f6836a93a8ea04 /third_party/fallback_root_certificates/ ==================================================================================================== diff --git a/ci/licenses_golden/tool_signature b/ci/licenses_golden/tool_signature index 9be17177f971e..37298fe8e1d00 100644 --- a/ci/licenses_golden/tool_signature +++ b/ci/licenses_golden/tool_signature @@ -1,2 +1,2 @@ -Signature: 95c63dc7dfaf942506f787b7127d83e5 +Signature: 45060fc168827cc21ff447884cf86d9d