-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
185 lines (155 loc) · 4.97 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
buildscript {
repositories {
mavenLocal()
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
}
}
plugins {
id 'java'
id 'maven'
id 'idea'
id 'eclipse'
id 'application'
id 'com.github.hierynomus.license' version '0.13.1'
}
downloadLicenses {
xml = false
report.xml.enabled = false
report.html.destination = file('license-report')
}
license {
includes(["**/*.java","**/*.groovy"])
excludes(['**/*Test.java', '**/*Test.groovy', '**/*Spec.groovy','*logback*.groovy'])
}
task wrapper(type: Wrapper) {
gradleVersion = project.gradleVersion
}
apply plugin: 'com.jfrog.bintray'
group = 'ox.softeng.gel'
sourceCompatibility = 1.8
targetCompatibility = 1.8
logger.quiet "Project: $name > group: $group, version: $version"
repositories {
mavenLocal()
maven {url "http://dl.bintray.com/oxbrcinformatics/maven"}
jcenter()
}
apply from: 'dependencies.gradle'
apply from: 'idea.gradle'
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
/**
* Setup the Unit testing
* Any projects with code plugins will also have test cases, these are all unit tests ONLY
*/
test {
group 'testing'
useJUnit()
systemProperties(['file.encoding': 'UTF-8'])
workingDir = rootDir
maxParallelForks = 20
}
/**
* Define the jar/war manifest
*/
def manifestAttrs = [
"Created-By" : "${JavaVersion.current().toString()} JVM, ${gradle.gradleVersion} Gradle",
"Specification-Title" : "$rootProject.name $project.name Classes",
"Specification-Version" : version,
"Implementation-Title" : "${project.group.toLowerCase()}.${project.name.toLowerCase()}",
"Implementation-Version": "${version}",
"Implementation-Vendor" : "Oxford University",
"Main-Class" : "ox.softeng.gel.filereceive.FileReceive",
]
mainClassName="ox.softeng.gel.filereceive.FileReceive"
applicationDefaultJvmArgs = ["-DapplicationVersion=${version}"]
// If supplied any default args then pass them into run scripts
if (project.hasProperty('defaultApplicationJvmArgs'))
applicationDefaultJvmArgs += ((String) defaultApplicationJvmArgs).split(',')
installDist {
if(System.env.FILE_RECEIVER_INSTALL_DIR){
destinationDir = file(System.env.FILE_RECEIVER_INSTALL_DIR)
}
outputs.upToDateWhen{ false}
doLast{
logger.quiet "Installed application to {}", destinationDir
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
group 'build'
classifier = 'sources'
from sourceSets.main.allSource
}
tasks.javadoc.failOnError false
task javadocJar(type: Jar, dependsOn: javadoc) {
group 'build'
classifier = 'javadoc'
from javadoc.destinationDir
}
clean {
delete 'logs'
}
/**
* Add jars as artifacts, this will cause them to be built as part of assemble and will automatically be
* included as part of the publishing mechanism.
* For some reason, some change made has meant that any tars included stop the automatic addition of the standard
* jar file, therefore we define it as required.
*/
artifacts {
archives sourcesJar
archives javadocJar
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
pkg {
repo = 'maven'
name = project.name
userOrg = 'oxbrcinformatics'
licenses = ['Apache-2.0']
websiteUrl = 'https://github.com/OxBRCInformatics/file-receiver'
vcsUrl = 'https://github.com/OxBRCInformatics/file-receiver'
githubRepo = 'OxBRCInformatics/file-receiver'
githubReleaseNotesFile = 'README.md'
version {
name = project.version
desc = "File Receive - ${project.name} ${project.version}"
released = new Date()
vcsTag = "${project.version}"
}
}
configurations = ['archives']
dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
}
afterEvaluate {
/*
* Set up compile tasks to use default encoding and other compile options.
*/
tasks.withType(JavaCompile) {JavaCompile compile ->
compile.options.encoding = 'UTF-8'
//compile.options.incremental = useIncrementalJavaBuilding.toBoolean()
compile.options.compilerArgs.add('-Xlint:unchecked')
compile.options.compilerArgs.add('-Xlint:deprecation')
}
tasks.withType(GroovyCompile) {GroovyCompile compile ->
compile.groovyOptions.encoding = 'UTF-8'
compile.options.encoding = 'UTF-8'
compile.groovyOptions.keepStubs = true
compile.groovyOptions.stubDir = file("$buildDir/stubs")
compile.groovyOptions.optimizationOptions.put('all', true)
}
tasks.withType(Jar) {
jar {
manifest {
attributes(manifestAttrs)
}
sourceCompatibility = project.sourceCompatibility
}
}
}