forked from ReactiveX/RxJava
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
147 lines (124 loc) · 4.08 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
ext.githubProjectName = 'RxJava'
apply from: file('gradle/convention.gradle')
apply from: file('gradle/maven.gradle')
//apply from: file('gradle/check.gradle')
apply from: file('gradle/license.gradle')
apply from: file('gradle/release.gradle')
buildscript {
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
apply from: file('gradle/buildscript.gradle'), to: buildscript
}
allprojects {
apply plugin: 'eclipse'
apply plugin: 'idea'
repositories {
mavenLocal()
mavenCentral()
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'shadow'
group = "com.netflix.rxjava"
// everything defaults to 1.6
sourceCompatibility = JavaVersion.VERSION_1_6
targetCompatibility = JavaVersion.VERSION_1_6
// make 'examples' use the same classpath
configurations {
examplesCompile.extendsFrom compile
examplesRuntime.extendsFrom runtime
perfCompile.extendsFrom compile
perfRuntime.extendsFrom runtime
}
tasks.withType(Javadoc).each {
it.classpath = sourceSets.main.compileClasspath
}
sourceSets {
examples
perf {
compileClasspath += sourceSets.main.output
}
}
tasks.build {
//include 'examples' in build task
dependsOn(examplesClasses)
dependsOn(perfClasses)
}
task perfJar(type: Jar, dependsOn: perfClasses) {
from sourceSets.perf.output + sourceSets.main.output
}
dependencies {
perfCompile 'org.openjdk.jmh:jmh-core:0.9'
perfCompile 'org.openjdk.jmh:jmh-generator-annprocess:0.9'
}
artifacts {
perfRuntime perfJar
}
eclipse {
classpath {
plusConfigurations += configurations.perfCompile
downloadSources = true
downloadJavadoc = true
}
}
idea {
module {
scopes.PROVIDED.plus += configurations.perfCompile
scopes.PROVIDED.minus += configurations.compile
}
}
/**
* By default: Run without arguments this will execute all benchmarks that are found (can take a long time).
*
* Optionally pass arguments for custom execution. Example:
*
* ../gradlew benchmarks '-Pjmh=-f 1 -tu ns -bm avgt -wi 5 -i 5 -r 1 .*OperatorSerializePerf.*'
*
* To see all options:
*
* ../gradlew benchmarks '-Pjmh=-h'
*/
task benchmarks(type: JavaExec) {
main = 'org.openjdk.jmh.Main'
classpath = sourceSets.perf.runtimeClasspath + sourceSets.main.output
maxHeapSize = "512m"
jvmArgs '-XX:+UnlockCommercialFeatures'
jvmArgs '-XX:+FlightRecorder'
jvmArgs '-XX:AutoBoxCacheMax=1000000'
if (project.hasProperty('jmh')) {
args(jmh.split(' '))
} else {
//args '-h' // help output
args '-f' // fork
args '1'
args '-wi' // warmup iterations
args '5'
args '-i' // test iterations
args '5'
args '-r' // time per execution in seconds
args '5'
//args '-prof' // profilers
//args 'HS_GC' // HotSpot (tm) memory manager (GC) profiling via implementation-specific MBeans
//args 'HS_RT' // HotSpot (tm) runtime profiling via implementation-specific MBeans
//args 'HS_THR' // HotSpot (tm) threading subsystem via implementation-specific MBeans
//args 'HS_COMP' // HotSpot (tm) JIT compiler profiling via implementation-specific MBeans
//args 'HS_CL' // HotSpot (tm) classloader profiling via implementation-specific MBeans
//args 'STACK' // Simple and naive Java stack profiler
}
}
shadow {
classifier = "benchmarks"
includeDependenciesFor = ["runtime", "perfRuntime"]
transformer(com.github.jengelman.gradle.plugins.shadow.transformers.ManifestResourceTransformer) {
mainClass = "org.openjdk.jmh.Main"
}
}
shadowJar.dependsOn perfJar
}
project(':rxjava-core') {
sourceSets.test.java.srcDir 'src/test/java'
}