ui/common/build.gradle.kts
changeset 36 a8cfcfe9a6ed
parent 34 ce299aacc068
child 37 ff77c11da594
--- a/ui/common/build.gradle.kts	Tue Apr 22 14:35:57 2025 -0400
+++ b/ui/common/build.gradle.kts	Tue Apr 22 16:26:18 2025 -0400
@@ -19,9 +19,11 @@
  * You should have received a copy of the GNU General Public License
  * along with AboutOss.  If not, see <http://www.gnu.org/licenses/>.
  */
+import org.jetbrains.kotlin.gradle.dsl.JvmTarget
+
 plugins {
     id("com.android.library")
-    kotlin("android")
+    kotlin("multiplatform")
     id("com.geekorum.build.source-license-checker")
     `maven-publish`
 }
@@ -29,6 +31,39 @@
 group = "com.geekorum.aboutoss"
 version = "0.1.0"
 
+kotlin {
+    androidTarget {
+        compilerOptions {
+            jvmTarget.set(JvmTarget.JVM_17)
+        }
+    }
+
+    jvm("desktop")
+
+    listOf(
+        iosX64(),
+        iosArm64(),
+        iosSimulatorArm64(),
+    ).forEach { iosTarget ->
+        iosTarget.binaries.framework {
+            baseName = "aboutoss-core"
+            isStatic = true
+        }
+    }
+
+    sourceSets {
+        commonMain.dependencies {
+            implementation(project(":core"))
+            api(libs.org.jetbrains.androidx.lifecycle.viewmodel)
+        }
+
+        androidMain.dependencies {
+            api(libs.androidx.activity)
+            api(libs.geekdroid)
+        }
+    }
+}
+
 android {
     namespace = "com.geekorum.aboutoss.ui.common"
     compileSdk = 35
@@ -55,11 +90,8 @@
         }
     }
     compileOptions {
-        sourceCompatibility = JavaVersion.VERSION_1_8
-        targetCompatibility = JavaVersion.VERSION_1_8
-    }
-    kotlinOptions {
-        jvmTarget = "1.8"
+        sourceCompatibility = JavaVersion.VERSION_17
+        targetCompatibility = JavaVersion.VERSION_17
     }
 
     publishing {
@@ -71,15 +103,6 @@
 }
 
 dependencies {
-    implementation(project(":core"))
-    api(libs.appcompat)
-    implementation(libs.androidx.lifecycle.viewmodel)
-    implementation(libs.androidx.activity)
-    api(libs.geekdroid) {
-        //TODO get rid of dagger platform in geekdroid
-        exclude("com.google.dagger", "dagger-platform")
-    }
-
     testImplementation(libs.junit)
     androidTestImplementation(libs.androidx.test.ext.junit)
     androidTestImplementation(libs.espresso.core)