@@ -9,8 +9,20 @@ apply from: file('gradle/release.gradle')
9
9
buildscript {
10
10
repositories {
11
11
mavenLocal()
12
- mavenCentral() // maven { url 'http://jcenter.bintray.com' }
12
+ 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
+ }
18
+ jcenter()
19
+ }
20
+
21
+ dependencies {
22
+ // Required for benchmarks
23
+ classpath ' com.github.jengelman.gradle.plugins:shadow:0.8.1'
13
24
}
25
+
14
26
apply from : file(' gradle/buildscript.gradle' ), to : buildscript
15
27
}
16
28
@@ -19,7 +31,7 @@ allprojects {
19
31
apply plugin : ' idea'
20
32
repositories {
21
33
mavenLocal()
22
- mavenCentral() // maven { url: 'http://jcenter.bintray.com/' }
34
+ mavenCentral()
23
35
}
24
36
}
25
37
@@ -31,57 +43,67 @@ subprojects {
31
43
configurations {
32
44
examplesCompile. extendsFrom compile
33
45
examplesRuntime. extendsFrom runtime
34
- perfCompile. extendsFrom compile
35
- perfRuntime. extendsFrom runtime
36
46
}
37
47
38
48
39
49
tasks. withType(Javadoc ). each {
40
50
it. classpath = sourceSets. main. compileClasspath
41
51
}
42
52
43
- sourceSets {
44
- // include /src/examples folder
53
+ sourceSets {
45
54
examples
46
- // include /src/perf folder
47
- perf {
48
- java {
49
- srcDir ' src/perf/java'
50
- compileClasspath + = main. output
51
- runtimeClasspath + = main. output
52
- }
53
- }
54
- }
55
-
56
- dependencies {
57
- perfCompile ' org.openjdk.jmh:jmh-core:0.2'
55
+ perf
58
56
}
59
57
60
58
tasks. build {
61
- // include 'examples' in build task
59
+ // include 'examples' in build task
62
60
dependsOn(examplesClasses)
63
- // include 'perf' in build task
64
- // dependsOn(perfClasses) //-> Not working so commented out
61
+ }
62
+
63
+ dependencies {
64
+ perfCompile ' org.openjdk.jmh:jmh-core:0.5.3'
65
+ perfCompile ' org.openjdk.jmh:jmh-generator-annprocess:0.5.3'
66
+
67
+ perfCompile project
65
68
}
66
69
67
70
eclipse {
68
- classpath {
69
- // include 'provided' dependencies on the classpath
70
- plusConfigurations + = configurations. provided
71
+ classpath {
71
72
plusConfigurations + = configurations. perfCompile
72
73
73
74
downloadSources = true
74
75
downloadJavadoc = true
75
76
}
76
77
}
77
-
78
+
78
79
idea {
79
80
module {
80
- // include 'provided' dependencies on the classpath
81
- scopes. PROVIDED . plus + = configurations. provided
82
- // TODO not sure what to add it to
83
- // scopes.PROVIDED.plus += configurations.perfCompile
81
+ scopes. PROVIDED . plus + = configurations. perfCompile
82
+ scopes. PROVIDED . minus + = configurations. compile
83
+ }
84
+ }
85
+
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
+ }
84
101
}
102
+
103
+ doLast {
104
+ shadowJar. execute()
105
+ }
106
+
85
107
}
86
108
}
87
109
0 commit comments