-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
172 lines (144 loc) · 5.32 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
plugins {
id "java"
id "groovy"
id "maven-publish"
id "application"
id 'com.github.johnrengelman.plugin-shadow' version '2.0.2'
id "com.jfrog.bintray" version "1.5"
}
group = "com.github.dnault"
version = "0.3.2-SNAPSHOT"
repositories {
jcenter()
}
tasks.withType(Tar) {
compression = Compression.GZIP
}
targetCompatibility = "1.7"
sourceCompatibility = "1.7"
mainClassName = "com.github.dnault.xmlpatch.CommandLineDriver"
jar {
manifest {
attributes("Main-Class": mainClassName)
}
}
dependencies {
shadow gradleApi()
shadow localGroovy()
compileOnly "org.apache.ant:ant:1.9.6"
compile "org.jdom:jdom2:2.0.6"
compile "jaxen:jaxen:1.1.6"
compile "commons-io:commons-io:2.4"
compile "net.sf.jopt-simple:jopt-simple:4.9"
testCompile "junit:junit:4.12"
}
shadowJar {
classifier = null
['org.apache.commons', 'org.jaxen', 'org.jdom2', 'joptsimple'].each {
relocate it, "com.github.dnault.xmlpatch.repackaged.${it}"
}
// JAXEN-209 Jaxen includes a duplicate, obsolete version of this class not required by modern JDKs
exclude 'org/w3c/dom/UserDataHandler.class'
exclude 'META-INF/maven/**'
exclude 'META-INF/*.txt'
exclude 'META-INF/*.xml'
}
task sourceJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
}
def gitUrl = '[email protected]:dnault/xml-patch.git';
ext.description = "Java implementation of RFC 5261: An XML Patch Operations Framework Utilizing XPath Selectors"
def pomConfig = {
name "${group}:${project.name}"
description project.ext.description
url 'https://github.com/dnault/xml-patch'
scm {
url "${gitUrl}"
connection "scm:git:${gitUrl}"
developerConnection "scm:git:${gitUrl}"
}
licenses {
license {
name 'Apache License 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name 'David Nault'
email '[email protected]'
organization 'dnault'
organizationUrl 'https://github.com/dnault'
}
}
}
task install {
dependsOn(publishToMavenLocal)
}
publishing {
publications {
mavenJava(MavenPublication) { publication ->
project.shadow.component(publication)
pom.withXml {
asNode().appendNode('description', project.ext.description)
asNode().children().last() + pomConfig
}
artifact sourceJar {
classifier 'sources'
}
artifact javadocJar {
classifier 'javadoc'
}
}
}
}
bintrayUpload.doFirst {
if (version.contains("SNAPSHOT")) {
throw new RuntimeException("Must not upload snapshots to bintray (current version is ${version}) -- create and tag a release version first!")
}
}
bintray {
if (project.hasProperty('bintrayUsername')) {
user = project.bintrayUsername
}
if (project.hasProperty('bintrayApiKey')) {
key = project.bintrayApiKey
}
publications = ['mavenJava'] // When uploading Maven-based publication files
dryRun = false //false //Whether to run this as dry-run, without deploying
publish = false //true //If version should be auto published after an upload
pkg {
repo = 'maven'
// userOrg = 'myorg' //An optional organization name when the repo belongs to one of the user's orgs
name = 'xml-patch'
desc = 'Java implementation of RFC 5261: An XML Patch Operations Framework Utilizing XPath Selectors'
websiteUrl = 'https://github.com/dnault/xml-patch'
issueTrackerUrl = 'https://github.com/dnault/xml-patch/issues'
vcsUrl = 'https://github.com/dnault/xml-patch.git'
licenses = ['Apache-2.0']
labels = ['xml', 'patch']
publicDownloadNumbers = false//true
//attributes= ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee'] //Optional package-level attributes
//Optional version descriptor
version {
name = project.version //'1.3-Final' //Bintray logical version name
//desc = 'optional, version-specific description'
released = new Date() //'optional, date of the version release' //2 possible values: date in the format of 'yyyy-MM-dd'T'HH:mm:ss.SSSZZ' OR a java.util.Date instance
vcsTag = project.version //'1.3.0'
// attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] //Optional version-level attributes
gpg {
// sign = true //Determines whether to GPG sign the files. The default is false
// passphrase = 'passphrase' //Optional. The passphrase for GPG signing'
}
mavenCentralSync {
sync = false //true //Optional (true by default). Determines whether to sync the version to Maven Central.
user = 'userToken' //OSS user token
password = 'paasword' //OSS user password
close = '0'//'1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually.
}
}
}
}