diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ece0b3a..d9ddcd7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,13 +25,13 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 - name: Build Android - run: ./gradlew :uxcam-kmp-shared:compileReleaseKotlinAndroid :uxcam-kmp-shared:bundleReleaseAar --no-daemon + run: ./gradlew :uxcam-kmp-shared:assembleAndroidMain --no-daemon - name: Publish to Maven Central run: ./gradlew :uxcam-kmp-shared:publishAndReleaseToMavenCentral --no-configuration-cache --no-daemon diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml index b8cb268..6250ce8 100644 --- a/.github/workflows/validate-pr.yml +++ b/.github/workflows/validate-pr.yml @@ -14,7 +14,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: Build Android - run: ./gradlew :uxcam-kmp-shared:compileReleaseKotlinAndroid :uxcam-kmp-shared:bundleReleaseAar --no-daemon + run: ./gradlew :uxcam-kmp-shared:assembleAndroidMain --no-daemon diff --git a/UXCamExample/androidApp/build.gradle.kts b/UXCamExample/androidApp/build.gradle.kts index 8a47c63..4436b59 100644 --- a/UXCamExample/androidApp/build.gradle.kts +++ b/UXCamExample/androidApp/build.gradle.kts @@ -1,26 +1,26 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { id("com.android.application") kotlin("android") + id("org.jetbrains.kotlin.plugin.compose") } val libraryVersion: String = project.findProperty("VERSION_NAME")?.toString() ?: "1.0.0" android { namespace = "dev.onexeor.uxcam.uxcamexample.android" - compileSdk = 33 + compileSdk = 36 defaultConfig { applicationId = "dev.onexeor.uxcam.uxcamexample.android" minSdk = 23 - targetSdk = 33 + targetSdk = 36 versionCode = 1 versionName = libraryVersion } buildFeatures { compose = true } - composeOptions { - kotlinCompilerExtensionVersion = "1.4.7" - } packaging { resources { excludes += "/META-INF/{AL2.0,LGPL2.1}" @@ -32,20 +32,24 @@ android { } } compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } - kotlinOptions { - jvmTarget = "1.8" +} + +kotlin { + compilerOptions { + jvmTarget.set(JvmTarget.JVM_21) } } dependencies { - implementation(project(":shared")) - implementation("androidx.compose.ui:ui:1.4.3") - implementation("androidx.compose.ui:ui-tooling:1.4.3") - implementation("androidx.compose.ui:ui-tooling-preview:1.4.3") - implementation("androidx.compose.foundation:foundation:1.4.3") - implementation("androidx.compose.material:material:1.4.3") - implementation("androidx.activity:activity-compose:1.7.1") + implementation(project(":UXCamExample:shared")) + implementation(platform("androidx.compose:compose-bom:2025.12.00")) + implementation("androidx.compose.ui:ui") + implementation("androidx.compose.ui:ui-tooling") + implementation("androidx.compose.ui:ui-tooling-preview") + implementation("androidx.compose.foundation:foundation") + implementation("androidx.compose.material:material") + implementation("androidx.activity:activity-compose:1.10.0") } \ No newline at end of file diff --git a/UXCamExample/androidApp/src/main/java/dev/onexeor/uxcam/uxcamexample/android/MainActivity.kt b/UXCamExample/androidApp/src/main/java/dev/onexeor/uxcam/uxcamexample/android/MainActivity.kt index ac2a637..77b35c2 100644 --- a/UXCamExample/androidApp/src/main/java/dev/onexeor/uxcam/uxcamexample/android/MainActivity.kt +++ b/UXCamExample/androidApp/src/main/java/dev/onexeor/uxcam/uxcamexample/android/MainActivity.kt @@ -5,10 +5,8 @@ import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material.* -import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import androidx.compose.ui.tooling.preview.Preview -import dev.onexeor.uxcam.uxcamexample.Greeting +import dev.onexeor.uxcam.uxcamexample.UXCamExample class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { diff --git a/UXCamExample/shared/build.gradle.kts b/UXCamExample/shared/build.gradle.kts index 2f58fa6..c30c8d1 100644 --- a/UXCamExample/shared/build.gradle.kts +++ b/UXCamExample/shared/build.gradle.kts @@ -1,22 +1,26 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget + plugins { kotlin("multiplatform") kotlin("native.cocoapods") - id("com.android.library") + id("com.android.kotlin.multiplatform.library") } val libraryVersion: String = project.findProperty("VERSION_NAME")?.toString() ?: "1.0.0" -@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class) kotlin { - targetHierarchy.default() + applyDefaultHierarchyTemplate() + + androidLibrary { + namespace = "dev.onexeor.uxcam.uxcamexample" + compileSdk = 36 + minSdk = 23 - android { - compilations.all { - kotlinOptions { - jvmTarget = "1.8" - } + compilerOptions { + jvmTarget.set(JvmTarget.JVM_21) } } + iosX64() iosArm64() iosSimulatorArm64() @@ -34,23 +38,11 @@ kotlin { } sourceSets { - val commonMain by getting { - dependencies { - implementation(project(":uxcam-kmp-shared")) - } + commonMain.dependencies { + implementation(project(":uxcam-kmp-shared")) } - val commonTest by getting { - dependencies { - implementation(kotlin("test")) - } + commonTest.dependencies { + implementation(kotlin("test")) } } } - -android { - namespace = "dev.onexeor.uxcam.uxcamexample" - compileSdk = 33 - defaultConfig { - minSdk = 23 - } -} diff --git a/build.gradle.kts b/build.gradle.kts index 26a5223..2c90cf1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,14 @@ plugins { // trick: for the same plugin versions in all sub-modules - id("com.android.library").version("8.1.1").apply(false) - kotlin("multiplatform").version("1.9.21").apply(false) + id("com.android.kotlin.multiplatform.library").version("8.13.2").apply(false) + id("com.android.application").version("8.13.2").apply(false) + kotlin("multiplatform").version("2.3.0").apply(false) + kotlin("android").version("2.3.0").apply(false) + kotlin("native.cocoapods").version("2.3.0").apply(false) + id("org.jetbrains.kotlin.plugin.compose").version("2.3.0").apply(false) id("com.vanniktech.maven.publish").version("0.30.0").apply(false) } tasks.register("clean", Delete::class) { - delete(rootProject.buildDir) + delete(rootProject.layout.buildDirectory) } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5549b3b..2733ed5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Tue Aug 01 12:29:12 CEST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 33cf45b..b0c83fd 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,4 +17,4 @@ dependencyResolutionManagement { rootProject.name = "UXCam-KMP" include(":uxcam-kmp-shared") include(":UXCamExample:shared") -include(":UXCamExample:androidExample") +include(":UXCamExample:androidApp") diff --git a/uxcam-kmp-shared/build.gradle.kts b/uxcam-kmp-shared/build.gradle.kts index cec6321..baaf27d 100644 --- a/uxcam-kmp-shared/build.gradle.kts +++ b/uxcam-kmp-shared/build.gradle.kts @@ -1,29 +1,32 @@ import com.vanniktech.maven.publish.SonatypeHost +import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { kotlin("multiplatform") kotlin("native.cocoapods") - id("com.android.library") + id("com.android.kotlin.multiplatform.library") id("com.vanniktech.maven.publish") } val libraryVersion: String = project.findProperty("VERSION_NAME")?.toString() ?: "1.0.0" -@OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class) kotlin { - targetHierarchy.default() + applyDefaultHierarchyTemplate() - android { - compilations.all { - kotlinOptions { - jvmTarget = "1.8" - } + androidLibrary { + namespace = "dev.onexeor.uxcam" + compileSdk = 36 + minSdk = 23 + + compilerOptions { + jvmTarget.set(JvmTarget.JVM_21) } - publishLibraryVariants("release") } - ios() + iosX64() + iosArm64() iosSimulatorArm64() + cocoapods { version = libraryVersion ios.deploymentTarget = "12.0" @@ -35,28 +38,15 @@ kotlin { } sourceSets { - val commonMain by getting { - dependencies { - implementation("io.github.aakira:napier:2.7.1") - } + commonMain.dependencies { + implementation("io.github.aakira:napier:2.7.1") } - val commonTest by getting { - dependencies { - implementation(kotlin("test")) - } + commonTest.dependencies { + implementation(kotlin("test")) + } + androidMain.dependencies { + implementation("com.uxcam:uxcam:3.8.8") } - } -} - -android { - namespace = "dev.onexeor.uxcam" - compileSdk = 33 - defaultConfig { - minSdk = 23 - } - - dependencies { - implementation("com.uxcam:uxcam:3.6.12") } } diff --git a/uxcam-kmp-shared/src/iosMain/kotlin/dev/onexeor/uxcam/UXCam.kt b/uxcam-kmp-shared/src/iosMain/kotlin/dev/onexeor/uxcam/UXCam.kt index 288baec..0c8f362 100644 --- a/uxcam-kmp-shared/src/iosMain/kotlin/dev/onexeor/uxcam/UXCam.kt +++ b/uxcam-kmp-shared/src/iosMain/kotlin/dev/onexeor/uxcam/UXCam.kt @@ -1,4 +1,5 @@ @file:Suppress("UNUSED") +@file:OptIn(kotlinx.cinterop.ExperimentalForeignApi::class) package dev.onexeor.uxcam