allwinner_a64/android/external/conscrypt/benchmark-jmh/build.gradle
2018-08-08 16:14:42 +08:00

71 lines
2.1 KiB
Groovy

plugins {
id 'me.champeau.gradle.jmh' version '0.3.1'
}
apply plugin: 'idea'
description = 'Conscrypt: OpenJDK Benchmarks'
ext {
genDir = "${buildDir}/jmh-generated-classes"
jmhInclude = System.getProperty('jmh.include')
jmhWarmupIterations = System.getProperty('jmh.wi', '10')
jmhIterations = System.getProperty('jmh.i', '10')
jmhFork = System.getProperty('jmh.f', '1')
jmhJvmArgs = System.getProperty('jmh.jvmArgs', '-server -Xms2g -Xmx2g')
}
jmh {
jmhVersion = "$jmhVersion"
if (jmhInclude != null) {
setInclude(jmhInclude.toString())
}
warmupIterations = "$jmhWarmupIterations".toInteger()
iterations = "$jmhIterations".toInteger();
fork = "$jmhFork".toInteger()
jvmArgs = jmhJvmArgs.toString()
duplicateClassesStrategy = 'warn'
}
configurations {
// The JMH plugin by defaults depends on all of the generators for an old version of JMH.
// Need to remove all the generators that we're not explicitly overriding to eliminate the
// dependency on the old version of JMH.
jmh.exclude module:'jmh-generator-asm'
jmhGeneratorAnnprocess
}
sourceSets {
sourceSets {
main {
resources {
// This shouldn't be needed but seems to help IntelliJ locate
// META_INF/BenchmarkList.
srcDirs += genDir
}
}
}
}
dependencies {
compile project(':conscrypt-benchmark-base'),
libraries.junit
jmhGeneratorAnnprocess libraries.jmh_generator_annprocess
// Override the default JMH dependencies with the new versions.
jmh libraries.jmh_core,
libraries.jmh_generator_reflection,
libraries.jmh_generator_bytecode
}
// Running benchmarks in IntelliJ seems broken without this.
// See https://github.com/melix/jmh-gradle-plugin/issues/39
idea.module {
scopes.PROVIDED.plus += [ configurations.compile, configurations.jmh ]//, configurations.jmhGeneratorAnnprocess ]
}
// Don't include this artifact in the distribution.
tasks.install.enabled = false
tasks.uploadArchives.enabled = false;