-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
99 lines (77 loc) · 2.2 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
apply plugin: 'java'
/* we are a Java project, obviously */
jar {
manifest {
attributes(
'Main-Class': 'de.cgarbs.knittr.Knittr'
)
}
}
apply plugin: 'application'
/* provide a 'run' target to run the knittr UI */
mainClassName = 'de.cgarbs.knittr.Knittr'
apply plugin: 'jacoco'
/* generate Java code coverage reports */
jacocoTestReport {
reports {
xml.enabled true
}
}
apply plugin: 'gradle-one-jar'
/* build a full jar containing all dependencies
source: https://github.com/rholder/gradle-one-jar */
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.github.rholder:gradle-one-jar:1.0.4'
}
}
repositories {
mavenCentral()
/* this is for cgarbs-javalib */
maven {
url "https://www.cgarbs.de/maven2/"
}
}
dependencies {
compile('org.apache.xmlgraphics:batik-rasterizer:1.14') {
exclude group: 'xml-apis', module: 'xml-apis' /* otherwise this breaks on JDK11 because org.w3c packages are duplicated between JDK and xml-apis */
}
compile 'de.cgarbs:cgarbs-javalib:0.3.0-SNAPSHOT'
testCompile 'junit:junit:4.+', 'org.apache.xmlgraphics:fop:2.2' /* only for PDFTranscoder, try to get rid of this! */
}
/***
**** my own tasks
***/
task fullJar(type: OneJar) {
description 'build a Jar including all dependencies'
mainClass = mainClassName
archiveName = project.name + '-full.jar'
}
task fixit(type: Exec) {
description 'Fixes line breaks and indentation on empty lines.'
commandLine 'tools/fixit.sh'
}
task publishDropbox(type: Copy, dependsOn: jar) {
description 'Deploy current JAR to Dropbox.'
from( jar.destinationDir ) {
include jar.archiveName
rename { project.name + '-light.jar' }
}
into '/home/mitch/Dropbox/schnucki/knittr'
}
task publishDropboxFull(type: Copy, dependsOn: fullJar) {
description 'Deploy current JAR to Dropbox.'
from( fullJar.destinationDir ) {
include fullJar.archiveName
rename { project.name + '.jar' }
}
into '/home/mitch/Dropbox/schnucki/knittr'
}
task checkl10n(type: Exec) {
description 'Check all localizations for missing property file keys.'
/* FIXME: all paths handcrafted, there should be a better way */
commandLine 'tools/check-l10n.pl', 'src/main/resources/de/cgarbs/knittr/resource/*.properties'
}