generated from StarChart-Labs/template-gradle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
132 lines (110 loc) · 3.13 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
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'it.gianluz:gradle-capsule-plugin:1.0.3'
}
}
plugins {
id 'org.starchartlabs.flare.multi-module-library' version '1.0.0'
}
allprojects {
apply plugin: 'eclipse'
// Always download sources, to allow debugging
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}
}
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
projectMetaData {
github {
repository 'StarChart-Labs', 'helsing'
}
licenses {
mit()
}
}
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
// Setup default test behavior, including failure logging
test {
useTestNG() {
useDefaultListeners = true
}
}
// Apply module naming to all projects
// Add LICENSE so it is included in all JARs, as well as dependent licenses, fulfilling the "distributions include license" requirement
jar {
manifest {
attributes("Automatic-Module-Name": "${project.group}.${project.name - 'helsing-'}".replaceAll("-", "."))
}
}
tasks.withType(Jar).all {
from("${rootDir}"){
include 'LICENSE'
}
}
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}
// If not a remote run, publish to local only
if(!project.hasProperty('remoteDeploy')){
publishing {
repositories {
mavenLocal()
}
}
}
bintray {
publications = [ 'maven' ]
if(!project.hasProperty('remoteDeploy')){
dryRun = true
}
pkg {
repo = 'helsing'
name = "${project.name}"
userOrg = 'starchart-labs'
licenses = ['MIT']
vcsUrl = "${projectMetaData.scm.vcsUrl}"
version {
name = "${project.version}"
desc = "${project.name} release ${project.version} final"
released = new Date()
vcsTag = "${project.version}"
gpg {
sign = true
}
}
}
}
// TODO romeara workaround until deferred credential reading is available in flare-plugins
bintrayUpload {
doFirst {
user = "${credentials.bintray.username}"
apiKey = "${credentials.bintray.password}"
}
}
}