-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
207 lines (172 loc) · 7.14 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
plugins {
id 'java-gradle-plugin'
id 'eclipse'
id 'jacoco'
id 'checkstyle'
id 'maven-publish'
id 'com.gradle.plugin-publish' version '1.2.0'
}
// Putting this in gradle.properties breaks the build, because this uses it's own releases
group = 'org.starchartlabs.flare'
description = 'Gradle plug-ins with opinioniated defaults to allow streamlined, consistent operations'
// Always download sources, to allow debugging, and use Eclipse containers for greater portability
eclipse {
classpath {
downloadSources = true
}
}
// JCenter is the Gradle plug-in standard, fallback to maven central
repositories {
jcenter()
}
// Force use of certain transitive dependencies for security fixes
configurations.all {
resolutionStrategy {
force 'com.fasterxml.jackson.core:jackson-databind:2.9.9', 'com.fasterxml.jackson.core:jackson-databind:2.10.1'
force 'commons-beanutils:commons-beanutils:1.9.3', 'commons-beanutils:commons-beanutils:1.9.4'
force 'xerces:xercesImpl:2.9.1', 'xerces:xercesImpl:2.12.0'
force 'org.apache.httpcomponents:httpclient:4.2.1', 'org.apache.httpcomponents:httpclient:4.2.6'
}
}
dependencies {
compile gradleApi()
compile 'org.starchartlabs.alloy:alloy-core:0.5.0'
testCompile gradleTestKit()
testCompile 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.10.1'
testCompile 'org.mockito:mockito-core:2.25.0'
testCompile 'org.testng:testng:6.14.3'
testRuntime 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
}
// Setup default test behavior, including failure logging
test {
//This is so tests run in altered environments behave consistently with IDE results, and cannot be used to test credential environment variable behavior
environment "BINTRAY_USER", ""
environment "BINTRAY_API_KEY", ""
useTestNG() {
useDefaultListeners = true
}
testLogging{
exceptionFormat 'full'
quiet{
events 'failed', 'skipped'
}
info{
events 'failed', 'skipped', 'passed', 'standard_out', 'standard_error'
}
debug{
events 'failed', 'skipped', 'passed', 'standard_out', 'standard_error', 'started'
}
}
}
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
checkstyle {
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
configProperties = [ 'checkstyle.config.dir' : rootProject.file('config/checkstyle') ]
toolVersion = '8.29'
}
task checkstyleAll{}
tasks.withType(Checkstyle).all { checkstyleTask -> checkstyleAll.dependsOn checkstyleTask }
check.dependsOn checkstyleAll
task sourcesJar(type: Jar) {
group = 'Build'
description = 'Creates a jar containing the source code of the project'
classifier = 'sources'
from sourceSets.main.allSource
dependsOn tasks.classes
}
task javadocJar(type: Jar) {
group = 'Build'
description = 'Creates a jar containing the javadoc of the project'
classifier = 'javadoc'
from javadoc.destinationDir
dependsOn tasks.javadoc
}
artifacts {
archives sourcesJar
archives javadocJar
}
// Allow local publishing for testing
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
repositories {
mavenLocal()
}
}
pluginBundle {
website = 'https://github.com/StarChart-Labs/flare-plugins'
vcsUrl = 'https://github.com/StarChart-Labs/flare-plugins'
tags = [ 'operations', 'testing' ]
}
gradlePlugin {
plugins {
dependencyConstraintsPlugin {
id = 'org.starchartlabs.flare.dependency-constraints'
displayName = 'Dependency Constraints'
description = 'Allows applying consistent dependency constraints from a single configuration file'
implementationClass = 'org.starchartlabs.flare.plugins.plugin.DependencyConstraintsPlugin'
}
increasedTestLoggingPlugin {
id = 'org.starchartlabs.flare.increased-test-logging'
displayName = 'Increased Test Logging'
description = 'Apply a convention for more verbose test logging in Gradle test executions'
implementationClass = 'org.starchartlabs.flare.plugins.plugin.IncreasedTestLoggingPlugin'
}
managedCredentialsPlugin {
id = 'org.starchartlabs.flare.managed-credentials'
displayName = 'Managed Credentials'
description = 'Provides a configurable DSL for defining sets of credentials used within the Gradle build'
implementationClass = 'org.starchartlabs.flare.plugins.plugin.ManagedCredentialsPlugin'
}
managedCredentialsPlugin {
id = 'org.starchartlabs.flare.bintray-credentials'
displayName = 'Bintray Credentials'
description = 'Provides setup for bintray credentials to be read from environment variable for use within a Gradle build'
implementationClass = 'org.starchartlabs.flare.plugins.plugin.BintrayCredentialsPlugin'
}
mergeCoverageReportsPlugin {
id = 'org.starchartlabs.flare.merge-coverage-reports'
displayName = 'Merge Coverage Reports'
description = 'Adds a task which generates a single Jacoco XML report with coverage data from all sub-modules'
implementationClass = 'org.starchartlabs.flare.plugins.plugin.MergeCoverageReportsPlugin'
}
metadataBasePlugin {
id = 'org.starchartlabs.flare.metadata-base'
displayName = 'Meta Data Configuration'
description = 'Provides a configurable DSL for defining published project meta data'
implementationClass = 'org.starchartlabs.flare.plugins.plugin.MetaDataBasePlugin'
}
metadataPomPlugin {
id = 'org.starchartlabs.flare.metadata-pom'
displayName = 'Meta Data POM Application'
description = 'Applies values from a configurable DSL of published project meta data to generated Maven POM files'
implementationClass = 'org.starchartlabs.flare.plugins.plugin.MetaDataPomPlugin'
}
sourceJarsPlugin {
id = 'org.starchartlabs.flare.source-jars'
displayName = 'Source Jars'
description = 'Adds Jar tasks for generating source and JavaDoc jars for open-source projects'
implementationClass = 'org.starchartlabs.flare.plugins.plugin.SourceJarsPlugin'
}
multiModuleLibraryPlugin {
id = 'org.starchartlabs.flare.multi-module-library'
displayName = 'Multi Module Library Conventions'
description = 'Configures conventions for Gradle projects building libraries with multiple modules'
implementationClass = 'org.starchartlabs.flare.plugins.plugin.MultiModuleLibraryPlugin'
}
}
}