forked from elastic/elasticsearch-metrics-reporter-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
208 lines (175 loc) · 6.17 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
206
207
208
import java.text.SimpleDateFormat
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
//classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.0'
}
}
plugins {
//id "com.github.hierynomus.license" version "0.11.0"
id 'net.researchgate.release' version '2.4.1'
}
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'jacoco'
//apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.ben-manes.versions'
repositories {
jcenter()
mavenCentral()
maven {
url "http://dl.bintray.com/johnrengelman/gradle-plugins"
}
}
ext {
luceneVersion = '5.5.0'
jacksonVersion = '2.7.8'
elasticsearchVersion = '2.3.1'
}
dependencies {
compile 'io.dropwizard.metrics:metrics-core:3.1.2'
compile "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
compile "com.fasterxml.jackson.module:jackson-module-afterburner:${jacksonVersion}"
testCompile "org.apache.lucene:lucene-test-framework:${luceneVersion}"
testCompile "org.elasticsearch:elasticsearch:${elasticsearchVersion}"
testCompile "org.elasticsearch:elasticsearch:${elasticsearchVersion}:tests"
testCompile ('junit:junit:4.12') {
exclude module: 'hamcrest-core'
}
testCompile 'org.hamcrest:hamcrest-all:1.3'
}
Date buildTimeAndDate = new Date()
ext {
buildDate = new SimpleDateFormat('dd-MMM-yyyy').format(buildTimeAndDate)
buildTime = new SimpleDateFormat('hh:mm aa').format(buildTimeAndDate)
}
def jarManifestAttributes = [
'Built-By' : System.properties['user.name'],
'Created-By': System.properties['java.version'] + ' (' + System.properties['java.vendor'] + ' ' + System.getProperty("java.vm.version") + ")",
'Build-Date': buildDate,
'Build-Time': buildTime]
jar {
manifest {
attributes(jarManifestAttributes)
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
def javaApiUrl = 'http://docs.oracle.com/javase/1.7.0/docs/api/'
def groovyApiUrl = 'http://groovy.codehaus.org/gapi/'
/*tasks.withType(Javadoc) {
options.links(javaApiUrl, groovyApiUrl)
}
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}*/
artifacts {
archives sourcesJar//, javadocJar
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
/*license {
excludes(["** / *.jade4j", "** / *.jade", "** / *.factories"])
ext.year = Calendar.getInstance().get(Calendar.YEAR)
ext.name = 'Domingo Suarez Torres'
ext.email = '[email protected]'
header rootProject.file('HEADER_LICENSE')
strictCheck true
}*/
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
//artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('name', project.pomName)
root.appendNode('description', project.description)
root.appendNode('url', 'https://github.com/CirculoSiete/elasticsearch-metrics-reporter-java')
root.appendNode('inceptionYear', '2016')
root.appendNode('packaging', 'jar')
def scm = root.appendNode('scm')
scm.appendNode('url', 'https://github.com/CirculoSiete/elasticsearch-metrics-reporter-java')
scm.appendNode('connection', 'scm:https://domixgithub.com/CirculoSiete/elasticsearch-metrics-reporter-java.git')
scm.appendNode('developerConnection', 'scm:[email protected]:CirculoSiete/elasticsearch-metrics-reporter-java.git')
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', 'The Apache Software License, Version 2.0')
license.appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt')
license.appendNode('distribution', 'repo')
def developers = root.appendNode('developers')
def domix = developers.appendNode('developer')
domix.appendNode('id', 'domix')
domix.appendNode('name', 'Domingo Suarez Torres')
domix.appendNode('email', '[email protected]')
root.dependencies.'*'.findAll() {
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
dep.name == it.artifactId.text()
}
}.each() {
it.scope*.value = 'compile'
}
}
}
}
}
bintray {
user = project.hasProperty('bintrayUsername') ? bintrayUsername : ''
key = project.hasProperty('bintrayApiKey') ? bintrayApiKey : ''
publications = ['mavenJava']
dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
pkg {
repo = 'oss'
userOrg = 'circulosiete'
name = project.name
desc = project.description
websiteUrl = 'https://github.com/CirculoSiete/elasticsearch-metrics-reporter-java'
issueTrackerUrl = 'https://github.com/CirculoSiete/elasticsearch-metrics-reporter-java/issues'
vcsUrl = 'https://github.com/CirculoSiete/elasticsearch-metrics-reporter-java.git'
licenses = ['Apache-2.0']
labels = ['gradle']
publicDownloadNumbers = true
attributes = [:]
//Optional version descriptor
version {
name = project.version
desc = project.description
gpg {
sign = project.hasProperty('bintrayGpgPassphrase')
passphrase = project.hasProperty('bintrayGpgPassphrase') ? bintrayGpgPassphrase : ''
}
mavenCentralSync {
sync = false
user = ''
password = ''
close = '1'
}
}
}
}
//javadoc.options.links("http://docs.oracle.com/javase/7/docs/api/", "http://docs.spring.io/spring/docs/4.2.x/javadoc-api/", "https://docs.oracle.com/javaee/5/api/")
//classes.dependsOn licenseFormat
jacocoTestReport.dependsOn check
bintrayUpload.dependsOn jacocoTestReport
createReleaseTag.dependsOn bintrayUpload