-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
171 lines (147 loc) · 4.8 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
plugins {
id "com.jfrog.bintray" version "1.7"
id "maven-publish"
id "java"
id "jacoco"
// id "findbugs"
id "idea"
id 'net.researchgate.release' version '2.4.1'
id 'org.ajoberstar.grgit' version '1.5.1'
}
repositories {
mavenCentral()
jcenter()
}
configurations {
provided
}
ext {
license = 'Apache-2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
websiteUrl = 'https://github.com/medjed/JsonPathCompiler'
issueTrackerUrl = 'https://github.com/medjed/JsonPathCompiler/issues'
vcsUrl = 'https://github.com/medjed/JsonPathCompiler.git'
githubRepo = 'medjed/JsonPathCompiler'
grgit = org.ajoberstar.grgit.Grgit.open(project.rootDir)
}
project.ext.set('release.useAutomaticVersion', 'true')
sourceCompatibility = 1.7
targetCompatibility = 1.7
dependencies {
// The production code uses the SLF4J logging API at compile time
compile 'org.slf4j:slf4j-api:1.7.21'
compile 'net.minidev:json-smart:2.2.1'
compile 'org.apache.commons:commons-lang3:3.4'
testCompile 'junit:junit:4.+'
testCompile 'org.assertj:assertj-core:2.1.0'
testCompile 'org.slf4j:slf4j-simple:1.7.21'
}
allprojects {
ext {
displayName = null
buildTimestamp = new Date().format('yyyy-MM-dd HH:mm:ss')
}
group = 'io.github.medjed'
description = 'Porting from https://github.com/jayway/JsonPath Cut out a PathCompiler.'
if (JavaVersion.current().isJava8Compatible()) {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
javadoc {
options.locale = 'en_US'
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
publishing {
publications {
mavenPublication(MavenPublication) {
from components.java
groupId project.group
artifactId project.name
pom.withXml {
asNode().children().last() + {
resolveStrategy = DELEGATE_FIRST
name project.name
description project.description
url project.vcsUrl
scm {
url project.vcsUrl
connection "scm:git:$project.vcsUrl"
}
licenses {
license {
name project.license
url project.licenseUrl
distribution 'repo'
}
}
developers {
developer {
id project.group
name project.group
}
}
}
}
}
}
}
bintray {
user = project.hasProperty('bintray_user') ? bintray_user : ''
key = project.hasProperty('bintray_apikey') ? bintray_apikey : ''
publish = true // automatic publish
pkg {
userOrg = 'medjed'
repo = 'maven'
name = project.name
licenses = [project.license]
websiteUrl = project.websiteUrl
issueTrackerUrl = project.issueTrackerUrl
vcsUrl = project.vcsUrl
githubRepo = project.githubRepo
version {
name = project.version
released = new Date()
gpg {
sign = true
passphrase = project.hasProperty('bintray_gpg_password') ? bintray_gpg_password : ''
}
}
}
publications = ['mavenPublication']
configurations = ['archives']
// dryRun = true
}
}
task classpath(type: Copy, dependsOn: ["jar"]) {
doFirst { file("classpath").deleteDir() }
from(configurations.provided + files(jar.archivePath))
into "classpath"
}
task generateJavadoc(type: Javadoc) {
classpath = sourceSets.main.compileClasspath
source = sourceSets.main.allJava
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
destinationDir = file("docs")
}
task(commitJavadoc, dependsOn: generateJavadoc) << {
grgit.add(patterns: ['docs'])
grgit.commit(message: "Add javadoc " + version)
}
afterReleaseBuild.dependsOn commitJavadoc
afterReleaseBuild.dependsOn bintrayUpload
clean { delete "classpath" }