forked from nickrussler/email-to-pdf-converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
129 lines (104 loc) · 3.3 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
plugins {
id 'java'
id 'eclipse'
id 'com.diffplug.spotless' version '6.13.0'
id 'com.github.spotbugs' version '4.5.1'
id 'jacoco'
id 'com.github.johnrengelman.shadow' version '6.0.0'
id 'com.github.ben-manes.versions' version '0.33.0'
id 'com.palantir.git-version' version '0.12.3'
}
sourceCompatibility = 1.7
/* git version */
def gitVersionDetails = versionDetails()
version = gitVersionDetails.lastTag
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"
jar {
manifest {
attributes 'Main-Class': 'cli.Main',
'Implementation-Title': 'Email to PDF Converter',
'Implementation-Version': archiveVersion.get() + "+${gitVersionDetails.branchName}.${gitVersionDetails.gitHash}"
}
}
shadowJar {
baseName = 'emailconverter'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.google.guava:guava:29.0-jre'
implementation 'com.sun.mail:jakarta.mail:2.0.1'
implementation 'com.beust:jcommander:1.78'
implementation 'org.apache.tika:tika-core:2.9.2'
implementation 'com.github.markusbernhardt:proxy-vole:1.0.5'
implementation 'org.simplejavamail:simple-java-mail:8.11.2'
implementation 'org.simplejavamail:outlook-module:8.11.2'
implementation 'org.slf4j:slf4j-simple:1.7.30'
testImplementation 'junit:junit:4.+'
testImplementation 'org.hamcrest:hamcrest-all:1.+'
testImplementation 'com.github.stefanbirkner:system-rules:1.+'
}
/* launch4j launch configuration */
task launch4j_rename(type: Copy) {
from "build/libs/emailconverter-${version}-all.jar"
into 'build/libs/'
rename { String fileName -> 'emailconverter.jar' }
}
launch4j_rename.mustRunAfter shadowJar
task launch4j(type: Exec) {
workingDir '.'
//on windows:
commandLine 'launch4jc', 'gradle/resources/launch4j.xml'
}
launch4j.dependsOn launch4j_rename
task launch4j_gui(type: Exec) {
workingDir '.'
//on windows:
commandLine 'launch4jc', 'gradle/resources/launch4j_gui.xml'
}
launch4j.dependsOn launch4j_rename
/* custom jar build task */
task dist(type: Copy) {
}
dist.dependsOn shadowJar, launch4j, launch4j_gui
/* innosetup generation */
task innosetup(type: Exec) {
workingDir '.'
commandLine 'iscc', "/dMyAppVersion=${version}", 'gradle/resources/innosetup.iss'
}
innosetup.dependsOn dist
/* jacoco configuration */
check.dependsOn jacocoTestReport, dependencyUpdates
jacocoTestReport.mustRunAfter test
dependencyUpdates.mustRunAfter jacocoTestReport
/* spotless configuration */
spotless {
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'
// define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces() // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
target 'src/*/java/**/*.java'
eclipse().configFile(rootProject.layout.projectDirectory.dir("gradle/config/eclipse").file("eclipse-formatter-settings.xml"))
trimTrailingWhitespace()
endWithNewline()
}
}
compileJava.dependsOn spotlessApply
/* spotbugs configuration */
spotbugs {
effort 'max'
reportLevel 'high'
}
spotbugsMain {
reports {
xml.enabled = false
html.enabled = true
}
}