-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.gradle
More file actions
176 lines (147 loc) · 4.91 KB
/
build.gradle
File metadata and controls
176 lines (147 loc) · 4.91 KB
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
version '1.0-SNAPSHOT'
buildscript {
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:6.3.1"
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.0'
classpath "gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1"
}
}
apply plugin: 'java'
apply plugin: 'jacoco'
jacoco {
toolVersion = "0.8.8"
}
build.dependsOn jacocoTestReport
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()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'https://oss.jfrog.org/libs-snapshot' }
}
dependencies {
implementation "io.reactivex.rxjava3:rxjava:3.1.6"
testImplementation "org.reactivestreams:reactive-streams-tck:1.0.3"
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 = "./" + loomDir + "/bin/javac"
javadoc.executable = "./" +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"
}
apply plugin: 'biz.aQute.bnd.builder'
jar {
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.*,*',
'Bundle-DocURL': 'https://github.com/akarnokd/RxJavaFiberInterop')
}
apply plugin: "com.vanniktech.maven.publish"
test {
/*
jvmArgs "--enable-preview"
maxHeapSize = "1g"
testLogging {
events "started", "failed", "standard_error" // "skipped", "passed"
exceptionFormat="full"
// showStandardStreams = true
}
jacoco.includes = ["**akarnokd**"]
*/
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"
}
}
/*
task testng(type: 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
}
//executionData testng
}
//check.dependsOn testng
jacocoTestReport.dependsOn test
//jacocoTestReport.dependsOn testng
apply plugin: "com.github.hierynomus.license"
license {
header rootProject.file('HEADER')
skipExistingHeaders true
ignoreFailures true
excludes(["**/*.md", "**/*.txt"])
}