From 17de7fce747403eac1a2d01949f5c45541b857b7 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Wed, 9 Oct 2024 12:40:06 -0700 Subject: [PATCH] [Impeller] Publish Impeller SDK artifacts. Fixes https://github.com/flutter/flutter/issues/156358 --- BUILD.gn | 2 +- ci/builders/linux_android_debug_engine.json | 16 +++++-- ci/builders/linux_host_engine.json | 4 +- ci/builders/mac_host_engine.json | 8 +++- ci/builders/windows_host_engine.json | 4 +- impeller/toolkit/interop/BUILD.gn | 46 +++++++++++++++++++++ 6 files changed, 71 insertions(+), 9 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index bb2ab9ba0f534..429dfa3202121 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -155,7 +155,7 @@ group("flutter") { # Build the standalone Impeller library. if (is_mac || is_linux || is_win || is_android) { - public_deps += [ "//flutter/impeller/toolkit/interop:library" ] + public_deps += [ "//flutter/impeller/toolkit/interop:sdk" ] } if ((flutter_runtime_mode == "debug" || flutter_runtime_mode == "profile") && diff --git a/ci/builders/linux_android_debug_engine.json b/ci/builders/linux_android_debug_engine.json index 38b24106cc43f..9dc92cbcf6a98 100644 --- a/ci/builders/linux_android_debug_engine.json +++ b/ci/builders/linux_android_debug_engine.json @@ -56,6 +56,7 @@ "base_path": "out/ci/android_debug/zip_archives/", "include_paths": [ "out/ci/android_debug/zip_archives/android-arm/artifacts.zip", + "out/ci/android_debug/zip_archives/android-arm/impeller_sdk.zip", "out/ci/android_debug/zip_archives/android-arm/symbols.zip", "out/ci/android_debug/zip_archives/download.flutter.io", "out/ci/android_debug/zip_archives/sky_engine.zip", @@ -90,7 +91,8 @@ "flutter/sky/dist:zip_old_location", "flutter/lib/gpu/dist:zip_old_location", "flutter/shell/platform/android:embedding_jars", - "flutter/shell/platform/android:abi_jars" + "flutter/shell/platform/android:abi_jars", + "flutter/impeller/toolkit/interop:sdk" ] } }, @@ -102,6 +104,7 @@ "base_path": "out/ci/android_debug_arm64/zip_archives/", "include_paths": [ "out/ci/android_debug_arm64/zip_archives/android-arm64/artifacts.zip", + "out/ci/android_debug_arm64/zip_archives/android-arm64/impeller_sdk.zip", "out/ci/android_debug_arm64/zip_archives/android-arm64/symbols.zip", "out/ci/android_debug_arm64/zip_archives/download.flutter.io" ], @@ -130,7 +133,8 @@ "config": "ci/android_debug_arm64", "targets": [ "flutter", - "flutter/shell/platform/android:abi_jars" + "flutter/shell/platform/android:abi_jars", + "flutter/impeller/toolkit/interop:sdk" ] } }, @@ -142,6 +146,7 @@ "base_path": "out/ci/android_debug_x86/zip_archives/", "include_paths": [ "out/ci/android_debug_x86/zip_archives/android-x86/artifacts.zip", + "out/ci/android_debug_x86/zip_archives/android-x86/impeller_sdk.zip", "out/ci/android_debug_x86/zip_archives/android-x86/symbols.zip", "out/ci/android_debug_x86/zip_archives/download.flutter.io" ], @@ -170,7 +175,8 @@ "config": "ci/android_debug_x86", "targets": [ "flutter", - "flutter/shell/platform/android:abi_jars" + "flutter/shell/platform/android:abi_jars", + "flutter/impeller/toolkit/interop:sdk" ] } }, @@ -182,6 +188,7 @@ "base_path": "out/ci/android_debug_x64/zip_archives/", "include_paths": [ "out/ci/android_debug_x64/zip_archives/android-x64/artifacts.zip", + "out/ci/android_debug_x64/zip_archives/android-x64/impeller_sdk.zip", "out/ci/android_debug_x64/zip_archives/android-x64/symbols.zip", "out/ci/android_debug_x64/zip_archives/download.flutter.io" ], @@ -210,7 +217,8 @@ "config": "ci/android_debug_x64", "targets": [ "flutter", - "flutter/shell/platform/android:abi_jars" + "flutter/shell/platform/android:abi_jars", + "flutter/impeller/toolkit/interop:sdk" ] } } diff --git a/ci/builders/linux_host_engine.json b/ci/builders/linux_host_engine.json index 3870ea1b7614b..1678a10d6bbc0 100644 --- a/ci/builders/linux_host_engine.json +++ b/ci/builders/linux_host_engine.json @@ -16,6 +16,7 @@ "type": "gcs", "include_paths": [ "out/ci/host_debug/zip_archives/linux-x64/artifacts.zip", + "out/ci/host_debug/zip_archives/linux-x64/impeller_sdk.zip", "out/ci/host_debug/zip_archives/linux-x64/linux-x64-embedder.zip", "out/ci/host_debug/zip_archives/linux-x64/font-subset.zip", "out/ci/host_debug/zip_archives/flutter_patched_sdk.zip", @@ -54,7 +55,8 @@ "flutter/build/archives:embedder", "flutter/build/archives:flutter_patched_sdk", "flutter/build/dart:copy_dart_sdk", - "flutter/tools/font_subset" + "flutter/tools/font_subset", + "flutter/impeller/toolkit/interop:sdk" ] }, "tests": [ diff --git a/ci/builders/mac_host_engine.json b/ci/builders/mac_host_engine.json index 169a86c94be47..0331885d8755e 100644 --- a/ci/builders/mac_host_engine.json +++ b/ci/builders/mac_host_engine.json @@ -72,6 +72,7 @@ "type": "gcs", "include_paths": [ "out/ci/host_debug/zip_archives/darwin-x64/artifacts.zip", + "out/ci/host_debug/zip_archives/darwin-x64/impeller_sdk.zip", "out/ci/host_debug/zip_archives/dart-sdk-darwin-x64.zip" ], "name": "ci/host_debug", @@ -108,7 +109,8 @@ "config": "ci/host_debug", "targets": [ "flutter/build/archives:artifacts", - "flutter/build/archives:dart_sdk_archive" + "flutter/build/archives:dart_sdk_archive", + "flutter/impeller/toolkit/interop:sdk" ] }, "postsubmit_overrides": { @@ -529,6 +531,7 @@ "type": "gcs", "include_paths": [ "out/ci/mac_debug_arm64/zip_archives/darwin-arm64/artifacts.zip", + "out/ci/mac_debug_arm64/zip_archives/darwin-arm64/impeller_sdk.zip", "out/ci/mac_debug_arm64/zip_archives/dart-sdk-darwin-arm64.zip" ], "name": "ci/mac_debug_arm64", @@ -565,7 +568,8 @@ "config": "ci/mac_debug_arm64", "targets": [ "flutter/build/archives:artifacts", - "flutter/build/archives:dart_sdk_archive" + "flutter/build/archives:dart_sdk_archive", + "flutter/impeller/toolkit/interop:sdk" ] }, "postsubmit_overrides": { diff --git a/ci/builders/windows_host_engine.json b/ci/builders/windows_host_engine.json index f5bc93dc6e866..ef6b285c56a8c 100644 --- a/ci/builders/windows_host_engine.json +++ b/ci/builders/windows_host_engine.json @@ -7,6 +7,7 @@ "type": "gcs", "include_paths": [ "out/ci/host_debug/zip_archives/windows-x64/artifacts.zip", + "out/ci/host_debug/zip_archives/windows-x64/impeller_sdk.zip", "out/ci/host_debug/zip_archives/windows-x64/windows-x64-embedder.zip", "out/ci/host_debug/zip_archives/windows-x64/font-subset.zip", "out/ci/host_debug/zip_archives/dart-sdk-windows-x64.zip", @@ -46,7 +47,8 @@ "flutter/tools/font_subset", "flutter/build/archives:dart_sdk_archive", "flutter/shell/platform/windows/client_wrapper:client_wrapper_archive", - "flutter/build/archives:windows_flutter" + "flutter/build/archives:windows_flutter", + "flutter/impeller/toolkit/interop:sdk" ] }, "tests": [ diff --git a/impeller/toolkit/interop/BUILD.gn b/impeller/toolkit/interop/BUILD.gn index 59a6c816b2da6..3cfe8441c4fc9 100644 --- a/impeller/toolkit/interop/BUILD.gn +++ b/impeller/toolkit/interop/BUILD.gn @@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//flutter/build/zip_bundle.gni") import("//flutter/impeller/tools/impeller.gni") embed_blob("embedded_icu_data") { @@ -106,3 +107,48 @@ impeller_component("interop_unittests") { "//flutter/testing:testing_lib", ] } + +zip_bundle("sdk") { + if (is_mac) { + zip_out_dir = "darwin-${target_cpu}" + } else { + zip_out_dir = "${full_target_platform_name}" + } + + output = "${zip_out_dir}/impeller_sdk.zip" + deps = [ ":library" ] + + files = [ + { + source = "impeller.h" + destination = "include/impeller.h" + }, + ] + + if (is_mac) { + files += [ + { + source = "$root_build_dir/libimpeller.dylib" + destination = "lib/libimpeller.dylib" + }, + ] + } else if (is_linux || is_android) { + files += [ + { + source = "$root_build_dir/libimpeller.so" + destination = "lib/libimpeller.so" + }, + ] + } else if (is_win) { + files += [ + { + source = "$root_build_dir/impeller.dll" + destination = "lib/impeller.dll" + }, + { + source = "$root_build_dir/impeller.dll.lib" + destination = "lib/impeller.dll.lib" + }, + ] + } +}