This repository has been archived by the owner on May 23, 2024. It is now read-only.
forked from akarnokd/RxJavaInterop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
202 lines (166 loc) · 4.48 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.14.0'
classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.4"
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.2.0'
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: "me.champeau.gradle.jmh"
apply plugin: 'pmd'
apply plugin: 'jacoco'
apply plugin: 'ru.vyarus.animalsniffer'
apply plugin: "com.github.hierynomus.license"
sourceCompatibility = '1.6'
targetCompatibility = '1.6'
group = "com.github.akarnokd"
ext.githubProjectName = 'rxjava3-interop'
[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://oss.jfrog.org/libs-snapshot' }
maven { url 'http://repo.spring.io/libs-snapshot' }
}
apply from: file('gradle/maven.gradle')
apply plugin: 'maven'
apply plugin: 'osgi'
dependencies {
signature 'org.codehaus.mojo.signature:java16:1.1@signature'
compile "org.reactivestreams:reactive-streams:1.0.2"
compile "io.reactivex:rxjava:1.3.8"
compile "io.reactivex.rxjava3:rxjava:3.0.0-RC1"
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile 'org.mockito:mockito-core:3.0.0'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
//uploadMavenCentral {
// repositories {
// mavenDeployer {
// pom.whenConfigured {
// p -> p.dependencies = p.dependencies.findAll {
// dep -> dep.artifactId != "rxjava"
// }
// }
// }
// }
//}
jar {
manifest {
name = 'rxjava3-interop'
instruction 'Bundle-Vendor', 'akarnokd'
instruction 'Bundle-DocURL', 'https://github.com/akarnokd/RxJavaInterop'
instruction 'Import-Package', '!org.junit,!junit.framework,!org.mockito.*,*'
instruction 'Eclipse-ExtensibleAPI', 'true'
}
}
apply plugin: 'maven-publish'
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact (sourcesJar) {
classifier = 'sources'
}
}
}
}
jmh {
jmhVersion = '1.19'
humanOutputFile = null
if (project.hasProperty('jmh')) {
include = ".*" + project.jmh + ".*"
} else {
include = ".*"
}
}
plugins.withType(EclipsePlugin) {
project.eclipse.classpath.plusConfigurations += [ configurations.jmh ]
}
javadoc {
failOnError = false
options.links(
"http://docs.oracle.com/javase/7/docs/api/",
"http://reactivex.io/RxJava/1.x/javadoc",
"http://reactivex.io/RxJava/3.x/javadoc"
)
}
test {
maxHeapSize = "2g"
testLogging {
events "started", "failed" // "skipped", "passed"
// showStandardStreams = true
}
}
license {
header rootProject.file('HEADER')
ext.year = Calendar.getInstance().get(Calendar.YEAR)
skipExistingHeaders true
ignoreFailures true
excludes(["**/*.md", "**/*.txt"])
}
jacoco {
toolVersion = '0.7.9' // See http://www.eclemma.org/jacoco/.
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
build.dependsOn jacocoTestReport
check.dependsOn jacocoTestReport
pmd {
toolVersion = '5.4.2'
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 = 'rx.internal.util.SuppressAnimalSniffer'
}