forked from nickrussler/email-to-pdf-converter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
129 lines (105 loc) · 3.17 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'net.sf.proguard', name: 'proguard-gradle', version: '5.2.1'
classpath group: 'org.ajoberstar', name: 'gradle-git', version: '1.5.1'
}
}
plugins {
id 'java'
id 'eclipse'
id 'checkstyle'
id 'findbugs'
id 'jdepend'
id 'jacoco'
id 'com.github.johnrengelman.shadow' version '1.2.3'
id 'com.github.ben-manes.versions' version '0.13.0'
}
sourceCompatibility = 1.7
/* calculate version */
ext.repo = org.ajoberstar.grgit.Grgit.open(project.file('.'))
version = "${repo.tag.list().last().name}"
jar {
manifest {
attributes 'Main-Class': 'cli.Main',
'Implementation-Title' : 'EML to PDF Converter',
'Implementation-Version': version + "+${repo.branch.current.name}.${repo.head().abbreviatedId}"
}
}
shadowJar {
baseName = 'emailconverter'
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'com.google.guava', name: 'guava', version: '19.0'
compile group: 'com.sun.mail', name: 'javax.mail', version: '1.5.6'
compile group: 'com.beust', name: 'jcommander', version: '1.48'
compile group: 'org.apache.tika', name: 'tika-core', version: '1.13'
compile group: 'com.github.markusbernhardt', name: 'proxy-vole', version: '1.0.2'
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile group: 'org.hamcrest', name: 'hamcrest-all', version: '1.+'
testCompile group: 'com.github.stefanbirkner', name: 'system-rules', version: '1.+'
}
/* proguard configuration */
task proguard(type: proguard.gradle.ProGuardTask) {
injars "build/libs/EmailConverter-${version}-all.jar"
outjars "build/libs/EmailConverter-${version}-all-opt.jar"
configuration file("gradle/resources/proguard.cfg")
}
proguard.mustRunAfter shadowJar
/* 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
jacocoTestReport.mustRunAfter test
/* checkstyle configuration */
checkstyle {
configFile = file("src/test/resources/checkstyle.xml")
}
/* findbugs configuration */
findbugs {
effort 'max'
reportLevel 'high'
excludeFilter file("src/test/resources/findbugsExcludeFilter.xml")
}
tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
/* versions configuration */
check.doLast {
dependencyUpdates.execute()
}