Skip to content

Commit f21714d

Browse files
authored
Upgrade Gradle and JMH (#1283)
JMH configuration is much easier now.
1 parent 5f5db4a commit f21714d

4 files changed

Lines changed: 3 additions & 34 deletions

File tree

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ buildscript {
2121
dependencies {
2222
classpath(libs.android.gradle.plugin)
2323
classpath(libs.dokka)
24-
classpath(libs.shadow)
2524
classpath(libs.jmh.gradle.plugin)
2625
classpath(libs.binaryCompatibilityValidator)
2726
classpath(libs.spotless)

gradle/libs.versions.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ binaryCompatibilityValidator = { module = "org.jetbrains.kotlinx.binary-compatib
1111
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test" }
1212
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit" }
1313
kotlin-time = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.4.0" }
14-
jmh-gradle-plugin = { module = "me.champeau.gradle:jmh-gradle-plugin", version = "0.5.3" }
14+
jmh-gradle-plugin = { module = "me.champeau.jmh:jmh-gradle-plugin", version = "0.7.1" }
1515
jmh-core = { module = "org.openjdk.jmh:jmh-core", version.ref = "jmh" }
1616
jmh-generator = { module = "org.openjdk.jmh:jmh-generator-annprocess", version.ref = "jmh" }
1717
dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "1.8.20" }
18-
shadow = { module = "gradle.plugin.com.github.johnrengelman:shadow", version = "7.1.2" }
1918
spotless = { module = "com.diffplug.spotless:spotless-plugin-gradle", version = "6.19.0" }
2019
bnd = { module = "biz.aQute.bnd:biz.aQute.bnd.gradle", version = "6.4.0" }
2120
vanniktech-publish-plugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version = "0.25.3" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

okio/jvm/jmh/build.gradle.kts

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,12 @@
1-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
import com.github.jengelman.gradle.plugins.shadow.transformers.DontIncludeResourceTransformer
3-
import com.github.jengelman.gradle.plugins.shadow.transformers.IncludeResourceTransformer
4-
51
plugins {
6-
id("java-library")
72
kotlin("jvm")
8-
id("com.github.johnrengelman.shadow")
9-
id("me.champeau.gradle.jmh")
3+
id("me.champeau.jmh")
104
}
115

126
jmh {
13-
jvmArgs = listOf("-Djmh.separateClasspathJAR=true")
14-
include = listOf("""com\.squareup\.okio\.benchmarks\.MessageDigestBenchmark.*""")
15-
duplicateClassesStrategy = DuplicatesStrategy.WARN
167
}
178

189
dependencies {
1910
api(projects.okio)
2011
api(libs.jmh.core)
21-
jmh(projects.okio) { targetConfiguration = "jvmRuntimeElements" }
22-
jmh(libs.jmh.core)
23-
jmh(libs.jmh.generator)
24-
}
25-
26-
tasks {
27-
val jmhJar by getting(ShadowJar::class) {
28-
transform(DontIncludeResourceTransformer().apply {
29-
resource = "META-INF/BenchmarkList"
30-
})
31-
32-
transform(IncludeResourceTransformer().apply {
33-
resource = "META-INF/BenchmarkList"
34-
file = file("${project.buildDir}/jmh-generated-resources/META-INF/BenchmarkList")
35-
})
36-
}
37-
38-
val assemble by getting {
39-
dependsOn(jmhJar)
40-
}
4112
}

0 commit comments

Comments
 (0)