-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
144 lines (129 loc) · 4.74 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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'com.jfrog.artifactory' version '4.16.1'
}
apply from: 'properties.gradle'
subprojects {
apply plugin: 'maven'
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
group 'org.citydb'
version '4.2.3'
sourceCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'
repositories {
mavenCentral {
content {
excludeModule("javax.media", "jai_core")
}
}
maven {
url 'https://repo.osgeo.org/repository/release'
}
maven {
url 'https://citydb.jfrog.io/artifactory/maven'
}
}
task processLicense(type: Copy) {
from("$rootDir/resources/license/LICENSE.txt") {
filteringCharset = 'UTF-8'
filter(ReplaceTokens, tokens: [
name: project.impexpName
])
}
into "$buildDir/tmp/license"
}
javadoc {
include 'org/citydb/**'
options {
overview "$buildDir/tmp/javadoc/overview.html"
header "${project.name} ${project.version}"
bottom """
<a href="${impexpIssueTrackerUrl}">Report a bug or suggest an enhancement</a><br>
${project.name} is open source and licensed under the <a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.<br>
Official website and more information at: <a target="_blank" href="${project.citydbWebsiteUrl}">${project.citydbWebsiteUrl}</a><br>
Copyright © ${project.vendorCopyright}<br>
${project.vendorName}<br>
${project.vendorOrganisation}, ${project.vendorCountry}<br>
<a target="_blank" href="${project.vendorWebsiteUrl}">${project.vendorWebsiteUrl}</a>
""".replaceAll("[\r|\n]+", "")
addStringOption('doctitle', project.name + ' - ' + project.version)
addStringOption('Xdoclint:none', '-quiet')
}
doFirst {
copy {
from("$rootDir/resources/javadoc/overview.html") {
filteringCharset = 'UTF-8'
filter(ReplaceTokens, tokens: [
name: project.name,
version: project.version,
impexpName: project.impexpName,
])
}
into "$buildDir/tmp/javadoc"
}
}
}
jar {
manifest {
attributes('Implementation-Title': project.impexpName,
'Implementation-Version': project.version,
'Implementation-Vendor': project.vendorName + ', ' + project.vendorOrganisation
)
}
into('META-INF') {
from "$rootDir/resources/license/APACHE-2.0.txt"
from processLicense
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = project.name
url = project.citydbVcsUrl
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
scm {
url = project.impexpVcsUrl
connection = 'scm:git:' + project.impexpGit
}
}
}
}
}
artifactory {
contextUrl = project.hasProperty('artifactory_contextUrl') ? project.property('artifactory_contextUrl') : System.getenv('artifactory_contextUrl')
publish {
repository {
repoKey = 'maven'
username = project.hasProperty('artifactory_user') ? project.property('artifactory_user') : System.getenv('artifactory_user')
password = project.hasProperty('artifactory_password') ? project.property('artifactory_password') : System.getenv('artifactory_password')
maven = true
}
defaults {
publications('mavenJava')
}
}
}
test {
useJUnitPlatform()
}
}