-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
73 lines (60 loc) · 2.73 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
apply plugin: 'groovy'
sourceCompatibility = '1.8'
def moquiDir = file(projectDir.absolutePath + '/../../..')
def frameworkDir = file(moquiDir.absolutePath + '/framework')
def componentNode = parseComponent(project)
version = componentNode.@version
// to run use "gradle dependencyUpdates"
apply plugin: 'com.github.ben-manes.versions'
buildscript {
repositories { jcenter() }
dependencies { classpath 'com.github.ben-manes:gradle-versions-plugin:0.13.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')
} } }
// maybe in the future: repositories { mavenCentral() }
repositories {
flatDir name: 'frameworkLib', dirs: frameworkDir.absolutePath + '/lib'
//flatDir name: 'localLib', dirs: projectDir.absolutePath + '/lib'
jcenter()
maven { url "http://dl.bintray.com/andimarek/graphql-java" }
}
dependencies {
compile project(':framework')
compile 'com.graphql-java:graphql-java:4.2'
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)
check.dependsOn.remove(test)
task cleanLib(type: Delete) { delete fileTree(dir: projectDir.absolutePath+'/lib', include: '*') }
clean.dependsOn cleanLib
jar {
destinationDir = file(projectDir.absolutePath + '/lib')
// this is required to change from the default that includes the path to this module (ie 'runtime/base-componet/example')
baseName = componentNode.@name
}
task copyDependencies {
doLast {
copy {
from(configurations.runtime - project(':framework').configurations.runtime - project(':framework').jar.archivePath)
into file(projectDir.absolutePath + '/lib')
}
}
}
copyDependencies.dependsOn cleanLib
jar.dependsOn copyDependencies
test {
dependsOn cleanTest
include '**/MantleUslSuite.class'
systemProperty 'moqui.runtime', moquiDir.absolutePath + '/runtime'
systemProperty 'moqui.conf', 'conf/MoquiDevTestConf.xml'
systemProperty 'moqui.init.static', 'true'
// show standard out and standard error of the test JVM(s) on the console
testLogging.showStandardStreams = true; testLogging.showExceptions = 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}") }
}