-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
134 lines (120 loc) · 4.37 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
group 'ch.interlis'
version '2.0.1'+System.getProperty('release','-SNAPSHOT')
apply plugin: "java"
apply plugin: "maven"
configurations {
deployerJars
}
// to get the latest SNAPSHOT uncomment the following lines
//configurations.all {
// // check for updates every build
// resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
//}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
compileJava.options.encoding = 'US-ASCII'
dependencies {
compile(group: 'org.geotools', name: 'gt-shapefile', version: '28.5') {
exclude group: 'com.vividsolutions', module: 'jts' // use version that iox-ili depends on
}
testCompile group: 'junit', name: 'junit', version: '4.+'
compile('ch.interlis:iox-ili:1.21.6') {
exclude group: 'ch.ehi', module: 'ehibasics'
}
compile group: 'ch.ehi', name: 'ehibasics', version: '1.4.1'
compile group: 'ch.interlis', name: 'ili2c-tool', version: '5.2.2'
compile group: 'ch.interlis', name: 'ili2c-core', version: '5.2.2'
compile group: 'net.iharder', name: 'base64', version: '2.3.9'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.7'
runtime group: 'org.xerial', name: 'sqlite-jdbc', version: '3.42.0.0'
runtime group: 'org.geotools', name: 'gt-epsg-hsql', version: '28.5'
testCompile group: 'org.postgresql', name: 'postgresql', version: '42.6.0'
testCompile group: 'org.testcontainers', name: 'testcontainers', version: '1.18.3'
testCompile group: 'org.testcontainers', name: 'postgresql', version: '1.18.3'
compile('ch.interlis:ili2pg:4.5.1+') {
exclude group: 'ch.interlis', module: 'iox-ili'
}
compile (group: 'ch.interlis', name: 'ili2gpkg', version: '4.5.1+') {
exclude group: 'ch.interlis', module: 'iox-ili'
}
deployerJars "org.apache.maven.wagon:wagon-ftp:3.0.0"
}
repositories {
mavenLocal()
maven {
url "http://jars.interlis.ch"
}
maven {
url "https://repo.osgeo.org/repository/release/"
}
maven {
url "http://maven.geo-solutions.it"
}
mavenCentral()
}
Properties properties = new Properties()
File propFile=project.rootProject.file('user.properties')
if(propFile.exists()){
properties.load(propFile.newDataInputStream())
}
def git = System.getProperty('git',properties.get('git','git'))
def repos_pwd = System.getProperty('repos_pwd',properties.get('repos_pwd','repos_pwd'))
def repos_usr = System.getProperty('repos_usr',properties.get('repos_usr','repos_usr'))
def dburl = System.getProperty('dburl',properties.get('dburl'))
def dbusr = System.getProperty('dbusr',properties.get('dbusr'))
def dbpwd = System.getProperty('dbpwd',properties.get('dbpwd'))
def generatedResources = "$buildDir/generated-resources/main"
def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine git, 'rev-parse', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
}
sourceSets {
main {
//let's register an output folder on the main SourceSet:
output.dir(generatedResources, builtBy: 'generateMyResources')
//it is now a part of the 'main' classpath and will be a part of the jar
}
test {
resources {
srcDirs = ['test/data']
}
}
}
task generateMyResources {
def versionPropsFile = new File(generatedResources,"ch/interlis/ioxwkf/Version.properties")
def version="$project.version"
def hash=getGitHash()
inputs.property("version","$project.version")
inputs.property("hash",getGitHash())
outputs.file versionPropsFile
doLast {
def versionProps = new Properties()
versionProps.setProperty('version', version)
versionProps.setProperty('versionCommit', hash)
versionPropsFile.getParentFile().mkdirs();
versionProps.store(versionPropsFile.newWriter(), null);
}
}
test {
// when Gradle forks a new Java process, it does not automatically pass the
// environment variable values along to the new environment. One has to
// explicitly pass these variables
systemProperty 'dburl', dburl
systemProperty 'dbusr', dbusr
systemProperty 'dbpwd', dbpwd
testLogging.exceptionFormat = 'full'
}
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: 'ftp://ftp.interlis.ch'){
authentication(userName: repos_usr, password: repos_pwd)
}
}
}
}