-
Notifications
You must be signed in to change notification settings - Fork 3
/
epub-organizer.gradle
64 lines (50 loc) · 1.46 KB
/
epub-organizer.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
subprojects {
apply plugin: 'java'
group = 'nl.jworks.epub-organizer'
version = '1.0'
// Use Java 7 by default
sourceCompatibility = 1.7
targetCompatibility = 1.7
repositories {
mavenCentral()
maven {
url "https://github.com/psiegman/mvn-repo/raw/master/releases"
}
}
task initProject() << {
if (hasProperty(initPlugins)) {
initPlugins.split(',').each { plug ->
project.apply {
plugin(plug.trim())
}
}
}
project.sourceSets*.allSource.srcDirTrees.flatten().dir.each { dir ->
dir.mkdirs()
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile 'org.easymock:easymock:3.1'
testCompile 'org.hamcrest:hamcrest-all:1.3'
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.6'
}
def artifacts = []
gradle.addListener(new TaskExecutionListener() {
void afterExecute(Task task, TaskState state) {
if(task in AbstractArchiveTask) {
artifacts << task.outputs.files.singleFile
}
}
void beforeExecute(Task task) { }
})
gradle.addBuildListener(new BuildAdapter() {
void buildFinished(BuildResult result) {
if(artifacts) {
println "\nOutput location: ${artifacts.last()}\n"
}
}
})