Skip to content

Commit

Permalink
Update sample code to use latest configcat-kotlin-sdk version. (#42)
Browse files Browse the repository at this point in the history
* Update samples code to use latest configcat-kotlin-sdk version.

* ios sample app update

---------

Co-authored-by: Peter Csajtai <[email protected]>
  • Loading branch information
novalisdenahi and z4kn4fein authored Nov 6, 2024
1 parent fb85212 commit 9ccc532
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 36 deletions.
15 changes: 10 additions & 5 deletions samples/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
namespace 'com.example.configcat_android'
compileSdk 33
compileSdk 34

defaultConfig {
applicationId "com.example.configcat_android"
minSdk 21
targetSdk 33
//noinspection EditedTargetSdkVersion
targetSdk 34
versionCode 1
versionName "1.0"

Expand All @@ -27,13 +30,15 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
kotlin {
compilerOptions{
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
}

dependencies {
implementation 'com.configcat:configcat-kotlin-client:3.0.0'
implementation 'com.configcat:configcat-kotlin-client:4.0.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
Expand Down
6 changes: 3 additions & 3 deletions samples/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
id 'com.android.application' version '8.2.0' apply false
id 'com.android.library' version '8.2.0' apply false
id 'org.jetbrains.kotlin.android' version '2.0.21' apply false
}
2 changes: 1 addition & 1 deletion samples/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Dec 20 15:10:18 CET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
8 changes: 5 additions & 3 deletions samples/js/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("js") version "1.7.10"
kotlin("js") version "2.0.21"
}

group = "org.example"
Expand All @@ -14,7 +14,7 @@ repositories {
}

dependencies {
implementation("com.configcat:configcat-kotlin-client:3.0.0")
implementation("com.configcat:configcat-kotlin-client:4.0.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react:18.0.0-pre.332-kotlin-1.6.21")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:18.0.0-pre.332-kotlin-1.6.21")
Expand All @@ -26,7 +26,9 @@ kotlin {
binaries.executable()
browser {
commonWebpackConfig {
cssSupport.enabled = true
cssSupport {
enabled.set(true)
}
}
}
}
Expand Down
20 changes: 18 additions & 2 deletions samples/kmm/androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.application")
kotlin("android")
}

android {
compileSdk = 32
namespace = "com.example.configcat_kmm.android"
compileSdk = 34
defaultConfig {
applicationId = "com.example.configcat_kmm.android"
minSdk = 21
targetSdk = 32
//noinspection EditedTargetSdkVersion
targetSdk = 34
versionCode = 1
versionName = "1.0"
}
Expand All @@ -17,6 +21,18 @@ android {
isMinifyEnabled = false
}
}
java {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

kotlin{
compileOptions {
jvmToolchain(8)
}
}
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions samples/kmm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10")
classpath("com.android.tools.build:gradle:7.3.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.21")
classpath("com.android.tools.build:gradle:8.2.2")
}
}

Expand Down
2 changes: 1 addition & 1 deletion samples/kmm/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Aug 01 13:15:01 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
2 changes: 1 addition & 1 deletion samples/kmm/iosApp/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: f282da88f39e69507b0a255187c8a6b644477756

COCOAPODS: 1.11.3
COCOAPODS: 1.15.2
18 changes: 18 additions & 0 deletions samples/kmm/iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
7555FF77242A565900829871 /* Sources */,
7555FF79242A565900829871 /* Resources */,
3E91750B58E092A8080E14B9 /* Frameworks */,
9C00AA998B3E77E6AE064D76 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -161,6 +162,23 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
9C00AA998B3E77E6AE064D76 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
F9CB19E937CB7FF135119612 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down
Binary file not shown.
43 changes: 29 additions & 14 deletions samples/kmm/shared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget


plugins {
kotlin("multiplatform")
kotlin("native.cocoapods")
Expand All @@ -7,7 +10,7 @@ plugins {
version = "1.0"

kotlin {
android()
androidTarget()
iosX64()
iosArm64()
iosSimulatorArm64()
Expand All @@ -21,25 +24,22 @@ kotlin {
baseName = "shared"
}
}

sourceSets {
val commonMain by getting {
dependencies {
implementation("com.configcat:configcat-kotlin-client:3.0.0")
}
commonMain.dependencies {
implementation("com.configcat:configcat-kotlin-client:4.0.0")
}
val commonTest by getting {
dependencies {

commonTest.dependencies {
implementation(kotlin("test"))
}
}
val androidMain by getting
val androidTest by getting
val androidUnitTest by getting
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by creating {
dependsOn(commonMain)
dependsOn(commonMain.get())
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
Expand All @@ -48,7 +48,7 @@ kotlin {
val iosArm64Test by getting
val iosSimulatorArm64Test by getting
val iosTest by creating {
dependsOn(commonTest)
dependsOn(commonTest.get())
iosX64Test.dependsOn(this)
iosArm64Test.dependsOn(this)
iosSimulatorArm64Test.dependsOn(this)
Expand All @@ -57,10 +57,25 @@ kotlin {
}

android {
compileSdk = 32
namespace = "com.example.configcat_kmm"
compileSdk = 34
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 21
targetSdk = 32
//noinspection EditedTargetSdkVersion
targetSdk = 34
}
java {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

kotlin{
compileOptions {
jvmToolchain(8)
}
}

}
4 changes: 2 additions & 2 deletions samples/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.7.10"
kotlin("jvm") version "2.0.21"
application
}

Expand All @@ -17,7 +17,7 @@ repositories {
}

dependencies {
implementation("com.configcat:configcat-kotlin-client:3.0.0")
implementation("com.configcat:configcat-kotlin-client:4.0.0")
}

tasks.withType<KotlinCompile> {
Expand Down
4 changes: 2 additions & 2 deletions samples/node-js/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("js") version "1.7.10"
kotlin("js") version "2.0.21"
}

group = "org.example"
Expand All @@ -14,7 +14,7 @@ repositories {
}

dependencies {
implementation("com.configcat:configcat-kotlin-client:3.0.0")
implementation("com.configcat:configcat-kotlin-client:4.0.0")
}

kotlin {
Expand Down

0 comments on commit 9ccc532

Please sign in to comment.