Skip to content

Commit f60aded

Browse files
committed
Merge commit '7d58f977aac11ade2399057db2e9fab152dfad45'
2 parents d663ced + 7d58f97 commit f60aded

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

super_native_extensions/cargokit/.github/workflows/test_example_plugin_build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ jobs:
7777
shell: bash
7878
working-directory: ${{ env.EXAMPLE_DIR }}
7979
run: |
80-
export JAVA_HOME=$JAVA_HOME_11_X64
80+
if [[ $(sysctl hw.optional.arm64) == *"hw.optional.arm64: 1"* ]]; then
81+
export JAVA_HOME=$JAVA_HOME_17_arm64
82+
else
83+
export JAVA_HOME=$JAVA_HOME_11_X64
84+
fi
8185
flutter build apk --${{ matrix.build_mode }} -v
8286

super_native_extensions/cargokit/build_pod.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ do
4949
fi
5050
done
5151

52-
"$BASEDIR/run_build_tool.sh" build-pod "$@"
52+
sh "$BASEDIR/run_build_tool.sh" build-pod "$@"
5353

5454
# Make a symlink from built framework to phony file, which will be used as input to
5555
# build script. This should force rebuild (podspec currently doesn't support alwaysOutOfDate

super_native_extensions/cargokit/cmake/cargokit.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function(apply_cargokit target manifest_dir lib_name any_symbol_name)
5050
else()
5151
set(SCRIPT_EXTENSION ".sh")
5252
set(IMPORT_LIB_EXTENSION "")
53+
execute_process(COMMAND chmod +x "${cargokit_cmake_root}/run_build_tool${SCRIPT_EXTENSION}")
5354
endif()
5455

5556
# Using generators in custom command is only supported in CMake 3.20+
@@ -75,6 +76,7 @@ function(apply_cargokit target manifest_dir lib_name any_symbol_name)
7576
)
7677
endif()
7778

79+
7880
set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/_phony_" PROPERTIES SYMBOLIC TRUE)
7981

8082
if (TARGET ${target})
@@ -94,4 +96,4 @@ function(apply_cargokit target manifest_dir lib_name any_symbol_name)
9496
# Allow adding the output library to plugin bundled libraries
9597
set("${target}_cargokit_lib" ${OUTPUT_LIB} PARENT_SCOPE)
9698

97-
endfunction()
99+
endfunction()

super_native_extensions/cargokit/gradle/plugin.gradle

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ abstract class CargoKitBuildTask extends DefaultTask {
5555
def manifestDir = Paths.get(project.buildscript.sourceFile.parent, project.cargokit.manifestDir)
5656

5757
def rootProjectDir = project.rootProject.projectDir
58-
58+
59+
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
60+
project.exec {
61+
commandLine 'chmod', '+x', path
62+
}
63+
}
64+
5965
project.exec {
6066
executable path
6167
args "build-gradle"
@@ -110,8 +116,12 @@ class CargoKitPlugin implements Plugin<Project> {
110116
}
111117

112118
def cargoBuildDir = "${project.buildDir}/build"
119+
120+
// Determine if the project is an application or library
121+
def isApplication = plugin.project.plugins.hasPlugin('com.android.application')
122+
def variants = isApplication ? plugin.project.android.applicationVariants : plugin.project.android.libraryVariants
113123

114-
plugin.project.android.applicationVariants.all { variant ->
124+
variants.all { variant ->
115125

116126
final buildType = variant.buildType.name
117127

0 commit comments

Comments
 (0)