forked from C0urante/avro-random-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
171 lines (142 loc) · 5.41 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
/*
Copyright 2018 Confluent Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
*/
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'checkstyle'
apply plugin: 'maven'
apply plugin: 'signing'
sourceCompatibility = 1.8
group = 'io.confluent.avro'
archivesBaseName = 'avro-random-generator'
version = '0.4.2-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:confluentinc/avro-random-generator'
scm {
url 'https://github.com:confluentinc/avro-random-generator'
connection 'scm:git:ssh://github.com:confluentinc/avro-random-generator.git'
developerConnection 'scm:git:ssh://github.com:confluentinc/avro-random-generator.git'
}
licenses {
license {
name 'Apache License 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.html'
}
}
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.9.1'
compile group: 'com.github.mifmif', name: 'generex', version: '1.0.2'
////////////////////////////////////////////////////////////////
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/'
}