-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
155 lines (131 loc) · 4.65 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
plugins {
id("java-library")
id("checkstyle")
id("eclipse")
id("jacoco")
id("maven-publish")
id("ru.vyarus.animalsniffer") version "1.7.1"
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"
// id("org.beryx.jar") version "2.0.0"
}
jacoco {
toolVersion = "0.8.8"
}
build.dependsOn jacocoTestReport
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")
]
}
check.dependsOn jacocoTestReport
group = "com.github.akarnokd"
// Eclipse Buildship doesn't support higher targets when importing
def targetVer = 19
if (project.hasProperty("targetVer")) {
targetVer = project.targetVer;
logger.lifecycle("Overriding Target Version: " + project.targetVer)
}
sourceCompatibility = targetVer
targetCompatibility = targetVer
repositories {
mavenCentral()
}
dependencies {
implementation "io.reactivex.rxjava3:rxjava:3.1.8"
testImplementation "org.reactivestreams:reactive-streams-tck:1.0.4"
testImplementation "org.testng:testng:7.6.0"
testImplementation "com.beust:jcommander:1.82"
}
compileJava.options.fork = true
compileTestJava.options.fork = true
def loomDir = System.getenv("LOOM_JDK")
if (System.getenv("CI") != null) {
println("Overriding JDK on CI");
compileJava.options.forkOptions.executable = project.file(".").absolutePath + "/" + loomDir + "/bin/javac"
javadoc.executable = project.file(".").absolutePath + "/" + loomDir + "/bin/javadoc"
test.executable = project.file(".").absolutePath + "/" + loomDir + "/bin/java"
println(test.executable)
} else {
println("Overriding JDK on local machine");
if (loomDir == null || "".equals(loomDir)) {
loomDir = "jdk-14-loom"
}
if (System.properties['os.name'].toLowerCase().contains('windows')) {
println "it's Windows"
compileJava.options.forkOptions.executable = "c:/work/" + loomDir + "/bin/javac.exe"
javadoc.executable = "c:/work/" + loomDir + "/bin/javadoc.exe"
test.executable = "c:/work/" + loomDir + "/bin/java.exe"
} else {
println "it's Linux probably"
def uname = System.properties['user.home']
compileJava.options.forkOptions.executable = uname + "/" + loomDir + "/bin/javac"
javadoc.executable = uname + "/" + loomDir + "/bin/javadoc"
test.executable = uname + "/" + loomDir + "/bin/java"
}
}
compileTestJava.options.forkOptions.executable = compileJava.options.forkOptions.executable
def testExecutable = test.executable
tasks.withType(JavaCompile) {
options.compilerArgs << "-parameters"
// options.compilerArgs << "--enable-preview"
}
/*
moduleConfig {
moduleInfoPath = 'src/main/module/module-info.java'
multiReleaseVersion = 21
version = project.version
}
*/
jar {
from('.') {
include 'LICENSE'
include 'COPYRIGHT'
into('META-INF/')
}
// Cover for bnd still not supporting MR Jars: https://github.com/bndtools/bnd/issues/2227
bnd('-fixupmessages': '^Classes found in the wrong directory: \\\\{META-INF/versions/9/module-info\\\\.class=module-info}$')
bnd (
'Bundle-Name': 'rxjava-fiber-interop',
'Bundle-Vendor': 'akarnokd',
'Bundle-Description': 'Library to interoperate between RxJava 3 and Fibers',
'Import-Package': '!org.junit,!junit.framework,!org.mockito.*,!org.testng.*,*',
'Bundle-DocURL': 'https://github.com/akarnokd/RxJavaFiberInterop',
"Bundle-SymbolicName": "hu.akarnokd.rxjava3.fibers",
"Export-Package": "hu.akarnokd.rxjava3.fibers.*",
"Multi-Release": "true"
)
}
test {
useTestNG()
executable = testExecutable
jvmArgs "--enable-preview"
jacoco.includes = ["**akarnokd**"]
testLogging {
events=["skipped", "failed", "standard_error"]
exceptionFormat="full"
debug.events = ["skipped", "failed"]
debug.exceptionFormat="full"
info.events = ["failed", "skipped"]
info.exceptionFormat="full"
warn.events = ["failed", "skipped"]
warn.exceptionFormat="full"
}
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
jacocoTestReport.dependsOn test
license {
header rootProject.file('HEADER')
skipExistingHeaders true
ignoreFailures true
excludes(["**/*.md", "**/*.txt"])
}