Skip to content

Commit b1bf1e5

Browse files
Merge pull request #991 from benjchristensen/jmh-build
JMH Benchmark Build Config
2 parents f999255 + bcb44e0 commit b1bf1e5

File tree

2 files changed

+14
-36
lines changed

2 files changed

+14
-36
lines changed

build.gradle

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,9 @@ buildscript {
1010
repositories {
1111
mavenLocal()
1212
mavenCentral()
13-
maven {
14-
//FIXME: waiting for https://github.com/johnrengelman/shadow/pull/38 to merge
15-
name 'Shadow'
16-
url 'http://dl.bintray.com/content/gvsmirnov/gradle-plugins'
17-
}
1813
jcenter()
1914
}
2015

21-
dependencies {
22-
// Required for benchmarks
23-
classpath 'com.github.jengelman.gradle.plugins:shadow:0.8.1'
24-
}
25-
2616
apply from: file('gradle/buildscript.gradle'), to: buildscript
2717
}
2818

@@ -43,6 +33,8 @@ subprojects {
4333
configurations {
4434
examplesCompile.extendsFrom compile
4535
examplesRuntime.extendsFrom runtime
36+
perfCompile.extendsFrom compile
37+
perfRuntime.extendsFrom runtime
4638
}
4739

4840

@@ -52,19 +44,22 @@ subprojects {
5244

5345
sourceSets {
5446
examples
55-
perf
47+
perf {
48+
compileClasspath += sourceSets.main.output
49+
}
5650
}
5751

5852
tasks.build {
5953
//include 'examples' in build task
6054
dependsOn(examplesClasses)
55+
dependsOn(perfClasses)
6156
}
6257

6358
dependencies {
6459
perfCompile 'org.openjdk.jmh:jmh-core:0.5.3'
6560
perfCompile 'org.openjdk.jmh:jmh-generator-annprocess:0.5.3'
6661

67-
perfCompile project
62+
//perfCompile project
6863
}
6964

7065
eclipse {
@@ -83,28 +78,11 @@ subprojects {
8378
}
8479
}
8580

86-
task perfJar(type: Jar, dependsOn: perfClasses) {
87-
from sourceSets.perf.output + sourceSets.main.output
88-
}
89-
90-
task benchmarks(dependsOn: perfJar) {
91-
92-
apply plugin: "shadow"
93-
94-
shadow {
95-
classifier = "benchmarks"
96-
includeDependenciesFor = ["runtime", "perfRuntime"]
97-
98-
transformer(com.github.jengelman.gradle.plugins.shadow.transformers.ManifestResourceTransformer) {
99-
mainClass = "org.openjdk.jmh.Main"
100-
}
101-
}
102-
103-
doLast {
104-
shadowJar.execute()
105-
}
106-
107-
}
81+
task benchmarks(type: JavaExec) {
82+
main = 'org.openjdk.jmh.Main'
83+
classpath = sourceSets.perf.runtimeClasspath + sourceSets.main.output
84+
}
85+
10886
}
10987

11088
project(':rxjava-core') {

rxjava-core/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ sourceCompatibility = JavaVersion.VERSION_1_6
55
targetCompatibility = JavaVersion.VERSION_1_6
66

77
dependencies {
8-
provided 'junit:junit-dep:4.10'
9-
provided 'org.mockito:mockito-core:1.8.5'
8+
testCompile 'junit:junit-dep:4.10'
9+
testCompile 'org.mockito:mockito-core:1.8.5'
1010
}
1111

1212
javadoc {

0 commit comments

Comments
 (0)