-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69cdbdf
commit be25713
Showing
6 changed files
with
125 additions
and
16 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
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 |
---|---|---|
@@ -1,9 +1,18 @@ | ||
import co.touchlab.skie.configuration.FlowInterop | ||
import co.touchlab.skie.configuration.EnumInterop | ||
|
||
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed | ||
plugins { | ||
alias(libs.plugins.kotlin.multiplatform) | ||
alias(libs.plugins.org.jetbrains.kotlin.native.cocoapods) | ||
alias(libs.plugins.com.android.library) | ||
alias(libs.plugins.kmm.bridge) | ||
alias(libs.plugins.skie) | ||
`maven-publish` | ||
} | ||
|
||
version = "0.1" | ||
|
||
kotlin { | ||
androidTarget { | ||
compilations.all { | ||
|
@@ -12,36 +21,52 @@ kotlin { | |
} | ||
} | ||
} | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { | ||
it.binaries.framework { | ||
baseName = "shared" | ||
isStatic = true | ||
} | ||
} | ||
|
||
iosX64() | ||
iosArm64() | ||
iosSimulatorArm64() | ||
|
||
sourceSets { | ||
commonMain.dependencies { | ||
// Koin | ||
implementation(libs.koin) | ||
|
||
// Shared Core Network Module | ||
implementation(project(":shared:core-network")) | ||
api(project(":shared:core-network")) | ||
|
||
// Shared Core Preferences Module | ||
implementation(project(":shared:core-preferences")) | ||
api(project(":shared:core-preferences")) | ||
|
||
// Shared Core Logger Module | ||
implementation(project(":shared:core-logger")) | ||
api(project(":shared:core-logger")) | ||
} | ||
commonTest.dependencies { | ||
implementation(libs.kotlin.test) | ||
} | ||
} | ||
|
||
cocoapods { | ||
summary = "Spotify Kmp Shared Binary" | ||
homepage = "https://github.com/AshuTyagi16/Spotify-KMP" | ||
ios.deploymentTarget = "13.5" | ||
extraSpecAttributes["libraries"] = "'c++', 'sqlite3'" | ||
license = "BSD" | ||
extraSpecAttributes["swift_version"] = "\"5.9.2\"" | ||
framework { | ||
// Shared Core Network Module | ||
export(project(":shared:core-network")) | ||
|
||
// Shared Core Preferences Module | ||
export(project(":shared:core-preferences")) | ||
|
||
// Shared Core Logger Module | ||
export(project(":shared:core-logger")) | ||
|
||
isStatic = true | ||
|
||
binaryOption("bundleId", "com.spotify.app.shared") | ||
} | ||
} | ||
} | ||
|
||
android { | ||
|
@@ -51,3 +76,19 @@ android { | |
minSdk = libs.versions.minSdkVersion.get().toInt() | ||
} | ||
} | ||
|
||
kmmbridge { | ||
mavenPublishArtifacts() | ||
spm() | ||
cocoapods("[email protected]:AshuTyagi16/SpotifyKmpPodspec.git") | ||
} | ||
|
||
skie { | ||
features { | ||
group { | ||
FlowInterop.Enabled(true) | ||
coroutinesInterop.set(true) | ||
EnumInterop.Enabled(true) | ||
} | ||
} | ||
} |
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
11 changes: 10 additions & 1 deletion
11
...rk/src/commonMain/kotlin/com/spotify/app/core_network/shared/impl/util/NetworkEventBus.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Pod::Spec.new do |spec| | ||
spec.name = 'shared' | ||
spec.version = '0.1' | ||
spec.homepage = 'https://github.com/AshuTyagi16/Spotify-KMP' | ||
spec.source = { :http=> ''} | ||
spec.authors = '' | ||
spec.license = 'BSD' | ||
spec.summary = 'Spotify Kmp Shared Binary' | ||
spec.vendored_frameworks = 'build/cocoapods/framework/shared.framework' | ||
|
||
spec.ios.deployment_target = '13.5' | ||
|
||
|
||
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 :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 | ||
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.libraries = 'c++', 'sqlite3' | ||
spec.swift_version = "5.9.2" | ||
end |