-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
95 lines (84 loc) · 4.42 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
/*
* This software is in the public domain under CC0 1.0 Universal plus a
* Grant of Patent License.
*
* To the extent possible under law, the author(s) have dedicated all
* copyright and related and neighboring rights to this software to the
* public domain worldwide. This software is distributed without any
* warranty.
*
* You should have received a copy of the CC0 Public Domain Dedication
* along with this software (see the LICENSE.md file). If not, see
* <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
apply plugin: 'groovy'
def componentNode = parseComponent(project)
version = componentNode.'@version'
def jarBaseName = componentNode.'@name'
def moquiDir = projectDir.parentFile.parentFile.parentFile
def frameworkDir = file(moquiDir.absolutePath + '/framework')
// to run use "gradle dependencyUpdates"
apply plugin: 'com.github.ben-manes.versions'
buildscript {
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies { classpath 'com.github.ben-manes:gradle-versions-plugin:0.42.0' }
}
dependencyUpdates.resolutionStrategy = { componentSelection { rules -> rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier -> selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ }
if (rejected) selection.reject('Release candidate')
} } }
repositories {
flatDir name: 'localLib', dirs: frameworkDir.absolutePath + '/lib'
flatDir name: 'librepo', dirs: projectDir.absolutePath + '/librepo'
mavenCentral()
}
// Log4J has annotation processors, disable to avoid warning
tasks.withType(JavaCompile) { options.compilerArgs << "-proc:none" }
tasks.withType(GroovyCompile) { options.compilerArgs << "-proc:none" }
dependencies {
implementation project(':framework')
// javax.rules, needed for Drools
implementation 'jsr94:jsr94:1.1' // ???
// KIE Libraries: Drools/jBPM/etc
implementation 'org.kie:kie-api:7.3.0.Final' // Apache 2.0
implementation 'org.drools:drools-core:7.3.0.Final' // Apache 2.0
implementation 'org.drools:drools-jsr94:7.2.0.Final' // Apache 2.0
// another big mess drools-compiler depends on a bunch of stuff, including xstream which depends on xmlpull which is
// included in xpp3:xpp3_min, ie redundant classes; so bunch of manual dependencies
implementation module('org.drools:drools-compiler:7.3.0.Final') // Apache 2.0
runtimeOnly 'org.antlr:antlr-runtime:3.5.2'
runtimeOnly 'org.mvel:mvel2:2.3.2.Final'
runtimeOnly module('com.thoughtworks.xstream:xstream:1.4.10')
runtimeOnly 'xpp3:xpp3_min:1.1.4c' // leave out xmlpull here
runtimeOnly 'com.google.protobuf:protobuf-java:3.4.0'
// NOTE: drools java dialect options include ECLIPSE, JANINO, and NATIVE; NATIVE would be good but broken now with Java 8
// using older version of Janino (2.5.16) as it is the latest version Drools supports
runtimeOnly 'org.codehaus.janino:janino:2.5.16' // New BSD
// 'org.codehaus.janino:janino:2.7.8', 'org.codehaus.janino:commons-compiler:2.7.8', 'org.codehaus.janino:commons-compiler-jdk:2.7.8'
// ECJ latest works fine with Drools but is much bigger/etc and so far we are using mvel and not java dialect anyway
// runtimeOnly 'org.eclipse.jdt.core.compiler:ecj:4.5.1'
implementation ('org.drools:drools-decisiontables:7.3.0.Final') { // Apache 2.0
exclude group: 'org.apache.poi'
}
implementation 'org.apache.poi:poi:3.17'
// NOTE: org.apache.poi:poi-ooxml-schemas is a required dependency for drools-decisiontables (through poi-ooxml), but it's a huge file and runs fine without it
implementation module('org.apache.poi:poi-ooxml:3.17')
}
// by default the Java plugin runs test on build, change to not do that (only run test if explicit task)
// no longer workds as of gradle 4.8 or possibly earlier, use clear() instead: check.dependsOn.remove(test)
check.dependsOn.clear()
task cleanLib(type: Delete) { delete fileTree(dir: projectDir.absolutePath+'/lib', include: '*') }
clean.dependsOn cleanLib
jar {
destinationDirectory = file(projectDir.absolutePath + '/lib')
archiveBaseName = jarBaseName
}
task copyDependencies { doLast {
copy { from (configurations.runtimeClasspath - project(':framework').configurations.runtimeClasspath - project(':framework').jar.archivePath)
into file(projectDir.absolutePath + '/lib') }
} }
copyDependencies.dependsOn cleanLib
jar.dependsOn copyDependencies