forked from moqui/example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
67 lines (55 loc) · 2.36 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
/*
* 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'
version = '2.1.3'
sourceCompatibility = '1.8'
def moquiDir = file(projectDir.absolutePath + '/../../..')
def frameworkDir = file(moquiDir.absolutePath + '/framework')
// maybe in the future: repositories { mavenCentral() }
repositories {
flatDir name: 'localLib', dirs: frameworkDir.absolutePath + '/lib'
jcenter()
}
// Log4J has annotation processors, disable to avoid warning
tasks.withType(JavaCompile) { options.compilerArgs << "-proc:none" }
tasks.withType(GroovyCompile) { options.compilerArgs << "-proc:none" }
dependencies {
compile project(':framework')
testCompile project(':framework').configurations.testCompile.allDependencies
}
// 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()
jar {
destinationDirectory = file(projectDir.absolutePath + '/lib')
// this is required to change from the default that includes the path to this module (ie 'runtime/component/example')
archiveBaseName = 'example'
}
task cleanLib(type: Delete) { delete file(jar.archivePath) }
clean.dependsOn cleanLib
test {
dependsOn cleanTest
include '**/ExampleSuite.class'
systemProperty 'moqui.runtime', moquiDir.absolutePath + '/runtime'
systemProperty 'moqui.conf', 'conf/MoquiDevConf.xml'
systemProperty 'moqui.init.static', 'true'
maxHeapSize = "512M"
testLogging.showStandardStreams = true
classpath += files(sourceSets.main.output.classesDirs)
// filter out classpath entries that don't exist (gradle adds a bunch of these), or ElasticSearch JarHell will blow up
classpath = classpath.filter { it.exists() }
beforeTest { descriptor ->
logger.lifecycle("Running test: ${descriptor}")
}
}