-
Notifications
You must be signed in to change notification settings - Fork 51
/
build.gradle
160 lines (128 loc) · 3.91 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
148
149
150
151
152
153
154
155
156
157
158
159
160
plugins {
id("java-library")
id("checkstyle")
id("eclipse")
id("jacoco")
id("maven-publish")
id("pmd")
id("ru.vyarus.animalsniffer") version "1.6.0"
id("me.champeau.gradle.jmh") version "0.5.3"
id("com.github.hierynomus.license") version "0.16.1"
id("biz.aQute.bnd.builder") version "6.4.0"
id("com.vanniktech.maven.publish") version "0.19.0"
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
group = "com.github.akarnokd"
ext.githubProjectName = 'RxJavaExtensions'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
if (!hasProperty('mainClass')) {
ext.mainClass = ''
}
repositories {
mavenCentral()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://oss.sonatype.org/content/groups/public' }
maven { url 'https://repo.spring.io/libs-snapshot' }
}
dependencies {
signature 'org.codehaus.mojo.signature:java18:1.0@signature'
api "org.reactivestreams:reactive-streams:1.0.4"
api "io.reactivex.rxjava3:rxjava:3.1.6"
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation 'org.mockito:mockito-core:4.9.0'
}
apply plugin: 'biz.aQute.bnd.builder'
jar {
bnd ('Bundle-Name': 'rxjava3-extensions',
'Bundle-Vendor': 'akarnokd',
'Bundle-Description': 'RxJava 3.x extra sources, operators and components and ports of many 1.x companion libraries.',
'Import-Package': '!org.junit,!junit.framework,!org.mockito.*,*',
'Bundle-DocURL': 'https://github.com/akarnokd/RxJavaExtensions')
}
checkstyle {
configFile = project.file("config/checkstyle/checkstyle.xml")
configProperties = [
"checkstyle.suppressions.file": project.file("config/checkstyle/suppressions.xml"),
"checkstyle.header.file" : project.file("config/license/HEADER_JAVA")
]
}
apply plugin: "com.vanniktech.maven.publish"
jmh {
jmhVersion = '1.21'
humanOutputFile = null
if (project.hasProperty('jmh')) {
include = ".*" + project.jmh + ".*"
} else {
include = ".*"
}
}
plugins.withType(EclipsePlugin) {
project.eclipse.classpath.plusConfigurations += [ configurations.jmh ]
}
javadoc {
failOnError = false
options.stylesheetFile = new File(projectDir, "gradle/stylesheet.css");
options.links(
"https://docs.oracle.com/javase/7/docs/api/",
"http://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/",
"http://reactivex.io/RxJava/3.x/javadoc/"
)
}
test {
maxHeapSize = "2g"
testLogging {
events "started", "failed" // "skipped", "passed"
// showStandardStreams = true
exceptionFormat="full"
}
}
license {
header rootProject.file('config/license/HEADER')
ext.year = Calendar.getInstance().get(Calendar.YEAR)
skipExistingHeaders true
ignoreFailures true
excludes(["**/*.md", "**/*.txt"])
}
jacoco {
toolVersion = '0.8.5' // See http://www.eclemma.org/jacoco/.
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
build.dependsOn jacocoTestReport
check.dependsOn jacocoTestReport
pmd {
toolVersion = '6.21.0'
ignoreFailures = true
sourceSets = [sourceSets.main]
ruleSets = []
ruleSetFiles = files('pmd.xml')
}
pmdMain {
reports {
html.enabled = true
xml.enabled = true
}
}
task pmdPrint(dependsOn: 'pmdMain') doLast {
File file = rootProject.file('build/reports/pmd/main.xml')
if (file.exists()) {
println("Listing first 100 PMD violations")
file.eachLine { line, count ->
if (count <= 100) {
println(line)
}
}
} else {
println("PMD file not found.")
}
}
build.dependsOn pmdPrint
check.dependsOn pmdPrint
animalsniffer {
annotation = 'io.reactivex.rxjava3.internal.util.SuppressAnimalSniffer'
}