This repository has been archived by the owner on Sep 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
/
build.gradle
125 lines (114 loc) · 3.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
plugins {
id "java-library"
id "maven-publish"
id "com.jfrog.bintray" version "1.8.5"
}
group = "com.github.davidb"
def description = "A reporter for metrics which announces measurements to an InfluxDB server."
version = "git describe --always --dirty".execute().text.trim()
println("version : '${version}'")
repositories {
jcenter()
}
dependencies {
implementation 'io.dropwizard.metrics:metrics-core:4.2.14'
implementation 'org.slf4j:slf4j-api:2.0.6'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.testng:testng:7.7.0'
testImplementation 'org.hamcrest:hamcrest-all:1.3'
testImplementation 'org.easytesting:fest-assert-core:2.0M10'
testImplementation 'org.mockito:mockito-all:1.10.19'
testImplementation 'com.google.guava:guava:23.0'
testRuntimeOnly 'org.slf4j:slf4j-simple:2.0.6'
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
test {
// enable TestNG support (default is JUnit)
useTestNG()
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
classifier = 'javadoc'
}
// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar
}
def pomConfig = {
name project.name
url "https://github.com/davidB/${project.name}"
inceptionYear "2016"
licenses {
license {
name "Public domain (CC0-1.0)"
url "http://creativecommons.org/publicdomain/zero/1.0/"
distribution "repo"
}
}
scm {
connection "scm:git:git://github.com/davidB/${project.name}.git"
developerConnection "scm:git:[email protected]:davidB/${project.name}.git"
url "https://github.com/davidB/${project.name}/"
}
developers {
developer {
id "davidB"
name "David Bernard"
}
developer {
id "McFoggy"
name "Matthieu Brouillard"
email "[email protected]"
}
}
}
publishing {
publications {
mavenStuff(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom.withXml {
def root = asNode()
root.appendNode('description', description)
root.children().last() + pomConfig
}
}
}
}
bintray {
user = bintray_user
key = bintray_api_key
publications = ['mavenStuff'] //When uploading Maven-based publication files
//dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
pkg {
repo = 'maven'
name = project.name
desc = description
websiteUrl = "https://github.com/davidB/${project.name}"
issueTrackerUrl = "https://github.com/davidB/${project.name}/issues"
vcsUrl = "https://github.com/davidB/${project.name}.git"
licenses = ['CC0-1.0']
publicDownloadNumbers = true
version {
name = project.version
vcsTag = project.version
//attributes = []
//gpg {
// sign = true //Determines whether to GPG sign the files. The default is false
// passphrase = 'optional, the passphrase for GPG signing'
//}
}
}
}
bintrayUpload.dependsOn(check, assemble)
bintrayUpload.onlyIf {
bintray_api_key.trim().length() > 0
}