-
Notifications
You must be signed in to change notification settings - Fork 30
/
build.gradle
116 lines (91 loc) · 2.92 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
import java.text.SimpleDateFormat
plugins {
id "java"
id "org.jetbrains.kotlin.jvm" version "1.6.21"
id "org.beryx.runtime" version "1.12.7"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "com.palantir.git-version" version "0.15.0"
}
group "com.digitalpetri.opcua"
version "0.4-SNAPSHOT"
sourceCompatibility = 17
project.ext {
miloVersion = "0.6.8"
packageName = "milo-demo-server"
}
compileKotlin {
kotlinOptions.jvmTarget = "17"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "17"
}
shadowJar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
minimize {
exclude dependency("org.bouncycastle:.*:.*")
exclude dependency("org.jetbrains.kotlin:kotlin-reflect:.*")
exclude dependency("org.glassfish.jaxb:.*:.*")
}
}
mainClassName = "com.digitalpetri.opcua.server/com.digitalpetri.opcua.server.MiloDemoServer"
application {
mainClassName = "com.digitalpetri.opcua.server.MiloDemoServer"
applicationName = "milo-demo-server"
}
jar {
def details = versionDetails()
manifest {
attributes(
"Main-Class": "com.digitalpetri.opcua.server.MiloDemoServer",
"Implementation-Title": "milo-demo-server",
"X-Stack-Version": "$miloVersion",
"X-SDK-Version": "$miloVersion",
"X-Server-Build-Date": getDate(),
"X-Server-Build-Number": details.gitHash,
"X-Server-Software-Version": project.version
)
}
}
static def getDate() {
def df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")
df.setTimeZone(TimeZone.getTimeZone("UTC"))
return df.format(new Date())
}
runtime {
options = ["--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages", "--bind-services"]
modules = [
"jdk.management",
"java.management",
"java.sql",
"java.naming",
"java.logging",
"java.xml",
"jdk.unsupported"
]
def platformSuffix = ""
if (project.hasProperty("platform")) {
platformSuffix = "-$platform"
}
imageDir = file("$buildDir/${packageName}")
imageZip = file("$buildDir/${packageName}${platformSuffix}.zip")
}
task dist {
dependsOn clean, runtimeZip
description "Calls clean and then runtimeZip [default]"
}
defaultTasks "dist"
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.4'
implementation "org.eclipse.milo:sdk-client:$miloVersion"
implementation "org.eclipse.milo:sdk-server:$miloVersion"
implementation "org.eclipse.milo:dictionary-manager:$miloVersion"
implementation 'com.uchuhimo:konf-core:1.1.2'
implementation 'ch.qos.logback:logback-classic:1.2.11'
implementation 'io.github.soc:directories:12'
}