This repository has been archived by the owner on Jul 31, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
198 lines (165 loc) · 5.09 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
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.netflix.nebula:nebula-dependency-recommender:7.5.6'
classpath 'com.netflix.nebula:nebula-publishing-plugin:9.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'org.starchartlabs.flare:flare-operations-plugins:2.0.0'
classpath 'org.starchartlabs.flare:flare-publishing-plugins:2.0.0'
}
}
apply plugin: 'eclipse'
apply plugin: 'java-gradle-plugin'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
apply plugin: 'maven-publish'
apply plugin: 'nebula.dependency-recommender'
apply plugin: 'nebula.maven-resolved-dependencies'
apply plugin: 'nebula.maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'org.starchartlabs.flare.increase-test-logging'
apply plugin: 'org.starchartlabs.flare.published-project'
// Putting this in gradle.properties breaks the build, because this uses it's own releases
group = 'org.starchartlabs.flare'
description = 'Gradle tasks and utilities for build and test operations'
dependencyRecommendations {
propertiesFile file: file("${rootDir}/dependencies.properties")
}
//Always download sources, to allow debugging, and use Eclipse containers for greater portability
eclipse {
classpath {
downloadSources=true
}
}
//JCenter is the Gradle plug-in standard
repositories {
jcenter()
}
//Dependency versions managed in $rootDir/dependencies.lock
dependencies {
compile gradleApi()
compile 'org.starchartlabs.alloy:alloy-core'
testCompile gradleTestKit()
testCompile 'org.testng:testng'
}
checkstyle {
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
configProperties = [ 'checkstyle.config.dir' : rootProject.file('config/checkstyle') ]
toolVersion = '8.18'
}
task checkstyleAll{}
tasks.withType(Checkstyle).all { checkstyleTask -> checkstyleAll.dependsOn checkstyleTask }
check.dependsOn checkstyleAll
//Add LICENSE so it is included in all JARs, fulfilling the "distributions include license" requirement
jar{
from("${rootDir}"){
include 'LICENSE'
}
}
//All projects should provide source code and javadoc, and upload these with any released artifacts
sourcesJar{
from("${rootDir}"){
include 'LICENSE'
}
}
javadocJar{
from("${rootDir}"){
include 'LICENSE'
}
}
//Setup default test behavior, including failure logging
test {
useTestNG() {
useDefaultListeners = true
}
}
jacocoTestReport {
reports {
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
sourceSets project.sourceSets.main
xml.enabled true
csv.enabled false
html.enabled false
xml.destination file("${buildDir}/reports/jacoco/report.xml")
}
}
jacocoTestReport.dependsOn test
check.dependsOn jacocoTestReport
//If not a remote run, publish to local only
if(!project.hasProperty('remoteDeploy')){
publishing {
repositories {
mavenLocal()
}
}
}
publishedInfo{
url = 'https://github.com/StarChart-Labs/flare-operations-plugins'
scm{
github 'StarChart-Labs', 'flare-operations-plugins'
}
licenses{
mit('repo')
}
developers{
github 'romeara', 'Ryan OMeara'
}
}
publishing {
publications {
nebula(MavenPublication) {
pom {
url = "${publishedInfo.url}"
licenses {
publishedInfo.licenses.each { lic ->
license {
name = "${lic.name}"
url = "${lic.url}"
distribution = "${lic.distribution}"
}
}
}
developers {
publishedInfo.developers.each{ dev ->
developer {
id = "${dev.id}"
name = "${dev.name}"
email = "${dev.url}"
}
}
}
scm {
connection = "${publishedInfo.scm.connection}"
developerConnection = "${publishedInfo.scm.developerConnection}"
url = "${publishedInfo.scm.url}"
}
}
}
}
}
bintray {
user = System.getProperty('bintray_user')
key = System.getProperty('bintray_key')
publications = [ 'nebula' ]
if(!project.hasProperty('remoteDeploy')){
dryRun = true
}
pkg {
repo = 'flare'
name = "${project.name}"
userOrg = 'starchart-labs'
licenses = ['MIT']
vcsUrl = 'https://github.com/StarChart-Labs/flare-operations-plugins.git'
version {
name = "${project.version}"
desc = "${project.name} release ${project.version} final"
released = new Date()
vcsTag = "v${project.version}"
gpg {
sign = true
}
}
}
}