-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
78 lines (60 loc) · 2.09 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
apply plugin: 'pl.allegro.tech.build.axion-release'
project.ext.set("glueVersion", "1.1.107")
project.version = scmVersion.version
repositories {
mavenLocal()
}
configurations {
gluetoolsCore
}
dependencies {
gluetoolsCore group: 'cvr.ac.uk', name: 'gluetools-core', version: project.glueVersion, transitive: false
}
buildscript {
repositories {
// for axion-release
mavenCentral()
}
dependencies {
classpath group: 'commons-io', name: 'commons-io', version: '1.3.2'
classpath group: 'pl.allegro.tech.build', name: 'axion-release-plugin', version: '1.9.3'
}
}
task copyGluetoolsJar(type: Copy) {
from configurations.gluetoolsCore
into "$buildDir/runtimeJars"
rename('gluetools-core-'+project.glueVersion+'.jar', 'gluetools-core.jar')
}
def glueConfigFile = 'remote-gluetools-config.xml'
task wipeHbvGlueDB(type: Exec) {
commandLine "bash", "-c", "echo 'drop database HBV_GLUE; create database HBV_GLUE character set UTF8;' | mysql -u hbvglue --password=hbvglue"
}
task buildHbvGlueDB(type: JavaExec, dependsOn: 'copyGluetoolsJar') {
classpath "build/runtimeJars/gluetools-core.jar"
main 'uk.ac.gla.cvr.gluetools.core.console.Console'
args '-c', glueConfigFile, '-i', 'run', 'file', 'hbvProject.glue'
}
task dumpHbvGlueDB(type: Exec, dependsOn: 'buildHbvGlueDB') {
standardOutput = new FileOutputStream(new File('/tmp/hbv_glue.sql'))
commandLine '/usr/local/mysql/bin/mysqldump', '-u', 'hbvglue', '--password=hbvglue', 'HBV_GLUE'
}
task zipHbvGlueDB(type: Exec, dependsOn: 'dumpHbvGlueDB') {
commandLine '/usr/bin/gzip', '-f', '/tmp/hbv_glue.sql'
}
// Gradle release plugin
def scmCustomKey = '/Users/evdoxiataka/.ssh/github_id_rsa_old_format'
scmVersion {
hooks {
pre 'fileUpdate', [file: 'glue/hbvProjectSettings.glue', pattern: {v, c -> /set setting project-version $v/}, replacement: {v, c -> "set setting project-version $v"}]
pre 'commit', {v, p -> "Release version $v"}
}
scmVersion {
versionCreator 'versionWithBranch'
repository {
customKey = file(scmCustomKey)
}
tag {
prefix = 'HBV-GLUE'
}
}
}