forked from ANSIOS-X9SAN-iOS-XR/Real-Time-SDK
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
executable file
·213 lines (174 loc) · 6.2 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
203
204
205
206
207
208
209
210
211
212
213
buildscript {
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
classpath "net.saliman:gradle-cobertura-plugin:2.5.1"
}
}
plugins {
id 'net.saliman.cobertura' version '2.5.1'
id "de.undercouch.download" version "3.4.3"
}
apply plugin: 'net.saliman.cobertura'
subprojects {
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
apply plugin: 'eclipse'
repositories {
mavenCentral()
}
}
//=========================================================================================
//
// RELEASE VERSION, RELEASE DATE AND BINARY PACK INFORMATION ARE
// CONTROLLED BY THE SECTION BELOW
//
//=========================================================================================
ext.YEAR = '2020'
ext.BuildDate = 'Fri Jul 14 12:25:01 CDT ' + "$YEAR"
ext.SpecificationVersion = '3.5.1.0'
ext.SpecificationVersionShort = '3.5.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 = '1.5.1.L1'
//=========================================================================================
//
// END OF SECTION CONTROLLING THE RELEASE INFORMATION
//
//=========================================================================================
ext.vendor = 'Refinitiv'
ext.javadoc_footer = '<a href="https://developers.refinitiv.com/" target=_top>Refinitiv</a>'
ext.javadoc_header = '<a href="https://developers.refinitiv.com/" target=_top>Refinitiv</a>'
ext.javadoc_bottom = '<i>Copyright @ ' + "$YEAR" + ' Refinitiv. All Rights Reserved.</i>'
task downloadBinaryPack(type: Download) {
description 'This task downloads the RTSDK-BinaryPack file from GitHub.'
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 new File('../.', 'RTSDK-BinaryPack.zip')
}
task unzipBinaryPack(dependsOn: downloadBinaryPack, type: Copy) {
ext.temp = new File('../temp')
from zipTree(downloadBinaryPack.dest)
into ext.temp
}
task getBinaryPack () {
// check if we are in GSG package
File gsgDir = file('../RTSDK-BinaryPack')
if (!gsgDir.exists()) {
dependsOn unzipBinaryPack
}
else
{
println "RTSDK-BinaryPack already exists, skip downloading."
}
doLast {
// check if Binary Pack exists
File gsgDirNew = file('../RTSDK-BinaryPack')
if (!gsgDirNew.exists()) {
// move the file
file('../temp/RTSDK-BinaryPack').renameTo(file('../RTSDK-BinaryPack'))
// delete temp directory and downloaded file
unzipBinaryPack.ext.temp.deleteDir()
downloadBinaryPack.dest.delete()
}
}
}
allprojects {
dependencies {
compile group: 'commons-codec', name: 'commons-codec', version: '1.4'
compile group: 'commons-logging', name: 'commons-logging', version: '1.1.1'
compile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'junit', name: 'junit', version: '4.12'
}
compileJava {
options.compilerArgs += ["-Xlint:cast"]
options.compilerArgs += ["-Xlint:deprecation"]
options.compilerArgs += ["-Xlint:divzero"]
options.compilerArgs += ["-Xlint:empty"]
options.compilerArgs += ["-Xlint:fallthrough"]
options.compilerArgs += ["-Xlint:finally"]
options.compilerArgs += ["-Xlint:overrides"]
options.compilerArgs += ["-Xlint:path"]
options.compilerArgs += ["-Xlint:serial"]
options.compilerArgs += ["-Xlint:unchecked"]
}
tasks.withType( JavaCompile ) {
dependsOn getBinaryPack
options.fork = true
options.incremental = true
}
// set the jvmArgs and commandLineArgs for all applications
tasks.withType ( JavaExec ) {
if ( project.hasProperty("vmArgs") ) {
jvmArgs Eval.me( buildArgsList( vmArgs ) )
}
if ( project.hasProperty("commandLineArgs") ) {
args Eval.me( buildArgsList( commandLineArgs ) )
}
}
// set the jvmArgs for junit
tasks.withType ( Test ) {
if ( project.hasProperty("vmArgs") ) {
jvmArgs Eval.me( buildArgsList( vmArgs ) )
}
minHeapSize = "1024m"
maxHeapSize = "2048m"
}
}
wrapper {
gradleVersion = '5.4.1'
}
task uploadAll ( ) {
group 'Upload'
description 'Uploads All artifacts to maven central, run with -Pmavencentral'
if (project.hasProperty("mavencentral"))
{
dependsOn ':Eta:AnsiPage:uploadArchives'
dependsOn ':Eta:Core:uploadArchives'
dependsOn ':Eta:ValueAdd:uploadArchives'
dependsOn ':Eta:ValueAddCache:uploadArchives'
dependsOn ':Ema:Core:uploadArchives'
}
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
def buildArgsList ( options ) {
// remove spaces
def arguments = options.tokenize()
// create a string that can be used by Eval
def cla = "["
// go through the list to get each argument
arguments.each {
cla += "'" + "${it}" + "',"
}
// remove last "," add "]" and set the args
return cla.substring( 0, cla.lastIndexOf(',') ) + "]"
}
// can't use a dynamic date for manifest since it triggers a build each time even when nothing changed
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
jar.enabled = false