Skip to content

Commit b24d56c

Browse files
committed
Detect when an Android target is registered for benchmarking
1 parent 819f126 commit b24d56c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ buildscript {
55
repositories {
66
maven { url 'https://maven.pkg.jetbrains.space/kotlin/p/kotlinx/maven' }
77
gradlePluginPortal()
8+
google()
89

910
KotlinCommunity.addDevRepositoryIfEnabled(delegate, project)
1011
}
@@ -21,6 +22,7 @@ buildscript {
2122
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
2223
}
2324
}
25+
classpath "com.android.tools.build:gradle:8.2.2"
2426
}
2527
}
2628

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 "1.9.21"
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
targets.configureEach {
@@ -59,6 +86,8 @@ kotlin {
5986
}
6087

6188
nativeMain {}
89+
90+
androidMain {}
6291
}
6392
}
6493

@@ -133,6 +162,7 @@ benchmark {
133162
register("macosArm64")
134163
register("linuxX64")
135164
register("mingwX64")
165+
register("android")
136166
}
137167
}
138168

0 commit comments

Comments
 (0)