-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
172 lines (134 loc) · 4.1 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
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'idea'
// code checks
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'checkstyle'
apply plugin: "jacoco"
group = "com.damick"
archivesBaseName = "dropwizard-metrics-cloudwatch"
version = "0.2.0"
def sonatypeRepositoryUrl
def isRelease = false
//set build variables based on build type (release, continuous integration, development)
if (hasProperty("release")) {
sonatypeRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
isRelease = true
} else if (hasProperty("snapshot")) {
version += "-SNAPSHOT"
isRelease = true
} else {
version += "-SNAPSHOT"
sonatypeRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
ext.ossrhUsername = ""
ext.ossrhPassword = ""
}
task createWrapper(type: Wrapper) {
description = "Create a gradle wrapper for you project"
gradleVersion = '2.6'
}
signing {
if (isRelease) {
sign configurations.archives
}
}
/// Code checks
checkstyle {
configFile = rootProject.file('gradle/config/checkstyle.xml')
}
// exclude the checkstyle, findbugsTest, pmdTest on test source..
gradle.startParameter.excludedTaskNames += ["checkstyleTest", "findbugsTest", "pmdTest"]
jacoco {
toolVersion = '0.7.2.201409121644'
}
tasks.check.dependsOn(jacocoTestReport)
////
// http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
allprojects {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
}
task docJar(type: Jar, dependsOn: 'javadoc') {
from javadoc.destinationDir
}
artifacts { // define the artifacts for a service
archives sourcesJar { classifier "sources" }
archives docJar { classifier "javadoc" }
}
group = 'com.damick'
def vendor = 'Jeffrey Damick'
jar.doFirst {
manifest {
attributes 'Implementation-Title': "${archivesBaseName}",
'Implementation-Version': "${version}",
'Implementation-Vendor': "${vendor}",
provider: 'gradle'
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: sonatypeRepositoryUrl) {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
pom.project {
name 'dropwizard-metrics-cloudwatch'
packaging 'jar'
// optionally artifactId can be defined here
description 'Dropwizard Metrics Plugin for reporting to AWS CloudWatch.'
url 'https://github.com/jdamick/dropwizard-metrics-cloudwatch'
scm {
connection 'scm:git:git://github.com/jdamick/dropwizard-metrics-cloudwatch.git'
developerConnection 'scm:git:[email protected]:jdamick/dropwizard-metrics-cloudwatch.git'
url 'https://github.com/jdamick/dropwizard-metrics-cloudwatch'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'jdamick'
url 'https://github.com/jdamick'
name 'Jeffrey Damick'
email '[email protected]'
}
}
}
}
}
}
repositories {
mavenCentral()
}
if (!project.hasProperty('dropwizVer')) {
ext.dropwizVer = '0.9.2'
}
ext.awsVer = '1.10.57'
dependencies {
// dropwizard
testCompile "io.dropwizard:dropwizard-testing:$dropwizVer"
testCompile "org.assertj:assertj-core:1.7.0"
compile "com.amazonaws:aws-java-sdk-cloudwatch:$awsVer"
compile "io.dropwizard:dropwizard-metrics:$dropwizVer"
compile "com.blacklocus:metrics-cloudwatch:0.4.0"
testCompile 'junit:junit:4.12'
}