Skip to content

Commit

Permalink
Update shared/shared.podspec
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-magda committed Jul 5, 2024
1 parent de91cb6 commit e338370
Showing 1 changed file with 23 additions and 36 deletions.
59 changes: 23 additions & 36 deletions shared/shared.podspec
Original file line number Diff line number Diff line change
@@ -1,38 +1,26 @@
Pod::Spec.new do |spec|
spec.name = 'shared'
spec.version = '1.0'
spec.homepage = 'https://github.com/hyperskill/mobile-app'
spec.source = { :http=> ''}
spec.authors = ''
spec.license = ''
spec.summary = 'Shared code between iOS and Android'
spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework'
spec.libraries = 'c++'
spec.ios.deployment_target = '14.0'


if !Dir.exist?('build/cocoapods/framework/shared.framework') || Dir.empty?('build/cocoapods/framework/shared.framework')
raise "
spec.name = "shared"
spec.version = "1.0"
spec.homepage = "https://github.com/hyperskill/mobile-app"
spec.source = { :http => "" }
spec.authors = ""
spec.license = ""
spec.summary = "Shared code between iOS and Android"
spec.vendored_frameworks = "build/cocoapods/framework/shared.framework"
spec.libraries = "c++"
spec.ios.deployment_target = "14.0"

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:
spec.pod_target_xcconfig = {
"KOTLIN_PROJECT_PATH" => ":shared",
"PRODUCT_MODULE_NAME" => "shared",
}

./gradlew :shared: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' => ':shared',
'PRODUCT_MODULE_NAME' => 'shared',
}

spec.script_phases = [
{
:name => 'Build shared',
:execution_position => :before_compile,
:shell_path => '/bin/sh',
:script => <<-SCRIPT
spec.script_phases = [
{
:name => "Build shared",
: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
Expand All @@ -44,7 +32,6 @@ Pod::Spec.new do |spec|
-Pkotlin.native.cocoapods.archs="$ARCHS" \
-Pkotlin.native.cocoapods.configuration="$CONFIGURATION"
SCRIPT
}
]

end
},
]
end

0 comments on commit e338370

Please sign in to comment.