@@ -12,8 +12,8 @@ buildscript {
12
12
mavenCentral()
13
13
jcenter()
14
14
}
15
-
16
- apply from : file(' gradle/buildscript.gradle' ), to : buildscript
15
+
16
+ apply from : file(' gradle/buildscript.gradle' ), to : buildscript
17
17
}
18
18
19
19
allprojects {
@@ -27,6 +27,7 @@ allprojects {
27
27
28
28
subprojects {
29
29
apply plugin : ' java'
30
+ apply plugin : ' shadow'
30
31
group = " com.netflix.rxjava"
31
32
32
33
// make 'examples' use the same classpath
@@ -45,22 +46,29 @@ subprojects {
45
46
sourceSets {
46
47
examples
47
48
perf {
48
- compileClasspath + = sourceSets. main. output
49
- }
49
+ compileClasspath + = sourceSets. main. output
50
+ }
50
51
}
51
52
52
53
tasks. build {
53
54
// include 'examples' in build task
54
55
dependsOn(examplesClasses)
55
- dependsOn(perfClasses)
56
+ dependsOn(perfClasses)
57
+ }
58
+
59
+ task perfJar(type : Jar , dependsOn : perfClasses) {
60
+ from sourceSets. perf. output + sourceSets. main. output
56
61
}
57
62
58
63
dependencies {
59
64
perfCompile ' org.openjdk.jmh:jmh-core:0.5.3'
60
65
perfCompile ' org.openjdk.jmh:jmh-generator-annprocess:0.5.3'
61
-
62
66
// perfCompile project
63
67
}
68
+
69
+ artifacts {
70
+ perfRuntime perfJar
71
+ }
64
72
65
73
eclipse {
66
74
classpath {
@@ -78,49 +86,59 @@ subprojects {
78
86
}
79
87
}
80
88
81
- /**
82
- * By default: Run without arguments this will execute all benchmarks that are found (can take a long time).
83
- *
84
- * Optionally pass arguments for custom execution. Example:
85
- *
86
- * ../gradlew benchmarks '-Pjmh=-f 1 -tu ns -bm avgt -wi 5 -i 5 -r 1 .*OperatorSerializePerf.*'
87
- *
88
- * To see all options:
89
- *
90
- * ../gradlew benchmarks '-Pjmh=-h'
91
- */
92
- task benchmarks(type : JavaExec ) {
93
- main = ' org.openjdk.jmh.Main'
94
- classpath = sourceSets. perf. runtimeClasspath + sourceSets. main. output
95
- maxHeapSize = " 512m"
96
-
97
- if (project. hasProperty(' jmh' )) {
98
- args(jmh. split(' ' ))
99
- } else {
100
- // args '-h' // help output
101
- args ' -f' // fork
102
- args ' 1'
103
- args ' -tu' // time unit
104
- args ' ns'
105
- args ' -bm' // benchmark mode
106
- args ' avgt'
107
- args ' -wi' // warmup iterations
108
- args ' 5'
109
- args ' -i' // test iterations
110
- args ' 5'
111
- args ' -r' // time per execution in seconds
112
- args ' 5'
113
- // args '-prof' // profilers
114
- // args 'HS_GC' // HotSpot (tm) memory manager (GC) profiling via implementation-specific MBeans
115
- // args 'HS_RT' // HotSpot (tm) runtime profiling via implementation-specific MBeans
116
- // args 'HS_THR' // HotSpot (tm) threading subsystem via implementation-specific MBeans
117
- // args 'HS_COMP' // HotSpot (tm) JIT compiler profiling via implementation-specific MBeans
118
- // args 'HS_CL' // HotSpot (tm) classloader profiling via implementation-specific MBeans
119
- // args 'STACK' // Simple and naive Java stack profiler
120
- args ' .*OperatorSerializePerf.*' // for running only a specific test
121
- }
122
- }
123
-
89
+ /**
90
+ * By default: Run without arguments this will execute all benchmarks that are found (can take a long time).
91
+ *
92
+ * Optionally pass arguments for custom execution. Example:
93
+ *
94
+ * ../gradlew benchmarks '-Pjmh=-f 1 -tu ns -bm avgt -wi 5 -i 5 -r 1 .*OperatorSerializePerf.*'
95
+ *
96
+ * To see all options:
97
+ *
98
+ * ../gradlew benchmarks '-Pjmh=-h'
99
+ */
100
+ task benchmarks(type : JavaExec ) {
101
+ main = ' org.openjdk.jmh.Main'
102
+ classpath = sourceSets. perf. runtimeClasspath + sourceSets. main. output
103
+ maxHeapSize = " 512m"
104
+
105
+ if (project. hasProperty(' jmh' )) {
106
+ args(jmh. split(' ' ))
107
+ } else {
108
+ // args '-h' // help output
109
+ args ' -f' // fork
110
+ args ' 1'
111
+ args ' -tu' // time unit
112
+ args ' ns'
113
+ args ' -bm' // benchmark mode
114
+ args ' avgt'
115
+ args ' -wi' // warmup iterations
116
+ args ' 5'
117
+ args ' -i' // test iterations
118
+ args ' 5'
119
+ args ' -r' // time per execution in seconds
120
+ args ' 5'
121
+ // args '-prof' // profilers
122
+ // args 'HS_GC' // HotSpot (tm) memory manager (GC) profiling via implementation-specific MBeans
123
+ // args 'HS_RT' // HotSpot (tm) runtime profiling via implementation-specific MBeans
124
+ // args 'HS_THR' // HotSpot (tm) threading subsystem via implementation-specific MBeans
125
+ // args 'HS_COMP' // HotSpot (tm) JIT compiler profiling via implementation-specific MBeans
126
+ // args 'HS_CL' // HotSpot (tm) classloader profiling via implementation-specific MBeans
127
+ // args 'STACK' // Simple and naive Java stack profiler
128
+ args ' .*OperatorSerializePerf.*' // for running only a specific test
129
+ }
130
+ }
131
+
132
+ shadow {
133
+ classifier = " benchmarks"
134
+ includeDependenciesFor = [" runtime" , " perfRuntime" ]
135
+
136
+ transformer(com.github.jengelman.gradle.plugins.shadow.transformers.ManifestResourceTransformer ) {
137
+ mainClass = " org.openjdk.jmh.Main"
138
+ }
139
+ }
140
+
141
+ shadowJar. dependsOn perfJar
124
142
}
125
143
126
144
project(' :rxjava-core' ) {
0 commit comments