diff --git a/.gitignore b/.gitignore index 5017aaa9..50c0f63c 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ app-iOS/Pods app-iOS/app-iOS.xcodeproj/* app-iOS/app-iOS.xcworkspace/* *.plist +.kotlin/ \ No newline at end of file diff --git a/app-android/build.gradle.kts b/app-android/build.gradle.kts index b1254c85..c93c6891 100644 --- a/app-android/build.gradle.kts +++ b/app-android/build.gradle.kts @@ -1,6 +1,9 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { alias(libs.plugins.android.application) alias(libs.plugins.android.kotlin) + alias(libs.plugins.compose.compiler) } android { @@ -30,20 +33,22 @@ android { ) } } + + buildFeatures { + compose = true + } + compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_17.toString() - } - buildFeatures { - compose = true - } - composeOptions { - kotlinCompilerExtensionVersion = "1.5.7" + kotlin { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_17) + } } + packagingOptions { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" diff --git a/app-desktop/build.gradle.kts b/app-desktop/build.gradle.kts index e9bc8e48..a81edb8c 100644 --- a/app-desktop/build.gradle.kts +++ b/app-desktop/build.gradle.kts @@ -1,6 +1,7 @@ plugins { alias(libs.plugins.jvm) alias(libs.plugins.compose) + alias(libs.plugins.compose.compiler) } repositories { diff --git a/build.gradle.kts b/build.gradle.kts index 1656a8b1..eeb43f99 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,6 +5,7 @@ plugins { alias(libs.plugins.multiplatform) apply false alias(libs.plugins.jvm) apply false alias(libs.plugins.nativeCocoapod) apply false + alias(libs.plugins.compose.compiler) apply false alias(libs.plugins.ktLint) alias(libs.plugins.detekt) diff --git a/daraja/build.gradle.kts b/daraja/build.gradle.kts index f5e9dcda..b69f86f6 100644 --- a/daraja/build.gradle.kts +++ b/daraja/build.gradle.kts @@ -46,6 +46,10 @@ kotlin { iosArm64() iosSimulatorArm64() + jvm() + + // js() + cocoapods { summary = "Daraja API Swift Wrapper built using Kotlin Multiplatform" homepage = "https://github.com/VictorKabata/DarajaMultiplatform.git" @@ -57,10 +61,6 @@ kotlin { } } - jvm() - - // js() - sourceSets { sourceSets["commonMain"].dependencies { implementation(libs.kotlinX.coroutines) @@ -104,9 +104,9 @@ kotlin { } android { - compileSdk = 33 defaultConfig { minSdk = 21 + compileSdk = 34 } namespace = "com.vickikbt.darajakmp" @@ -121,12 +121,12 @@ android { getByName("debug") {} getByName("release") { - isMinifyEnabled = false + isMinifyEnabled = true } } } -tasks.withType { +tasks.named("dependencyUpdates").configure { rejectVersionIf { isNonStable(candidate.version) && !isNonStable(currentVersion) } checkForGradleUpdate = true @@ -151,11 +151,18 @@ val javadocJar = tasks.register("javadocJar") { from(dokkaOutputDir) } -koverReport { - verify { - rule { - isEnabled = false - bound { minValue = 20 } +kover { + reports { + verify { + rule { + minBound(30) + } + } + + filters { + excludes { + classes("*BuildConfig") + } } } } @@ -245,7 +252,3 @@ multiplatformSwiftPackage { kotlin.sourceSets.all { languageSettings.optIn("kotlin.experimental.ExperimentalObjCName") } - -task("testClasses").doLast { - println("This is a dummy testClasses task") -} diff --git a/daraja/daraja.podspec b/daraja/daraja.podspec index 0e10d72d..a329e110 100644 --- a/daraja/daraja.podspec +++ b/daraja/daraja.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |spec| spec.summary = 'Daraja API Swift Wrapper built using Kotlin Multiplatform' spec.vendored_frameworks = 'build/cocoapods/framework/DarajaMultiplatform.framework' spec.libraries = 'c++' - spec.ios.deployment_target = '14.1' + spec.ios.deployment_target = '14.1' if !Dir.exist?('build/cocoapods/framework/DarajaMultiplatform.framework') || Dir.empty?('build/cocoapods/framework/DarajaMultiplatform.framework') @@ -22,6 +22,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' => ':daraja', 'PRODUCT_MODULE_NAME' => 'DarajaMultiplatform', diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e9cf3c40..b9d2aedb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,25 +1,24 @@ [versions] -kotlin = "1.9.21" -gradle = "7.4.1" +kotlin = "2.0.0" +agp = "7.4.2" ktLint = "11.6.0" detekt = "1.19.0" spotless = "6.2.2" -nativeCocoapod = "1.9.0" -dokka = "1.9.10" -kover = "0.7.5" +dokka = "1.9.20" +kover = "0.8.1" mulitplatformSwiftPackage = "2.0.3" -gradleVersionUpdate = "0.50.0" +gradleVersionUpdate = "0.51.0" # Kotlin Multiplatform Version -kotlinxCoroutines = "1.7.3" -kotlinxSerializationJson = "1.6.2" -kotlinxDateTime = "0.5.0" -napier = "2.6.1" -ktor = "2.3.7" +kotlinxCoroutines = "1.9.0-RC" +kotlinxSerializationJson = "1.7.0" +kotlinxDateTime = "0.6.0" +napier = "2.7.1" +ktor = "2.3.11" kotlinxTestResources = "0.2.2" -composeMultiplatform = "1.5.11" -cache4k = "0.11.0" # 0.12.0 breaks build -mockative = "2.0.1" +composeMultiplatform = "1.6.11" +cache4k = "0.13.0" +mockative = "2.2.2" [plugins] ktLint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktLint" } @@ -28,8 +27,8 @@ spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } nativeCocoapod = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" } android-kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -android-library = { id = "com.android.library", version.ref = "gradle" } -android-application = { id = "com.android.application", version.ref = "gradle" } +android-library = { id = "com.android.library", version.ref = "agp" } +android-application = { id = "com.android.application", version.ref = "agp" } jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlinX-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } @@ -38,6 +37,7 @@ multiplatformSwiftPackage = { id = "com.chromaticnoise.multiplatform-swiftpackag gradleVersionUpdate = { id = "com.github.ben-manes.versions", version.ref = "gradleVersionUpdate" } compose = { id = "org.jetbrains.compose", version.ref = "composeMultiplatform" } +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } [libraries] #Kotlin Multiplatform Lib Dependencies @@ -59,4 +59,4 @@ cache4k = { module = "io.github.reactivecircus.cache4k:cache4k", version.ref = " #Tests Lib Dependencies # kotlinX-testResources = { module = "com.goncalossilva:resources", version.ref = "kotlinxTestResources" } kotlinX-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" } -mockative={module="io.mockative:mockative", version.ref="mockative"} \ No newline at end of file +mockative = { module = "io.mockative:mockative", version.ref = "mockative" } \ No newline at end of file