-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.gradle
84 lines (73 loc) · 2.54 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
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath group: 'org.intermine', name: 'plugin', version: System.getProperty("imVersion")
classpath 'com.bmuschko:gradle-cargo-plugin:2.8.0'
}
}
ext {
mineRelease = hasProperty('release') ? "." + release : ''
mineName = "biotestmine"
minePropertyFileName = "${mineName}.properties$mineRelease"
minePropertyFile = "${System.env.HOME}/.intermine/$minePropertyFileName"
if( !file(minePropertyFile).exists() ) {
minePropertyFile = "$project.rootDir/dbmodel/resources/biotestmine.properties"
}
println "Using properties file: '$minePropertyFile'"
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://clojars.org/repo"
}
}
dependencies {
compile group: "org.intermine", name: "intermine-resources", version: System.getProperty("imVersion")
compile('ant:ant:1.6.5')
testCompile group: 'junit', name: 'junit', version: '4.8.2'
}
task copyMineProperties(type: Copy) {
description "Copies mine specific intermine.properties file (from .intermine directory) into resources output to be included in the war"
dependsOn 'processResources'
def db_username = System.getenv('USER')
def db_pw = System.getenv('USER')
// use ENV VARs instead if they've set them. need for travis
if (System.getenv('PSQL_USER')) {
db_username = System.getenv('PSQL_USER')
}
if (System.getenv('PSQL_PWD')) {
db_pw = System.getenv('PSQL_PWD')
}
from (minePropertyFile) {
filter{String line -> line.replaceAll('PSQL_USER', db_username)}
filter{String line -> line.replaceAll('PSQL_PWD', db_pw)}
}
into sourceSets.main.output.resourcesDir
rename { fileName -> fileName.replace("$minePropertyFileName", "intermine.properties") }
inputs.sourceFiles.stopExecutionIfEmpty()
}
}
task clean(type: Delete) {
println "cleaning"
delete "idresolver.cache"
println "deleting idresolver cache"
delete "datasources.xml"
println "deleting datasources.xml"
delete "organisms.xml"
println "deleting organisms.xml"
delete "publications.xml"
println "deleting publications.xml"
delete fileTree('.') {
include '*.log'
}
println "deleted log files"
}