-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
85 lines (67 loc) · 1.98 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
/*
* This work is licensed under a Creative Commons Attribution-NonCommercial 3.0 Unported License:
*
* http://creativecommons.org/licenses/by-nc/3.0/
*
* For alternative conditions contact the author.
*
* Copyright (c) 2011 "Robin Wenglewski <robin@wenglewski.de>"
*/
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
// java
sourceCompatibility = 1.6
version = '0.0.3'
jar {
// include all dependency jars in this jars lib/ folder
from configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
manifest {
attributes 'Implementation-Title': 'jb-tree', 'Implementation-Version': version
}
// add source code to distribution jar
from sourceSets.main.allJava
}
sourceSets {
main {
java {
srcDir 'src/main/java'
}
}
test {
java {
srcDir 'src/test/java'
}
}
}
repositories {
mavenCentral()
mavenRepo urls: "http://guice-maven.googlecode.com/svn/trunk"
mavenRepo urls: "http://repository.codehaus.org"
}
dependencies {
compile group: 'com.google.guava', name: 'guava', version: '10.0.1'
compile "commons-logging:commons-logging:1.1.1"
// TEST-COMPILE
testCompile "log4j:log4j:1.2.16"
testCompile "junit:junit:4.10"
testCompile "org.mockito:mockito-all:1.8.5"
testCompile "org.easytesting:fest-assert:1.4"
}
test {
testLogging.showStandardStreams = true
jvmArgs '-Xms1024m', '-Xmx1024m'
}
sourceSets.test.runtimeClasspath += files(sourceSets.test.java.srcDirs)
//************* OWN TASKS ********************
task publishJar(dependsOn: jar) << {
run("cp -f " + jar.archivePath + " /Users/robin/Dropbox/public/jb-tree-0.0.3.jar")
}
//************* HELPER METHODS ********************
// run a command with direct process output
def run(command) {
def process = command.execute()
process.consumeProcessOutput(System.out, System.err)
process.waitForOrKill(0)
return process // use to get exit code et cetera
}