-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
111 lines (95 loc) · 3.11 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
plugins {
id 'java'
id 'application'
}
group 'org.apache.poi.examples.hsmf'
version '1.1.0'
mainClassName = "org.apache.poi.examples.hsmf.Msg2txt"
repositories {
mavenCentral()
}
dependencies {
implementation group: 'org.apache.poi', name: 'poi-scratchpad', version: '5.0.0'
implementation group: 'info.picocli', name: 'picocli', version: '4.6.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
test {
useJUnitPlatform()
}
jar {
manifest {
attributes(
'Main-Class': 'org.apache.poi.examples.hsmf.Msg2txt',
"Class-Path": configurations.runtimeClasspath.collect { it.getName() }.join(' ')
)
}
doFirst {
delete fileTree("${buildDir}/libs")
}
doLast {
copy {
from configurations.runtimeClasspath
into "${buildDir}/libs"
}
}
}
task jpackageForLinux(group: 'build', description: 'Packaging self-contained Java applications for Linux.', type: Exec) {
dependsOn "jar"
inputs.dir file("${buildDir}/libs")
outputs.dir file("${buildDir}/packages")
commandLine (
"jpackage",
"--name", "msg2txt",
"--app-version", version,
"--input", "${buildDir}/libs",
"--main-jar", "msg2txt-" + version + ".jar",
"--dest", "${buildDir}/packages",
"--description", "Extract .msg file (Outlook mail file) to text file.",
"--verbose",
)
doFirst {
delete fileTree("${buildDir}/packages")
}
}
task jpackageForMacOS(group: 'build', description: 'Packaging self-contained Java applications for macOS.', type: Exec) {
dependsOn "jar"
inputs.dir file("${buildDir}/libs")
outputs.dir file("${buildDir}/packages")
commandLine (
"jpackage",
"--name", "msg2txt",
"--app-version", version,
"--icon", "mail.png",
"--input", "${buildDir}/libs",
"--main-jar", "msg2txt-" + version + ".jar",
"--dest", "${buildDir}/packages",
"--description", "Extract .msg file (Outlook mail file) to text file.",
"--verbose",
)
doFirst {
delete fileTree("${buildDir}/packages")
}
}
task jpackageForWindows(group: 'build', description: 'Packaging self-contained Java applications for Windows.', type: Exec) {
dependsOn "jar"
inputs.dir file("${buildDir}/libs")
outputs.dir file("${buildDir}/packages")
commandLine (
"jpackage",
"--name", "msg2txt",
"--app-version", version,
"--icon", "mail.ico",
"--input", "${buildDir}/libs",
"--main-jar", "msg2txt-" + version + ".jar",
"--dest", "${buildDir}/packages",
"--description", "Extract .msg file (Outlook mail file) to text file.",
"--win-console",
"--win-shortcut",
"--verbose",
)
doFirst {
delete fileTree("${buildDir}/packages")
}
}