diff --git a/.github/workflows/test_example_plugin_build.yml b/.github/workflows/test_example_plugin_build.yml index bf36e862..4fb0252d 100644 --- a/.github/workflows/test_example_plugin_build.yml +++ b/.github/workflows/test_example_plugin_build.yml @@ -77,6 +77,10 @@ jobs: shell: bash working-directory: ${{ env.EXAMPLE_DIR }} run: | - export JAVA_HOME=$JAVA_HOME_11_X64 + if [[ $(sysctl hw.optional.arm64) == *"hw.optional.arm64: 1"* ]]; then + export JAVA_HOME=$JAVA_HOME_17_arm64 + else + export JAVA_HOME=$JAVA_HOME_11_X64 + fi flutter build apk --${{ matrix.build_mode }} -v diff --git a/gradle/plugin.gradle b/gradle/plugin.gradle index 12c49f11..37dd086a 100644 --- a/gradle/plugin.gradle +++ b/gradle/plugin.gradle @@ -116,8 +116,12 @@ class CargoKitPlugin implements Plugin { } def cargoBuildDir = "${project.buildDir}/build" + + // Determine if the project is an application or library + def isApplication = plugin.project.plugins.hasPlugin('com.android.application') + def variants = isApplication ? plugin.project.android.applicationVariants : plugin.project.android.libraryVariants - plugin.project.android.applicationVariants.all { variant -> + variants.all { variant -> final buildType = variant.buildType.name