This repository has been archived by the owner on Jul 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
100 lines (80 loc) · 3.15 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
100
import static groovy.io.FileType.FILES
import org.slf4j.Logger
import org.slf4j.LoggerFactory
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'application'
group = 'edu.umd.lib'
version = '1.0-SNAPSHOT'
description = """xls2drl"""
sourceCompatibility = 1.7
targetCompatibility = 1.7
mainClassName = "edu.umd.lib.XlsToDrlApp"
Logger log = LoggerFactory.getLogger('build.gradle')
repositories {
maven {
name 'central'
url 'http://repo1.maven.org/maven2'
}
maven {
name 'jboss'
url 'http://repository.jboss.org/nexus/content/groups/public-jboss'
}
}
dependencies {
compile group: 'com.martiansoftware', name: 'jsap', version:'2.1'
compile group: 'org.apache.logging.log4j', name: 'log4j-api', version:'2.3'
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.3'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version:'2.0'
compile group: 'org.kie', name: 'kie-api', version:'6.2.0.Final'
compile group: 'org.drools', name: 'drools-compiler', version:'6.2.0.Final'
compile group: 'org.drools', name: 'drools-decisiontables', version:'6.2.0.Final'
testCompile group: 'junit', name: 'junit', version:'3.8.1'
}
// Taken from http://mrhaki.blogspot.com/2015/04/gradle-goodness-alter-start-scripts.html
// Modifies start scripts to include the "conf" directory in the CLASSPATH.
startScripts {
// Support closures to add an additional element to
// CLASSPATH definition in the start script files.
def configureClasspathVar = { findClasspath, pathSeparator, dirSeparator, line ->
// Looking for the line that starts with either CLASSPATH=
// or set CLASSPATH=, defined by the findClasspath closure argument.
line = line.replaceAll(~/^${findClasspath}=.*$/) { original ->
// Get original line and append it
// with the configuration directory.
// Use specified path separator, which is different
// for Windows or Unix systems.
original += "${pathSeparator}\$APP_HOME${dirSeparator}conf"
}
}
def configureUnixClasspath = configureClasspathVar.curry('CLASSPATH', ':', '/')
def configureWindowsClasspath = configureClasspathVar.curry('set CLASSPATH', ';', '\\')
// The default script content is generated and
// with the doLast method we can still alter
// the contents before the complete task ends.
doLast {
// Alter the start script for Unix systems.
unixScript.text =
unixScript
.readLines()
.collect(configureUnixClasspath)
.join('\n')
// Alter the start script for Windows systems.
windowsScript.text =
windowsScript
.readLines()
.collect(configureWindowsClasspath)
.join('\r\n')
}
}
// Recursively deletes files in buildDir, but leaves the directories
// intact.
task scrub {
description 'Removes files from the build directory, but leaves directories intact.'
if (buildDir.exists()) {
new File(buildDir.getPath()).eachFileRecurse(FILES) {
log.debug( "Deleting " + it )
it.delete()
}
}
}