-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
129 lines (113 loc) · 3.55 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
import org.apache.tools.ant.filters.ReplaceTokens
import java.time.Instant
plugins {
id 'java'
id 'application'
id 'org.beryx.runtime' version '1.12.7'
id 'distribution'
}
mainClassName = 'org.cip4.bambi.server.BambiServer'
def simpleProjectName = "Bambi"
sourceCompatibility = 17
targetCompatibility = 17
if (project.hasProperty('projectVersion')) {
version = project.projectVersion
} else {
version = 'development'
}
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
mavenLocal()
}
processResources {
filesMatching('**/*.properties') {
filter(ReplaceTokens, tokens: [
'name' : project.properties['name'],
'version' : project.properties['version'],
'timestamp' : new Date().format('yyyy-MM-dd HH:mm:ss'),
'buildNumber': project.properties['buildNumber'] == null ? 'n. a.' : project.properties['buildNumber']
])
}
}
application {
mainClass = 'org.cip4.bambi.server.BambiServer'
}
task startScriptsHeadless(type: CreateStartScripts) {
outputDir = file('build/scripts')
mainClass = 'org.cip4.bambi.server.BambiService'
applicationName = 'bambi-headless'
classpath = project.tasks[JavaPlugin.JAR_TASK_NAME].outputs.files + project.configurations.runtimeClasspath
}
dependencies {
implementation 'org.apache.logging.log4j:log4j-jcl:2.24.3'
implementation 'org.apache.logging.log4j:log4j-core:2.24.3'
implementation 'org.cip4.tools.jdfutility:JDFUtility:1.8.+'
implementation 'org.cip4.lib.jdf:JDFLibJ-JSON:1.2.+'
implementation ('org.cip4.lib.jdf:JDFLibJ:2.1.8.+'){
exclude group: 'xml-apis'
}
implementation ('xerces:xercesImpl:2.12.2'){transitive=false}
implementation 'org.eclipse.jetty:jetty-servlet:10.0.24'
implementation ('com.googlecode.json-simple:json-simple:1.1.1'){transitive=false}
implementation 'commons-logging:commons-logging-api:1.1'
implementation 'commons-lang:commons-lang:2.6'
implementation 'commons-io:commons-io:2.18.0'
implementation 'javax.mail:mail:1.4.7'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:4.11.0'
}
runtime {
jpackage {
modules = [
'jdk.xml.dom',
'java.logging',
'java.naming',
'java.desktop',
'java.management',
'jdk.unsupported',
'jdk.accessibility'
]
imageOptions = [
"--copyright", "CIP4 Organization",
"--vendor", "CIP4 Organization"
]
def currentOs = org.gradle.internal.os.OperatingSystem.current()
def icon = "src/main/dist/bambi.ico"
if (currentOs.macOsX) {
imageOptions += [
"--mac-sign",
"--mac-signing-key-user-name", "CIP4 Organization (4DL5XX9SG8)",
"--mac-package-identifier", "org.cip4.bambi"
]
icon = "src/main/dist/bambi.icns"
}
if (currentOs.windows) {
installerOptions += [
"--win-dir-chooser",
"--win-menu",
"--win-upgrade-uuid", "6278b5c0-f8f8-487a-9b0e-71326583a798",
"--vendor", "CIP4 Organization"
]
}
imageOptions += ["--icon", icon]
int ts = (int) (Instant.now().toEpochMilli() / 100_000) % 65_535
appVersion = project.version == "development" ? "1.0." + ts : project.version
}
}
test {
dependsOn(jre)
executable = jre.getJreDir().dir("bin").file("java").getAsFile().getAbsolutePath()
}
run {
dependsOn(jre)
executable = jre.getJreDir().dir("bin").file("java").getAsFile().getAbsolutePath()
}
java {
archivesBaseName = simpleProjectName
}
startScripts {
applicationName = simpleProjectName
}