1import com.github.jengelman.gradle.plugins.shadow.transformers.DontIncludeResourceTransformer 2import com.github.jengelman.gradle.plugins.shadow.transformers.IncludeResourceTransformer 3 4apply plugin: 'java-library' 5apply plugin: 'org.jetbrains.kotlin.jvm' 6apply plugin: 'com.github.johnrengelman.shadow' 7apply plugin: 'me.champeau.gradle.jmh' 8 9jmhJar { 10 def excludeAllBenchmarkLists = new DontIncludeResourceTransformer() 11 excludeAllBenchmarkLists.resource = "META-INF/BenchmarkList" 12 transform(excludeAllBenchmarkLists) 13 14 def includeCorrectBenchmarkList = new IncludeResourceTransformer() 15 includeCorrectBenchmarkList.resource = "META-INF/BenchmarkList" 16 includeCorrectBenchmarkList.file = new File("${project.buildDir}/jmh-generated-resources/META-INF/BenchmarkList") 17 transform(includeCorrectBenchmarkList) 18} 19 20jmh { 21 jvmArgs = ['-Djmh.separateClasspathJAR=true'] 22 include = ['com\\.squareup\\.okio\\.benchmarks\\.MessageDigestBenchmark.*'] 23 duplicateClassesStrategy = 'warn' 24} 25 26dependencies { 27 compile project(':okio') 28 compile deps.kotlin.stdLib.jdk6 29 compile deps.jmh.core 30 jmh project(path: ':okio', configuration: 'jvmRuntimeElements') 31 jmh deps.kotlin.stdLib.jdk6 32 jmh deps.jmh.core 33 jmh deps.jmh.generator 34} 35 36assemble.dependsOn(jmhJar) 37