build.gradle.kts 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. plugins {
  2. kotlin("multiplatform")
  3. // kotlin("native.cocoapods")
  4. id("com.android.library")
  5. id("org.jetbrains.compose")
  6. }
  7. kotlin {
  8. androidTarget()
  9. jvm("desktop")
  10. // iosX64()
  11. // iosArm64()
  12. // iosSimulatorArm64()
  13. // cocoapods {
  14. // version = "1.0.0"
  15. // summary = "Some description for the Shared Module"
  16. // homepage = "Link to the Shared Module homepage"
  17. // ios.deploymentTarget = "14.1"
  18. // podfile = project.file("../iosApp/Podfile")
  19. // framework {
  20. // baseName = "shared"
  21. // isStatic = true
  22. // }
  23. // extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
  24. // }
  25. sourceSets {
  26. val commonMain by getting {
  27. dependencies {
  28. implementation(compose.runtime)
  29. implementation(compose.foundation)
  30. implementation(compose.material)
  31. @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
  32. implementation(compose.components.resources)
  33. implementation(files("libs/shared-desktop.jar"))
  34. implementation(files("libs/shared-release.aar"))
  35. implementation("com.cicoe.note:shared:1.0")
  36. //implementation(files("libs/drawlib-commonMain.jar"))
  37. }
  38. }
  39. val androidMain by getting {
  40. dependencies {
  41. api("androidx.activity:activity-compose:1.6.1")
  42. api("androidx.appcompat:appcompat:1.6.1")
  43. api("androidx.core:core-ktx:1.9.0")
  44. // implementation(files("libs/shared-release.aar"))
  45. }
  46. }
  47. // val iosX64Main by getting
  48. // val iosArm64Main by getting
  49. // val iosSimulatorArm64Main by getting
  50. // val iosMain by creating {
  51. // dependsOn(commonMain)
  52. // iosX64Main.dependsOn(this)
  53. // iosArm64Main.dependsOn(this)
  54. // iosSimulatorArm64Main.dependsOn(this)
  55. // }
  56. val desktopMain by getting {
  57. dependencies {
  58. implementation(compose.desktop.common)
  59. // implementation(files("libs/shared-desktop.jar"))
  60. }
  61. }
  62. }
  63. }
  64. android {
  65. compileSdk = (findProperty("android.compileSdk") as String).toInt()
  66. namespace = "com.myapplication.common"
  67. sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
  68. sourceSets["main"].res.srcDirs("src/androidMain/res")
  69. sourceSets["main"].resources.srcDirs("src/commonMain/resources")
  70. defaultConfig {
  71. minSdk = (findProperty("android.minSdk") as String).toInt()
  72. targetSdk = (findProperty("android.targetSdk") as String).toInt()
  73. }
  74. compileOptions {
  75. sourceCompatibility = JavaVersion.VERSION_11
  76. targetCompatibility = JavaVersion.VERSION_11
  77. }
  78. kotlin {
  79. jvmToolchain(11)
  80. }
  81. }