-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathbuild.gradle
More file actions
executable file
·250 lines (209 loc) · 7.07 KB
/
Copy pathbuild.gradle
File metadata and controls
executable file
·250 lines (209 loc) · 7.07 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
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.util.GradleVersion
buildscript {
repositories {
mavenCentral()
maven { url = uri("https://central.sonatype.com/repository/maven-snapshots") }
}
}
plugins {
id "de.undercouch.download" version "4.1.2"
}
subprojects {
apply plugin: 'java'
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
apply plugin: 'eclipse'
repositories {
mavenCentral()
}
}
repositories {
mavenCentral()
}
//=========================================================================================
//
// RELEASE VERSION, RELEASE DATE AND BINARY PACK INFORMATION ARE
// CONTROLLED BY THE SECTION BELOW
//
//=========================================================================================
ext.YEAR = '2026'
ext.BuildDate = 'Thr Sep 16 20:00:00 CDT ' + "$YEAR"
ext.SpecificationVersion = '3.10.1.0'
ext.SpecificationVersionShort = '3.10.1'
// Comment out line below to publish offical release
// ext.SpecificationVersion = "$SpecificationVersion" + "-SNAPSHOT"
// Update below to L1.all.rrg, G1.all.gload, or E1.all.eload when needed
ext.etaImplementationVersion = 'etaj' + "$SpecificationVersionShort" + '.L1.all.rrg'
ext.emaImplementationVersion = 'emaj' + "$SpecificationVersionShort" + '.L1.all.rrg'
// NOTE! update with new asset version
ext.BINARY_PACK_VERSION_TO_DOWNLOAD = '2.4.1.L1'
//=========================================================================================
//
// END OF SECTION CONTROLLING THE RELEASE INFORMATION
//
//=========================================================================================
ext.vendor = 'LSEG'
ext.javadoc_footer = '<a href="https://developers.lseg.com/" target=_top>LSEG</a>'
ext.javadoc_header = '<a href="https://developers.lseg.com/" target=_top>LSEG</a>'
ext.javadoc_bottom = '<i>Copyright @ ' + "$YEAR" + ' LSEG. All Rights Reserved.</i>'
def binaryPackDir = file('../RTSDK-BinaryPack')
def binaryPackTempDir = file('../temp')
def binaryPackZip = file('../RTSDK-BinaryPack.zip')
def downloadBinaryPack = tasks.register('downloadBinaryPack', Download) {
description = 'This task downloads the RTSDK-BinaryPack file from GitHub.'
onlyIf { !binaryPackDir.exists() }
def releaseToDownload = "RTSDK-BinaryPack-${BINARY_PACK_VERSION_TO_DOWNLOAD}"
def zipFileToDownload = "${releaseToDownload}.zip"
src("https://github.com/Refinitiv/Real-Time-SDK/releases/download/Real-Time-SDK-${BINARY_PACK_VERSION_TO_DOWNLOAD}/${zipFileToDownload}")
dest(binaryPackZip)
}
def unzipBinaryPack = tasks.register('unzipBinaryPack', Copy) {
dependsOn(downloadBinaryPack)
onlyIf { !binaryPackDir.exists() }
ext.temp = binaryPackTempDir
from({ zipTree(downloadBinaryPack.get().dest) })
into(binaryPackTempDir)
}
def getBinaryPack = tasks.register('getBinaryPack') {
dependsOn(unzipBinaryPack)
doFirst {
if (binaryPackDir.exists()) {
println 'RTSDK-BinaryPack already exists, skip downloading.'
}
}
doLast {
// check if Binary Pack exists
if (!binaryPackDir.exists()) {
// move the file
file('../temp/RTSDK-BinaryPack').renameTo(binaryPackDir)
// delete temp directory and downloaded file
binaryPackTempDir.deleteDir()
binaryPackZip.delete()
}
}
}
allprojects {
apply plugin: 'java'
dependencies {
testImplementation ('junit:junit:4.13.2') {
exclude group: 'org.hamcrest'
}
testImplementation 'org.hamcrest:hamcrest:3.0'
testImplementation 'org.mockito:mockito-core:5.23.0'
}
tasks.named('compileJava', JavaCompile).configure {
options.compilerArgs += [
"-Xlint:cast",
"-Xlint:deprecation",
"-Xlint:divzero",
"-Xlint:empty",
"-Xlint:fallthrough",
"-Xlint:finally",
"-Xlint:overrides",
"-Xlint:path",
"-Xlint:serial",
"-Xlint:unchecked",
"-Xlint:-options"
] // suppresses warning "warning: [options] source value 8 is obsolete and will be removed in a future release"
}
tasks.withType(JavaCompile).configureEach {
dependsOn(getBinaryPack)
options.fork = true
options.incremental = true
}
// set the jvmArgs and commandLineArgs for all applications
tasks.withType(JavaExec).configureEach {
if (project.hasProperty("vmArgs")) {
jvmArgs(buildArgsList(vmArgs))
}
if (project.hasProperty("commandLineArgs")) {
args(buildArgsList(commandLineArgs))
}
}
// set the jvmArgs for junit
tasks.withType(Test).configureEach {
if (project.hasProperty("vmArgs")) {
jvmArgs(buildArgsList(vmArgs))
}
minHeapSize = "1024m"
maxHeapSize = "2048m"
testLogging {
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT
exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
addTestListener(new TestListener() {
@Override
void beforeSuite(TestDescriptor suite) {}
@Override
void beforeTest(TestDescriptor testDescriptor) {}
@Override
void afterTest(TestDescriptor testDescriptor, TestResult result) {}
@Override
void afterSuite(TestDescriptor desc, TestResult result) {
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| '
def endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
})
}
}
wrapper {
if (GradleVersion.current() < GradleVersion.version("8.9")) {
throw new GradleException("This project requires Gradle 8.9 or higher. Please upgrade your Gradle version.")
}
}
tasks.register('uploadAll') {
group = 'Upload'
description = 'Uploads All artifacts to maven central, run with -Pmavencentral'
if (project.hasProperty("mavencentral"))
{
dependsOn ':Eta:AnsiPage:publish'
dependsOn ':Eta:Core:publish'
dependsOn ':Eta:ValueAdd:publish'
dependsOn ':Eta:ValueAddCache:publish'
dependsOn ':Eta:Converter:publish'
dependsOn ':Ema:Core:publish'
}
else
{
doLast {
println ""
println "/////////////////////////////////////////////////////////"
println ""
println "This task needs to be run with -Pmavencentral option"
println "Exiting without publishing to Maven Central"
println ""
println "/////////////////////////////////////////////////////////"
println ""
}
}
}
// this method creates a list of arguments that are used in setting the jvmArgs and commandLineArgs
static List<String> buildArgsList(options) {
return options?.toString()?.tokenize() ?: []
}
// can't use a dynamic date for manifest since it triggers a build each time even when nothing changed
static def getDate() {
def date = new Date()
def formattedDate = date.format('E MMM dd HH:mm:ss z yyyy ')
return formattedDate
}
// disable creating empty Java.jar file
tasks.named('jar').configure {
enabled = false
}