Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #14

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions core/SPMobileCore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Pod::Spec.new do |spec|
spec.summary = 'The internal Network & Data layers used by our mobile SDKs'
spec.vendored_frameworks = 'build/cocoapods/framework/SPMobileCore.framework'
spec.libraries = 'c++'
spec.ios.deployment_target = '10.0'
spec.tvos.deployment_target = '10.0'
spec.ios.deployment_target = '10.0'
spec.tvos.deployment_target = '10.0'


if !Dir.exist?('build/cocoapods/framework/SPMobileCore.framework') || Dir.empty?('build/cocoapods/framework/SPMobileCore.framework')
Expand All @@ -23,6 +23,10 @@ Pod::Spec.new do |spec|
Alternatively, proper pod installation is performed during Gradle sync in the IDE (if Podfile location is set)"
end

spec.xcconfig = {
'ENABLE_USER_SCRIPT_SANDBOXING' => 'NO',
}

spec.pod_target_xcconfig = {
'KOTLIN_PROJECT_PATH' => ':core',
'PRODUCT_MODULE_NAME' => 'SPMobileCore',
Expand Down
24 changes: 11 additions & 13 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTes
import java.io.ByteArrayOutputStream

plugins {
kotlin("multiplatform") version "1.9.25"
kotlin("native.cocoapods") version "1.9.25"
kotlin("plugin.serialization") version "1.9.25"
kotlin("multiplatform") version "2.0.21"
kotlin("native.cocoapods") version "2.0.21"
kotlin("plugin.serialization") version "2.0.21"
id("com.github.ben-manes.versions") version "0.51.0"
id("com.android.library") version "8.3.2"
id("com.github.gmazzo.buildconfig") version "5.3.5"
id("com.android.library") version "8.7.1"
id("com.github.gmazzo.buildconfig") version "5.5.0"
id("maven-publish")
id("signing")
}
Expand Down Expand Up @@ -35,10 +35,8 @@ kotlin {

androidTarget {
publishLibraryVariants("release", "debug")
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8)
}
}
iosX64()
Expand Down Expand Up @@ -66,10 +64,10 @@ kotlin {
}

sourceSets {
val ktorVersion = "2.3.12"
val coroutinesVersion = "1.8.1"
val settingsVersion = "1.1.1"
val dataTimeVersion = "0.6.0"
val ktorVersion = "3.0.0"
val coroutinesVersion = "1.9.0"
val settingsVersion = "1.2.0"
val dataTimeVersion = "0.6.1"
val commonMain by getting {
dependencies {
implementation("com.russhwolf:multiplatform-settings-no-arg:$settingsVersion")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.sourcepoint.mobile_core

import android.os.Build

actual class DeviceInformationConcrete actual constructor() : DeviceInformation {
override val osName: OSName = OSName.Android
override val osVersion = Build.VERSION.SDK_INT.toString()
override val deviceFamily = Build.MODEL ?: "model-unknown"
actual class DeviceInformation actual constructor() {
actual val osName: OSName = OSName.Android
actual val osVersion = Build.VERSION.SDK_INT.toString()
actual val deviceFamily = Build.MODEL ?: "model-unknown"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ enum class OSName {
Android
}

interface DeviceInformation {
expect class DeviceInformation() {
val osName: OSName
val osVersion: String
val deviceFamily: String
}

expect class DeviceInformationConcrete(): DeviceInformation

val Device = DeviceInformationConcrete()
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.sourcepoint.mobile_core.network

import com.sourcepoint.core.BuildConfig
import com.sourcepoint.mobile_core.Device
import com.sourcepoint.mobile_core.DeviceInformation
import com.sourcepoint.mobile_core.models.SPError
import com.sourcepoint.mobile_core.models.SPNetworkError
Expand Down Expand Up @@ -88,14 +87,14 @@ class SourcepointClient(
expectSuccess = false
HttpResponseValidator {
validateResponse { response ->
if (response.request.url.pathSegments.contains("custom-metrics")) {
if (response.request.url.segments.contains("custom-metrics")) {
return@validateResponse
}

if (response.status.value !in 200..299) {
throw reportErrorAndThrow(SPNetworkError(
statusCode = response.status.value,
path = response.request.url.pathSegments.last(),
path = response.request.url.segments.last(),
campaignType = null
))
}
Expand All @@ -114,7 +113,7 @@ class SourcepointClient(
propertyId,
propertyName,
httpEngine = null,
device = Device,
device = DeviceInformation(),
version = BuildConfig.Version,
requestTimeoutInSeconds = requestTimeoutInSeconds
)
Expand All @@ -130,7 +129,7 @@ class SourcepointClient(
propertyId,
propertyName,
httpEngine = httpEngine,
device = Device,
device = DeviceInformation(),
version = BuildConfig.Version,
requestTimeoutInSeconds = requestTimeoutInSeconds
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.sourcepoint.mobile_core.network.requests

import com.sourcepoint.core.BuildConfig
import com.sourcepoint.mobile_core.Device
import com.sourcepoint.mobile_core.DeviceInformation
import kotlinx.serialization.Serializable

@Suppress("unused") // properties are used in every request inheriting from DefaultRequest
@Serializable
open class DefaultRequest {
val env = "prod"
val scriptType = "mobile-core-${Device.osName.name}"
val scriptType = "mobile-core-${DeviceInformation().osName.name}"
val scriptVersion = BuildConfig.Version
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.sourcepoint.mobile_core

import platform.UIKit.UIDevice

actual class DeviceInformationConcrete actual constructor() : DeviceInformation {
override val osName = OSName.iOS
override val osVersion = UIDevice.currentDevice.systemVersion
override val deviceFamily = UIDevice.currentDevice.name
actual class DeviceInformation actual constructor() {
actual val osName = OSName.iOS
actual val osVersion = UIDevice.currentDevice.systemVersion
actual val deviceFamily = UIDevice.currentDevice.name
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.sourcepoint.mobile_core

import platform.UIKit.UIDevice

actual class DeviceInformationConcrete actual constructor() : DeviceInformation {
override val osName: OSName = OSName.tvOS
override val osVersion: String = UIDevice.currentDevice.systemVersion
override val deviceFamily = UIDevice.currentDevice.name
actual class DeviceInformation actual constructor() {
actual val osName: OSName = OSName.tvOS
actual val osVersion: String = UIDevice.currentDevice.systemVersion
actual val deviceFamily = UIDevice.currentDevice.name
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Oct 15 15:32:09 CEST 2023
#Thu Oct 17 10:14:38 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists