Skip to content

JMH Benchmark Build Config #991

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 26, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 12 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,9 @@ buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
//FIXME: waiting for https://github.com/johnrengelman/shadow/pull/38 to merge
name 'Shadow'
url 'http://dl.bintray.com/content/gvsmirnov/gradle-plugins'
}
jcenter()
}

dependencies {
// Required for benchmarks
classpath 'com.github.jengelman.gradle.plugins:shadow:0.8.1'
}

apply from: file('gradle/buildscript.gradle'), to: buildscript
}

Expand All @@ -43,6 +33,8 @@ subprojects {
configurations {
examplesCompile.extendsFrom compile
examplesRuntime.extendsFrom runtime
perfCompile.extendsFrom compile
perfRuntime.extendsFrom runtime
}


Expand All @@ -52,19 +44,22 @@ subprojects {

sourceSets {
examples
perf
perf {
compileClasspath += sourceSets.main.output
}
}

tasks.build {
//include 'examples' in build task
dependsOn(examplesClasses)
dependsOn(perfClasses)
}

dependencies {
perfCompile 'org.openjdk.jmh:jmh-core:0.5.3'
perfCompile 'org.openjdk.jmh:jmh-generator-annprocess:0.5.3'

perfCompile project
//perfCompile project
}

eclipse {
Expand All @@ -83,28 +78,11 @@ subprojects {
}
}

task perfJar(type: Jar, dependsOn: perfClasses) {
from sourceSets.perf.output + sourceSets.main.output
}

task benchmarks(dependsOn: perfJar) {

apply plugin: "shadow"

shadow {
classifier = "benchmarks"
includeDependenciesFor = ["runtime", "perfRuntime"]

transformer(com.github.jengelman.gradle.plugins.shadow.transformers.ManifestResourceTransformer) {
mainClass = "org.openjdk.jmh.Main"
}
}

doLast {
shadowJar.execute()
}

}
task benchmarks(type: JavaExec) {
main = 'org.openjdk.jmh.Main'
classpath = sourceSets.perf.runtimeClasspath + sourceSets.main.output
}

}

project(':rxjava-core') {
Expand Down
4 changes: 2 additions & 2 deletions rxjava-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6

dependencies {
provided 'junit:junit-dep:4.10'
provided 'org.mockito:mockito-core:1.8.5'
testCompile 'junit:junit-dep:4.10'
testCompile 'org.mockito:mockito-core:1.8.5'
}

javadoc {
Expand Down