-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
67 lines (55 loc) · 2.03 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
apply plugin: 'application'
apply plugin: 'java'
import groovy.json.JsonSlurper
build { //Update version in dslink.json
def inputFile = file('dslink.json')
def json = new JsonSlurper().parseText(inputFile.text)
version = json.version
}
mainClassName = 'org.dsa.iot.jdbc.JdbcDslink'
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
jcenter()
mavenLocal()
}
wrapper {
gradleVersion = '6.8'
}
dependencies {
compileOnly 'com.google.code.findbugs:annotations:[3.0.1,)'
implementation 'com.h2database:h2:1.4.199'
implementation 'org.apache.commons:commons-dbcp2:2.7.0'
implementation 'org.apache.commons:commons-lang3:3.9'
implementation 'org.apache.commons:commons-pool2:2.8.0'
implementation 'org.postgresql:postgresql:42.2.11.jre7'
implementation 'mysql:mysql-connector-java:6.0.6'
implementation 'org.iot-dsa:dslink:0.24.2'
implementation 'org.iot-dsa:commons:0.24.2'
}
run {
args System.getProperty("exec.args", "").split() + "-d" + "../dslink.json"
workingDir project.buildDir
}
applicationDistribution.from new File(project.projectDir, "/dslink.json")
startScripts {
def configureClasspathVar = { findClasspath, pathSeparator, slash, variable, line ->
line = line.replaceAll(~/^${findClasspath}=.*$/) { original ->
original += "${pathSeparator}${variable}lib${slash}*"
}
}
def configureUnixClasspath = configureClasspathVar.curry('CLASSPATH', ':', '/', '\$APP_HOME/')
def configureWindowsClasspath = configureClasspathVar.curry('set CLASSPATH', ';', '\\', '%APP_HOME%\\')
doLast {
unixScript.text =
unixScript
.readLines()
.collect(configureUnixClasspath)
.join('\n')
windowsScript.text =
windowsScript
.readLines()
.collect(configureWindowsClasspath)
.join('\r\n')
}
}