build.gradle.kts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. @file:Suppress("OPT_IN_IS_NOT_ENABLED")
  2. plugins {
  3. kotlin("multiplatform")
  4. kotlin("native.cocoapods")
  5. id("com.android.library")
  6. id("org.jetbrains.compose")
  7. }
  8. version = "1.0-SNAPSHOT"
  9. kotlin {
  10. android()
  11. jvm("desktop")
  12. ios()
  13. iosSimulatorArm64()
  14. cocoapods {
  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. }
  34. }
  35. val androidMain by getting {
  36. dependencies {
  37. api("androidx.activity:activity-compose:1.6.1")
  38. api("androidx.appcompat:appcompat:1.6.1")
  39. api("androidx.core:core-ktx:1.9.0")
  40. }
  41. }
  42. val iosMain by getting
  43. val iosSimulatorArm64Main by getting {
  44. dependsOn(iosMain)
  45. }
  46. val desktopMain by getting {
  47. dependencies {
  48. implementation(compose.desktop.common)
  49. }
  50. }
  51. }
  52. }
  53. android {
  54. compileSdk = 33
  55. sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
  56. sourceSets["main"].res.srcDirs("src/androidMain/res")
  57. sourceSets["main"].resources.srcDirs("src/commonMain/resources")
  58. defaultConfig {
  59. minSdk = 26
  60. targetSdk = 33
  61. }
  62. compileOptions {
  63. sourceCompatibility = JavaVersion.VERSION_11
  64. targetCompatibility = JavaVersion.VERSION_11
  65. }
  66. }