-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
70 lines (57 loc) · 2.26 KB
/
build.gradle
File metadata and controls
70 lines (57 loc) · 2.26 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
apply plugin: 'java'
apply plugin: 'eclipse'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
defaultTasks 'build'
task cleanLog(type: Delete) { delete fileTree(dir: './logs', include: '*.log') }
def allCleanTasks = getTasksByName('clean', true)
def allBuildTasks = getTasksByName('build', true)
task cleanAll {
dependsOn cleanLog
dependsOn clean
}
task run(type: JavaExec) {
dependsOn cleanLog
dependsOn allBuildTasks
workingDir = '.'; jvmArgs = ['-server', '-XX:MaxPermSize=192m', '-XX:-OmitStackTraceInFastThrow']; maxHeapSize = '256M'
//systemProperties = ['moqui.conf':moquiConfDev, 'moqui.runtime':moquiRuntime]
// NOTE: this is a hack, using -jar instead of a class name, and then the first argument is the name of the jar file
//main = '-jar'; args = [jar.archivePath]
main = 'com.thehackerati.gradle.javaJourney'
classpath = sourceSets.main.runtimeClasspath
}
repositories {
mavenCentral()
}
dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.4.1'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.4.1'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.4.1'
// following required to test using AsyncLoggers for Log4j2
compile group: 'com.lmax', name: 'disruptor', version: '3.+'
testCompile group: 'junit', name: 'junit', version: '4.+'
// following required to test using AsyncLoggers for Log4j2
testCompile group: 'com.lmax', name: 'disruptor', version: '3.+'
}
sourceCompatibility = 1.7
version = '1.0'
jar {
// the from line pulls in all dependency libraries directly into the jar
// so you can run simply as java -jar jarfile.jar
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
manifest {
attributes 'Main-Class': 'com.thehackerati.gradle.javaJourney',
'Implementation-Title': 'Rob\'s Java Journey',
'Implementation-Version': version
}
}
test {
systemProperties 'property': 'value'
}
uploadArchives {
repositories {
flatDir {
dirs 'repos'
}
}
}