forked from SwissTierrasColombia/iliSuite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
145 lines (129 loc) · 4.23 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
plugins {
id 'org.sonarqube' version '2.8'
id 'java'
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
compileJava.options.encoding = 'UTF-8'
def distDir = "$buildDir/dist"
def ili2dbVersion = '4.4.0'
def props = new Properties()
file("src/ai/ilisuite/resources/languages/application.properties").withInputStream {
stream -> props.load(stream)
}
def appVersion = props.getProperty("general.version")
repositories {
flatDir {
dirs 'libs'
}
mavenLocal()
maven {
url 'https://jars.interlis.ch'
}
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
mavenCentral()
}
sourceSets {
main {
java {
srcDirs=[
'src',
'src_supported_impls/ili2fgdbImpl/src',
'src_supported_impls/ili2gpkgImpl/src',
'src_supported_impls/ili2mssqlImpl/src',
'src_supported_impls/ili2oraImpl/src',
'src_supported_impls/ili2pgImpl/src']
}
resources {
srcDirs=[
'src',
'src_supported_impls/ili2fgdbImpl/src',
'src_supported_impls/ili2gpkgImpl/src',
'src_supported_impls/ili2mssqlImpl/src',
'src_supported_impls/ili2oraImpl/src',
'src_supported_impls/ili2pgImpl/src']
}
}
}
dependencies {
// libs
implementation group: 'ch.interlis', name: 'iox-ili', version: '1.20.16'
implementation group: 'ch.interlis', name: 'ili2c-tool', version: '5.0.2'
implementation group: 'ch.interlis', name: 'ili2c-core', version: '5.0.2'
implementation group: 'ch.ehi', name: 'ehisqlgen', version: '1.13.8'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.7'
implementation group: 'net.iharder', name: 'base64', version: '2.3.9'
implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.9.0'
implementation group: 'ch.interlis', name: 'ilivalidator', version: '1.11.3'
// ili2db
implementation group: 'ch.interlis', name: 'ili2db', version: "$ili2dbVersion"
implementation group: 'ch.interlis', name: 'ili2fgdb', version: "$ili2dbVersion"
implementation group: 'ch.interlis', name: 'ili2gpkg', version: "$ili2dbVersion"
implementation group: 'ch.interlis', name: 'ili2mssql', version: "$ili2dbVersion"
//implementation group: 'ch.interlis', name: 'ili2ora', version: "$ili2dbVersion" // temporary disabled
implementation name: "ili2oraLib-$ili2dbVersion"
implementation group: 'ch.interlis', name: 'ili2pg', version: "$ili2dbVersion"
//drivers dbs
implementation group: 'org.postgresql', name: 'postgresql', version: '42.1.4.jre6'
implementation group: 'ch.ehi', name: 'fgdb4j', version: "1.1.1"
implementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.8.11.2'
implementation group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '6.4.0.jre7'
}
task mainJar(type: Jar) {
archiveBaseName = 'iliSuite'
from sourceSets.main.output
manifest {
attributes(
"Main-Class": "ai.ilisuite.application.MainPreLoad",
"Class-Path": configurations.runtimeClasspath.collect { 'ilisuite_lib/'+it.getName() }.join(' '))
}
}
task cpDistFiles(dependsOn: mainJar, type: Copy){
into "$distDir"
// jar
from("$buildDir/libs/iliSuite.jar")
//libs
from(configurations.compileClasspath){
into 'ilisuite_lib'
}
// others
from("docs/iliSuite_help_es.pdf")
from ("$projectDir") {
include "help/**", "programs/**", '.defaultConfig.properties'
}
}
task updVersionInScriptInstaller {
doLast {
def is = file("src_installer/win/ilisuite.iss")
def newContent = new StringBuffer()
is.eachLine {
def line = it
if(it.contains('#define MyAppVersion ')) {
line = "#define MyAppVersion \"$appVersion\""
}
newContent << line + '\r\n'
}
is.write newContent.toString()
}
}
task installerWin(dependsOn: [cpDistFiles, updVersionInScriptInstaller], type: Exec) {
commandLine 'ISCC', "$projectDir\\src_installer\\win\\ilisuite.iss"
doLast {
if(execResult.getExitValue() != 0) {
def warningMessage = 'Remember to add the InnoSetup directory to the System\'s Path environment variable!!!'
println warningMessage
println warningMessage
println warningMessage
}
}
}
task iliSuiteBindist(dependsOn: cpDistFiles, type: Zip) {
archiveBaseName = 'iliSuite_bin'
destinationDirectory = file("$buildDir/bindist")
from "$distDir"
}
if(System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
iliSuiteBindist.finalizedBy installerWin
}