forked from 3dcitydb/importer-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
131 lines (118 loc) · 3.79 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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'application'
}
configurations {
izpack
doc
}
dependencies {
api project(':impexp-client-cli')
api 'com.formdev:flatlaf:3.0'
api 'com.formdev:flatlaf-extras:3.0'
api 'com.formdev:flatlaf-swingx:3.0'
api 'com.fifesoft:rsyntaxtextarea:3.3.0'
api 'com.github.vertical-blank:sql-formatter:2.0.3'
api ('org.citydb:swingx-ws:1.1.5') {
transitive = false
}
api ('org.citydb:swingx-all:1.6.9') {
transitive = false
}
doc 'org.kohsuke.metainf-services:metainf-services:1.8'
doc 'org.swinglabs.swingx:swingx-mavensupport:1.6.5-1'
}
processResources {
filesMatching('**/application.properties') {
filteringCharset = 'UTF-8'
filter(ReplaceTokens, tokens: [
docUrl: project.docUrl
])
}
}
task processReadme(type: Copy) {
from('resources/doc/README.txt') {
filteringCharset = 'UTF-8'
filter(ReplaceTokens, tokens: [
name: project.impexpName,
version: project.version,
date: project.date.format('yyyy-MM-dd'),
citydbName: project.citydbName,
citydbVersion: project.citydbVersion,
jar: jar.archiveFileName.get(),
appName: project.appName,
cliName: project.appCliName,
cliDir: application.executableDir,
citydbWebsiteUrl: project.citydbWebsiteUrl,
citydbVcsUrl: project.citydbVcsUrl,
vendorName: project.vendorName,
vendorOrganisation: project.vendorOrganisation,
vendorCountry: project.vendorCountry,
vendorCopyright: project.vendorCopyright,
vendorWebsiteUrl: project.vendorWebsiteUrl,
docUrl: project.docUrl
])
}
into "$buildDir/tmp/doc"
}
javadoc {
classpath += configurations.doc
}
jar {
manifest {
attributes('Main-Class': application.mainClass,
'Class-Path': configurations.runtimeClasspath.collect{ it.name }.join(' ')
)
into('META-INF') {
from processReadme
}
}
}
application {
mainClass = 'org.citydb.cli.ImpExpCli'
applicationName = project.appCliName
applicationDefaultJvmArgs = ['-Xms1G']
startScripts {
classpath = jar.outputs.files
doLast {
def windows = getWindowsScript()
def unix = getUnixScript()
windows.text = windows.text.replaceFirst('set APP_HOME=.*', '$0\r\nset WORKING_DIR=%CD%')
unix.text = unix.text.replaceFirst('APP_HOME=.*', '$0\nexport APP_HOME\nexport WORKING_DIR=\\$SAVED')
}
}
}
distributions {
main {
distributionBaseName = project.appName
contents {
from processReadme
from('resources/start') {
rename 'start(.*)', project.appName + '$1'
fileMode 0755
filter(ReplaceTokens, tokens: [
name: project.impexpName,
cliName: project.appCliName,
cliDir: application.executableDir
])
}
into('contribs') {
from "$rootDir/resources/contribs"
}
into('templates') {
from "$rootDir/resources/templates"
}
into('samples') {
from "$rootDir/resources/samples"
}
into('license') {
from "$rootDir/resources/license/APACHE-2.0.txt"
from processLicense
}
from(file("$buildDir/tmp/dir")) {
mkdir "$buildDir/tmp/dir/plugins"
mkdir "$buildDir/tmp/dir/ade-extensions"
}
}
}
}