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 @@ -9,6 +9,7 @@ buildscript {
9
9
repositories {
10
10
maven(" https://maven.pkg.jetbrains.space/kotlin/p/kotlinx/maven" )
11
11
gradlePluginPortal()
12
+ google()
12
13
13
14
addDevRepositoryIfEnabled(this , project)
14
15
}
@@ -25,6 +26,7 @@ buildscript {
25
26
classpath(" org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion " )
26
27
}
27
28
}
29
+ classpath(" com.android.tools.build:gradle:8.2.2" )
28
30
}
29
31
}
30
32
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
sourceSets {
@@ -47,6 +74,8 @@ kotlin {
47
74
}
48
75
49
76
nativeMain {}
77
+
78
+ androidMain {}
50
79
}
51
80
}
52
81
@@ -121,5 +150,6 @@ benchmark {
121
150
register(" macosArm64" )
122
151
register(" linuxX64" )
123
152
register(" mingwX64" )
153
+ register(" android" )
124
154
}
125
155
}
You can’t perform that action at this time.
0 commit comments