Skip to content

Commit dbd741a

Browse files
committed
Detect when an Android target is registered for benchmarking
1 parent ca16384 commit dbd741a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ buildscript {
99
repositories {
1010
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlinx/maven")
1111
gradlePluginPortal()
12+
google()
1213

1314
addDevRepositoryIfEnabled(this, project)
1415
}
@@ -25,6 +26,7 @@ buildscript {
2526
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
2627
}
2728
}
29+
classpath("com.android.tools.build:gradle:8.2.2")
2830
}
2931
}
3032

examples/kotlin-multiplatform/build.gradle

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,37 @@ plugins {
44
id 'org.jetbrains.kotlin.multiplatform'
55
id 'org.jetbrains.kotlin.plugin.allopen' version "2.0.20"
66
id 'org.jetbrains.kotlinx.benchmark'
7+
id 'com.android.library'
78
}
89

910
// how to apply plugin to a specific source set?
1011
allOpen {
1112
annotation("org.openjdk.jmh.annotations.State")
1213
}
1314

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+
1438
kotlin {
1539
jvm {
1640
compilations.create('benchmark') { associateWith(compilations.main) }
@@ -28,6 +52,9 @@ kotlin {
2852
linuxX64()
2953
mingwX64()
3054

55+
androidTarget {
56+
}
57+
3158
applyDefaultHierarchyTemplate()
3259

3360
sourceSets {
@@ -47,6 +74,8 @@ kotlin {
4774
}
4875

4976
nativeMain {}
77+
78+
androidMain {}
5079
}
5180
}
5281

@@ -121,5 +150,6 @@ benchmark {
121150
register("macosArm64")
122151
register("linuxX64")
123152
register("mingwX64")
153+
register("android")
124154
}
125155
}

0 commit comments

Comments
 (0)