-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
109 lines (81 loc) · 2.84 KB
/
build.gradle
File metadata and controls
109 lines (81 loc) · 2.84 KB
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
apply plugin: 'java'
//source file dir is required to be specified, because current dir is not consistent with default gradle one
//the default gradle directoryies, either. read this url: http://blog.csdn.net/caolaosanahnu/article/details/17022321
//sourceSets {
// main {
// java.srcDir "$projectDir/src"
// }
//
// test{
// java.srcDir "$projectDir/test"
// }
//}
repositories {
flatDir(dirs: "$projectDir/lib")
mavenCentral()
}
dependencies {
compile ':log4j-api:+'
compile ':log4j-core:+'
compile ':apache-log4j-extras:+'
compile ':slf4j-api:+'
compile ':guava:+'
compile ':bsh-core:+'
//compile("org.quickfixj:quickfixj-core:2.0.0")
compile ':quickfixj-core:1.6.0'
compile ':quickfixj-codegenerator:1.6.0'
compile ':mina-core:+'
testCompile 'junit:junit:4.8.2'
}
task taskA{
println "i am task A, and do nothing but print this line"
}
//https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/Test.html
test {
println "i am in test task"
// enable TestNG support (default is JUnit)
//useTestNG()
// set a system property for the test JVM(s)
systemProperty 'some.prop', 'value'
// explicitly include or exclude tests
//include 'org/foo/**'
//exclude 'org/boo/**'
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true
// set heap size for the test JVM(s)
minHeapSize = "128m"
maxHeapSize = "512m"
// set JVM arguments for the test JVM(s)
jvmArgs '-XX:MaxPermSize=256m'
// listen to events in the test execution lifecycle
beforeTest { descriptor ->
logger.lifecycle("Running test: " + descriptor)
}
// listen to standard out and standard error of the test JVM(s)
onOutput { descriptor, event ->
logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message )
}
}
//make sure test cases are executed - DONE
//search 'test' as key word, you will find all test related tasks/sections
//https://discuss.gradle.org/t/how-to-configure-test-src-dir/6829/2
//sourceCompatibility and version cannot be defined in settings.gradle, because it will complain > No such property: version for class: org.gradle.initialization.DefaultSettings_Decorated
//TODO support to read from jenkins
sourceCompatibility = 1.8
version = new Date().format('yyyy-MM-dd_HHmmss.S')
jar {
manifest {
attributes 'Implementation-Title': 'Baoying QuickfixJ Tutorial',
'Implementation-Version': version
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
//http://stackoverflow.com/questions/11474729/how-to-build-sources-jar-with-gradle
artifacts {
//NOTE that java class jar would be build by default. Not required to add anything here
//NOT easy to build javadoc, too.. refer the link.
archives sourcesJar
}