-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
64 lines (51 loc) · 1.85 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
import java.nio.file.Files
import java.nio.file.Paths
buildscript {
repositories {
mavenLocal()
maven {url 'https://jenkins.cs.ox.ac.uk/artifactory/plugins-snapshot'}
maven {url 'https://jenkins.cs.ox.ac.uk/artifactory/plugins-release'}
maven {url "https://repo.grails.org/grails/core"}
}
dependencies {
classpath "uk.ac.ox.softeng.maurodatamapper.gradle:mdm-gradle-plugin:$mdmGradlePluginVersion"
}
}
plugins {
id 'groovy'
id 'java-library'
}
apply plugin: 'uk.ac.ox.softeng.maurodatamapper.gradle.mdm-gradle'
codenarcMain {
compilationClasspath = sourceSets.main.compileClasspath + sourceSets.main.output
}
codenarcTest {
compilationClasspath = codenarcMain.compilationClasspath + sourceSets.test.compileClasspath + sourceSets.test.output
}
afterEvaluate {
/*
* Configure all the properties for testing,
* these are also required by the gretty startbasetasks,
* anything which runs up the app needs alot of these properties to make sure it all works
* If system property for the index base isnt set then create a value
*/
if (!System.getProperty('hibernate.search.default.indexBase')) {
System.setProperty('hibernate.search.default.indexBase', "/tmp/${UUID.randomUUID().toString()}")
}
Closure runConfig = {
System.properties.each {prop ->
systemProperty prop.key, prop.value
}
systemProperty 'user.dir', projectDir
String indexBase = systemProperties['hibernate.search.default.indexBase']
doFirst {
logger.warn("==> Using ${indexBase} for hibernate.search.default.indexBase <==")
Files.createDirectories(Paths.get(indexBase))
}
doLast {
Paths.get(indexBase).deleteDir()
}
}
tasks.withType(Test, runConfig)
}
apply from: 'dependencies.gradle'