-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
160 lines (134 loc) · 5.82 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
import org.apache.tools.ant.filters.ReplaceTokens
plugins {
id 'distribution'
}
configurations {
izpack
}
dependencies {
izpack fileTree(dir: 'resources/izpack/lib', include: '*.jar')
}
apply from: 'properties.gradle'
version '2024.0.0'
// 3dcitydb project
task update3DCityDBGitSubmodule(type: Exec) {
commandLine 'git', 'submodule', 'update', '--init', '--remote', '3dcitydb'
}
task build3DCityDB(type: GradleBuild, group: 'build', dependsOn: update3DCityDBGitSubmodule) {
def cityDBProject = project(':citydb')
tasks = ['clean', 'installDist']
dir "$cityDBProject.projectDir"
outputs.dir "$cityDBProject.projectDir/build/install/3dcitydb"
}
// importer-exporter project
task updateImporterExporterGitSubmodule(type: Exec) {
commandLine 'git', 'submodule', 'update', '--init', '--remote', 'importer-exporter'
}
task buildImporterExporter(type: GradleBuild, group: 'build', dependsOn: updateImporterExporterGitSubmodule) {
def impExpProject = project(':impexp')
tasks = ['clean', 'installDist']
dir "$impExpProject.projectDir"
outputs.dir "$impExpProject.projectDir/impexp-client-gui/build/install/3DCityDB-Importer-Exporter"
outputs.upToDateWhen { false }
}
// plugin-ade-manager project
task updateADEManagerPluginGitSubmodule(type: Exec) {
commandLine 'git', 'submodule', 'update', '--init', '--remote', 'importer-exporter-plugins/plugin-ade-manager'
}
task buildADEManagerPlugin(type: GradleBuild, group: 'build', dependsOn: updateADEManagerPluginGitSubmodule) {
def adePluginProject = project(':ade-plugin')
tasks = ['clean', 'installDist']
dir "$adePluginProject.projectDir"
outputs.dir "$adePluginProject.projectDir/build/install"
outputs.upToDateWhen { false }
}
// build plugin-spreadsheet-generator submodule
task updateSpreadsheetGeneratorPluginGitSubmodule(type: Exec) {
commandLine 'git', 'submodule', 'update', '--init', '--remote', 'importer-exporter-plugins/plugin-spreadsheet-generator'
}
task buildSpreadsheetGeneratorPlugin(type: GradleBuild, group: 'build', dependsOn: updateSpreadsheetGeneratorPluginGitSubmodule) {
def spshgPluginProject = project(':spshg-plugin')
tasks = ['clean', 'installDist']
dir "$spshgPluginProject.projectDir"
outputs.dir "$spshgPluginProject.projectDir/build/install"
outputs.upToDateWhen { false }
}
// build 3dcitydb-web-map submodule
task updateWebMapGitSubmodule(type: Exec) {
commandLine 'git', 'submodule', 'update', '--init', '--remote', '3dcitydb-web-map'
}
task buildWebMap(type: Zip, group: 'build', dependsOn: updateWebMapGitSubmodule) {
from "$rootDir/3dcitydb-web-map"
archiveFileName = '3dcitydb-web-map.zip'
destinationDirectory = file("$projectDir/build/tmp/3dcitydb-web-map")
}
task createImpExpInstallerContents(dependsOn: buildImporterExporter, type: Copy) {
into ("$projectDir/build/tmp/impexp")
from buildImporterExporter.outputs
into('3dcitydb') {
from build3DCityDB.outputs
}
into('3d-web-map-client') {
from buildWebMap.outputs
}
into ("plugins") {
from tasks.getByPath('buildADEManagerPlugin').outputs
from tasks.getByPath('buildSpreadsheetGeneratorPlugin').outputs
}
from(file("$projectDir/build/tmp/dir")) {
mkdir "$projectDir/build/tmp/dir/ade-extensions"
}
}
task buildImpExpInstaller(dependsOn: createImpExpInstallerContents, group: 'distribution') {
doLast {
def impExpProject = project(':impexp')
impExpProject.apply from: "$impExpProject.projectDir/properties.gradle"
def installDir = "$projectDir/build/tmp/impexp".toString()
def distDir = distZip.destinationDirectory.get()
def izpackDir = "$projectDir/build/tmp/izpack".toString()
def installer = "$distDir/$impExpProject.appName-" + impExpProject.version + '-Setup.jar'
mkdir distDir
copy {
from 'resources/izpack'
into izpackDir
filesMatching('**/*.xml') {
filteringCharset = 'UTF-8'
filter(ReplaceTokens, tokens: [
appName: impExpProject.impexpName,
appVersion: impExpProject.version,
appSubPath: '3DCityDB-Importer-Exporter',
appShortcut: impExpProject.appShortcutName,
startScriptName: impExpProject.appName,
cliName: impExpProject.appCliName,
url: impExpProject.citydbWebsiteUrl,
citydbName: impExpProject.citydbName,
citydbVersion: impExpProject.citydbVersion,
installDir: installDir,
cliDir: 'bin',
pluginsDir: 'plugins',
contribsDir: 'contribs',
citydbDir: '3dcitydb',
adeExtensionsDir: 'ade-extensions',
templatesDir: 'templates',
manualDir: 'manual',
webMapClientDir: '3d-web-map-client',
samplesDir: 'samples',
spreadSheetPluginDir: 'plugin-spreadsheet-generator',
adeManagerPluginDir: 'plugin-ade-manager'
])
}
filesMatching('**/license.txt') {
filteringCharset = 'UTF-8'
filter(ReplaceTokens, tokens: [
license: file("$installDir/license/LICENSE.txt").text,
apache: file("$rootDir/resources/license/APACHE-2.0.txt").text
])
}
}
ant.taskdef(name: 'izpack', classname: 'com.izforge.izpack.ant.IzPackTask', classpath: configurations.izpack.asPath)
ant.izpack(input: "$izpackDir/install.xml",
output: installer,
basedir: izpackDir
)
}
}