1
-
1
+ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
2
2
3
3
val MODULE_PACKAGE_NAME : String by project
4
4
val MODULE_NAME : String by project
@@ -8,12 +8,16 @@ val PUBLISH_NAME: String by project
8
8
group = MODULE_PACKAGE_NAME
9
9
version = MODULE_VERSION_NUMBER
10
10
11
+ kotlin {
12
+ jvmToolchain(libs.versions.jvm.get().toInt())
13
+ }
14
+
11
15
plugins {
12
16
kotlin(" multiplatform" )
13
17
id(" com.android.library" )
14
- kotlin(" native.cocoapods" )
15
18
id(" org.jlleitschuh.gradle.ktlint" )
16
19
id(" io.gitlab.arturbosch.detekt" )
20
+ kotlin(" native.cocoapods" )
17
21
id(" io.github.luca992.multiplatform-swiftpackage" ) version " 2.1.1"
18
22
signing
19
23
`maven- publish`
@@ -26,27 +30,32 @@ ktlint {
26
30
detekt {
27
31
config = files(" ./custom-detekt-config.yml" )
28
32
buildUponDefaultConfig = true // preconfigure defaults
29
- input = files(" src/commonMain/kotlin" )
33
+ source.setFrom(
34
+ " src/commonMain/kotlin" ,
35
+ " src/androidMain/kotlin" ,
36
+ " src/iosMain/kotlin"
37
+ )
30
38
autoCorrect = false
31
-
32
- reports {
33
- html.enabled = true
34
- xml.enabled = true
35
- txt.enabled = true
36
- sarif.enabled = true
37
- }
38
39
}
39
40
40
41
tasks.withType< io.gitlab.arturbosch.detekt.Detekt > ().configureEach {
41
- // Target version of the generated JVM bytecode. It is used for type resolution.
42
- jvmTarget = " 1.8"
42
+ jvmTarget = libs.versions.jvm.get()
43
+ reports {
44
+ html.required.set(true )
45
+ xml.required.set(true )
46
+ txt.required.set(true )
47
+ sarif.required.set(true )
48
+ }
43
49
}
44
50
45
51
kotlin {
46
- android {
52
+ @OptIn(ExperimentalKotlinGradlePluginApi ::class )
53
+ targetHierarchy.default()
54
+ androidTarget {
47
55
publishAllLibraryVariants()
48
56
publishLibraryVariantsGroupedByFlavor = true
49
57
}
58
+
50
59
ios()
51
60
iosSimulatorArm64()
52
61
cocoapods {
@@ -63,6 +72,7 @@ kotlin {
63
72
pod(" FlipperKit/SKIOSNetworkPlugin" )
64
73
pod(" FlipperKit/FlipperKitUserDefaultsPlugin" )
65
74
}
75
+
66
76
sourceSets {
67
77
val commonMain by getting {
68
78
dependencies {
@@ -97,16 +107,21 @@ kotlin {
97
107
}
98
108
99
109
android {
100
- compileSdk = 31
101
- buildToolsVersion = " 30.0.3 "
110
+ compileSdk = androidVersions.versions.compileSdk.get().toInt()
111
+ buildToolsVersion = androidVersions.versions.buildToolsVersion.get()
102
112
sourceSets[" main" ].manifest.srcFile(" src/androidMain/AndroidManifest.xml" )
113
+ namespace = MODULE_PACKAGE_NAME
103
114
defaultConfig {
104
- minSdk = 23
105
- targetSdk = 31
115
+ minSdk = androidVersions.versions.minSdk.get().toInt()
106
116
}
107
117
compileOptions {
108
- sourceCompatibility = JavaVersion .VERSION_11
109
- targetCompatibility = JavaVersion .VERSION_11
118
+ sourceCompatibility = JavaVersion .VERSION_17
119
+ targetCompatibility = JavaVersion .VERSION_17
120
+ }
121
+ buildTypes {
122
+ getByName(" release" ) {
123
+ isMinifyEnabled = false
124
+ }
110
125
}
111
126
}
112
127
@@ -195,3 +210,8 @@ multiplatformSwiftPackage {
195
210
iOS { v(" 16.4" ) }
196
211
}
197
212
}
213
+
214
+ tasks.withType<AbstractPublishToMaven >().configureEach {
215
+ val signingTasks = tasks.withType<Sign >()
216
+ mustRunAfter(signingTasks)
217
+ }
0 commit comments