This repository has been archived by the owner on May 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
/
build.gradle
165 lines (138 loc) · 5.2 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
/*
Copyright © 2016 - 2018 Chris Egerton <fearthecellos@gmail.com>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See the LICENSE file for more details.
*/
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'maven'
apply plugin: 'signing'
sourceCompatibility = 1.8
group = 'io.confluent.avro'
archivesBaseName = 'avro-random-generator'
version = '0.2.0-SNAPSHOT'
signing {
sign configurations.archives
required {
gradle.taskGraph.hasTask('uploadArchives')
}
}
jar {
manifest {
attributes 'Implementation-Title': 'Avro Random Generator',
'Implementation-Version': version
}
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
// Copied from http://stackoverflow.com/questions/4871656/using-gradle-to-build-a-jar-with-dependencies
task standalone(type: Jar) {
destinationDir file("$rootDir/bin")
archiveName 'arg.jar'
from {
(configurations.runtime).collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes 'Main-Class': 'io.confluent.avro.random.generator.Main'
}
with jar
}
clean.doLast {
new File("$rootDir/bin").deleteDir()
}
repositories {
jcenter()
maven {
url 'https://nexus.confluent.io/repository/maven-snapshots/'
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}
pom.groupId = project.group
pom.artifactId = 'avro-random-generator'
pom.version = project.version
def nexusUserName = findProperty('nexusUserName') ?: ''
def nexusPassword = findProperty('nexusPassword') ?: ''
if (nexusUserName != '' && nexusPassword != '') {
snapshotRepository(url: 'https://nexus.confluent.io/repository/maven-snapshots/') {
authentication(userName: nexusUserName, password: nexusPassword)
}
repository(url: 'https://nexus.confluent.io/repository/maven-public/') {
authentication(userName: nexusUserName, password: nexusPassword)
}
println 'Nexus credentials provided; archive uploading enabled'
} else {
println 'No Nexus credentials provided; archive uploading disabled'
}
def sonatypeUserName = findProperty('sonatypeUserName') ?: ''
def sonatypePassword = findProperty('sonatypePassword') ?: ''
if (sonatypeUserName != '' && sonatypePassword != '') {
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots') {
authentication(userName: sonatypeUserName, password: sonatypePassword)
}
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: sonatypeUserName, password: sonatypePassword)
}
println 'Sonatype credentials provided; archive uploading enabled'
} else {
println 'No Sonatype credentials provided; archive uploading disabled'
}
pom.project {
name 'Avro Random Generator'
description 'Avro Random Generator is a tool for randomly generating data to match Avro schemas'
url 'https://github.com:C0urante/avro-random-generator'
scm {
url 'https://github.com:C0urante/avro-random-generator'
connection 'scm:git:ssh://github.com:C0urante/avro-random-generator.git'
developerConnection 'scm:git:ssh://github.com:C0urante/avro-random-generator.git'
}
licenses {
license {
name 'DWTFPL Version 2'
url 'http://www.wtfpl.net/txt/copying/'
}
}
developers {
developer {
id 'C0urante'
name 'Chris Egerton'
}
}
}
}
}
}
artifacts {
archives jar, javadocJar, sourcesJar
}
dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.21'
compile group: 'org.apache.avro', name: 'avro', version: '1.8.1'
compile group: 'com.github.mifmif', name: 'generex', version: '1.0.1'
compile group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1'
////////////////////////////////////////////////////////////////
testCompile group: 'junit', name: 'junit', version: '4.12'
}
checkstyle {
configFile = file("${project.rootDir}/config/checkstyle/google_checks.xml")
toolVersion = '6.18'
}
javadoc {
options.links 'https://docs.oracle.com/javase/8/docs/api/'
options.links 'https://avro.apache.org/docs/1.8.1/api/java/'
}