-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
201 lines (166 loc) · 6 KB
/
build.gradle
File metadata and controls
201 lines (166 loc) · 6 KB
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
apply plugin: 'idea'
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Defines
/** Function always returns a new manifest that can be customized */
def defaultManifest() {
return manifest {
def git_cmd = "git rev-parse HEAD"
def git_proc = git_cmd.execute()
attributes 'SCM-Revision': git_proc.text.trim()
attributes 'Timestamp': String.valueOf(System.currentTimeMillis())
attributes 'Build-Host': InetAddress.localHost.hostName
}
}
def defaultBlank(closure) {
try {
closure()
} catch (MissingPropertyException e) {
''
}
}
ext {
deps = [
aws_java_sdk_s3: 'com.amazonaws:aws-java-sdk-s3:1.10.20',
aws_java_sdk_sqs: 'com.amazonaws:aws-java-sdk-sqs:1.10.20',
commons_lang3: 'org.apache.commons:commons-lang3:3.4',
guava: 'com.google.guava:guava:18.0',
jackson_databind: 'com.fasterxml.jackson.core:jackson-databind:2.6.2',
jsr305: 'com.google.code.findbugs:jsr305:3.0.0',
junit: 'junit:junit:4.12',
mockito_core: 'org.mockito:mockito-core:1.10.19',
slf4j_api: 'org.slf4j:slf4j-api:1.7.12',
slf4j_simple: 'org.slf4j:slf4j-simple:1.7.12',
]
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// License
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.10.0'
}
}
allprojects {
apply plugin: 'license'
license {
header rootProject.file('src/license/HEADER')
}
}
subprojects {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Identifiers
group = 'com.blacklocus.queue-slayer'
version = '0.5.2-SNAPSHOT'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Plugins
apply plugin: 'java'
sourceCompatibility = 1.7
targetCompatibility = 1.7
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'idea'
apply plugin: 'eclipse'
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Dependencies
repositories {
mavenCentral()
}
dependencies {
testCompile deps.junit
testCompile deps.slf4j_simple
}
configurations {
// Make sure to use com.fasterxml.jackson.core
all*.exclude group: 'org.codehaus.jackson'
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Artifacts
jar {
manifest = defaultManifest()
}
javadoc {
failOnError false
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
manifest = defaultManifest()
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
manifest = defaultManifest()
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Publishing
assemble {
dependsOn licenseFormatMain, licenseFormatTest
}
signing {
required { isReleaseVersion && (gradle.taskGraph.hasTask('uploadArchives') || gradle.taskGraph.hasTask(':uploadArchives')) }
sign configurations.archives
}
uploadArchives {
repositories.mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
//# ./gradlew -PdeployUrl=http://server/artifactory/repo -PdeployUser=admin -PdeployPass=pass uploadArchives
// for snapshots https://oss.sonatype.org/content/repositories/snapshots
// for staging/release https://oss.sonatype.org/service/local/staging/deploy/maven2
repository(
url: defaultBlank({ deployUrl })
) {
// If these are not defined assemble needlessly fails for unrelated tasks.
authentication(userName: defaultBlank({ deployUser }), password: defaultBlank({ deployPass }))
}
pom.project {
name 'queue-slayer'
description 'An in-jvm processing pattern for parallelized work off of a queue.'
url 'https://github.com/blacklocus/queue-slayer'
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
scm {
url 'https://github.com/blacklocus/queue-slayer.git'
connection 'scm:git:https://github.com/blacklocus/queue-slayer.git'
developerConnection 'scm:git:git@github.com:blacklocus/queue-slayer.git'
}
organization {
name 'BlackLocus'
url 'https://github.com/blacklocus'
}
developers {
developer {
id 'rholder'
name 'Ray Holder'
}
developer {
id 'dirkraft'
name 'Jason Dunkelberger'
}
}
}
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Misc
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
idea {
project {
languageLevel = '1.7'
}
}