File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
examples/kotlin-multiplatform Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ buildscript {
7
7
repositories {
8
8
maven(" https://maven.pkg.jetbrains.space/kotlin/p/kotlinx/maven" )
9
9
gradlePluginPortal()
10
+ google()
10
11
11
12
addDevRepositoryIfEnabled(this , project)
12
13
}
@@ -23,6 +24,7 @@ buildscript {
23
24
classpath(" org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion " )
24
25
}
25
26
}
27
+ classpath(" com.android.tools.build:gradle:8.2.2" )
26
28
}
27
29
}
28
30
Original file line number Diff line number Diff line change @@ -4,13 +4,37 @@ plugins {
4
4
id ' org.jetbrains.kotlin.multiplatform'
5
5
id ' org.jetbrains.kotlin.plugin.allopen' version " 2.0.20"
6
6
id ' org.jetbrains.kotlinx.benchmark'
7
+ id ' com.android.library'
7
8
}
8
9
9
10
// how to apply plugin to a specific source set?
10
11
allOpen {
11
12
annotation(" org.openjdk.jmh.annotations.State" )
12
13
}
13
14
15
+ android {
16
+ compileSdk 34
17
+ namespace = " org.jetbrains.kotlinx.examples"
18
+
19
+ defaultConfig {
20
+ minSdk = 29
21
+ targetSdk = 34
22
+ versionCode = 1
23
+ versionName = " 1.0"
24
+
25
+ testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
26
+ }
27
+
28
+ buildTypes {
29
+ release {
30
+ }
31
+ }
32
+ compileOptions {
33
+ sourceCompatibility = JavaVersion . VERSION_1_8
34
+ targetCompatibility = JavaVersion . VERSION_1_8
35
+ }
36
+ }
37
+
14
38
kotlin {
15
39
jvm {
16
40
compilations. create(' benchmark' ) { associateWith(compilations. main) }
@@ -28,6 +52,9 @@ kotlin {
28
52
linuxX64()
29
53
mingwX64()
30
54
55
+ androidTarget {
56
+ }
57
+
31
58
applyDefaultHierarchyTemplate()
32
59
33
60
targets. configureEach {
@@ -59,6 +86,8 @@ kotlin {
59
86
}
60
87
61
88
nativeMain {}
89
+
90
+ androidMain {}
62
91
}
63
92
}
64
93
@@ -133,5 +162,6 @@ benchmark {
133
162
register(" macosArm64" )
134
163
register(" linuxX64" )
135
164
register(" mingwX64" )
165
+ register(" android" )
136
166
}
137
167
}
You can’t perform that action at this time.
0 commit comments