-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix resources with cocoapods integration (#4783)
The PR sets a static path to the compose resources for the cocoapods integration because there maybe only one integration framework for a gradle module. Fixes #4720 ## Release Notes ### Fixes - Resources - _(prerelease fix)_ Fix resources with cocoapods integration
- Loading branch information
Showing
3 changed files
with
67 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...le-plugins/compose/src/test/test-projects/misc/iosResources/expected/iosResources.podspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Pod::Spec.new do |spec| | ||
spec.name = 'iosResources' | ||
spec.version = '1.0' | ||
spec.homepage = 'Link to a Kotlin/Native module homepage' | ||
spec.source = { :http=> ''} | ||
spec.authors = '' | ||
spec.license = '' | ||
spec.summary = 'Some description for a Kotlin/Native module' | ||
spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework' | ||
spec.libraries = 'c++' | ||
|
||
spec.dependency 'Base64', '1.1.2' | ||
|
||
if !Dir.exist?('build/cocoapods/framework/shared.framework') || Dir.empty?('build/cocoapods/framework/shared.framework') | ||
raise " | ||
Kotlin framework 'shared' doesn't exist yet, so a proper Xcode project can't be generated. | ||
'pod install' should be executed after running ':generateDummyFramework' Gradle task: | ||
./gradlew :generateDummyFramework | ||
Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)" | ||
end | ||
|
||
spec.pod_target_xcconfig = { | ||
'KOTLIN_PROJECT_PATH' => '', | ||
'PRODUCT_MODULE_NAME' => 'shared', | ||
} | ||
|
||
spec.script_phases = [ | ||
{ | ||
:name => 'Build iosResources', | ||
:execution_position => :before_compile, | ||
:shell_path => '/bin/sh', | ||
:script => <<-SCRIPT | ||
if [ "YES" = "$OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED" ]; then | ||
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\"" | ||
exit 0 | ||
fi | ||
set -ev | ||
REPO_ROOT="$PODS_TARGET_SRCROOT" | ||
"$REPO_ROOT/gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \ | ||
-Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \ | ||
-Pkotlin.native.cocoapods.archs="$ARCHS" \ | ||
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION" | ||
SCRIPT | ||
} | ||
] | ||
spec.resources = ['build/compose/cocoapods/compose-resources'] | ||
end |