xref: /aosp_15_r20/external/kotlinx.serialization/benchmark/build.gradle (revision 57b5a4a64c534cf7f27ac9427ceab07f3d8ed3d8)
1import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2
3/*
4 * Copyright 2017-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
5 */
6
7apply plugin: 'java'
8apply plugin: 'kotlin'
9apply plugin: 'kotlinx-serialization'
10apply plugin: 'idea'
11apply plugin: 'com.github.johnrengelman.shadow'
12apply plugin: 'me.champeau.jmh'
13
14sourceCompatibility = 1.8
15targetCompatibility = 1.8
16jmh.jmhVersion = "1.35"
17
18processJmhResources {
19    doFirst {
20        duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
21    }
22}
23
24jmhJar {
25    archiveBaseName.set('benchmarks')
26    archiveVersion.set('')
27    destinationDirectory = file("$rootDir")
28}
29
30// to include benchmark-module jmh source set compilation during build to verify that it is also compiled succesfully
31assemble.dependsOn jmhClasses
32
33tasks.withType(KotlinCompile).configureEach {
34    kotlinOptions {
35        if (rootProject.ext.kotlin_lv_override != null) {
36            languageVersion = rootProject.ext.kotlin_lv_override
37            freeCompilerArgs += "-Xsuppress-version-warnings"
38        }
39    }
40}
41
42dependencies {
43    implementation 'org.openjdk.jmh:jmh-core:1.35'
44    implementation 'com.google.guava:guava:31.1-jre'
45    implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.3'
46    implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.13.3'
47    implementation "com.squareup.okio:okio:$okio_version"
48    implementation project(':kotlinx-serialization-core')
49    implementation project(':kotlinx-serialization-json')
50    implementation project(':kotlinx-serialization-json-okio')
51    implementation project(':kotlinx-serialization-protobuf')
52}
53