-
Notifications
You must be signed in to change notification settings - Fork 3
/
settings.gradle
executable file
·40 lines (31 loc) · 1.43 KB
/
settings.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
import java.nio.file.Paths
rootProject.name = 'AutoMerge'
def jNativeMergeName = 'JNativeMerge'
def jNativeMergeBranch = 'master'
def jNativeMergeURI = 'https://gitlab.infosun.fim.uni-passau.de/seibt/JNativeMerge.git'
def jNativeMergeDir = Paths.get(rootProject.projectDir.absolutePath, '..', jNativeMergeName).toFile().canonicalFile
if (!jNativeMergeDir.exists()) {
logger.lifecycle("Cloning $jNativeMergeName dependency...")
ProcessBuilder cloneBuilder = new ProcessBuilder('git', 'clone', jNativeMergeURI, jNativeMergeName)
cloneBuilder.directory(new File('..'))
cloneBuilder.redirectErrorStream(true)
Process clone = cloneBuilder.start()
def output = clone.inputStream.text
if (clone.waitFor() != 0) {
logger.error('Failed to clone ' + jNativeMergeURI)
logger.error(output)
throw new GradleException('Failed to clone dependencies.')
} else {
ProcessBuilder checkoutBuilder = new ProcessBuilder('git', 'checkout', jNativeMergeBranch)
checkoutBuilder.directory(jNativeMergeDir)
checkoutBuilder.redirectErrorStream(true)
Process checkout = checkoutBuilder.start()
output = checkout.inputStream.text
if (checkout.waitFor() != 0) {
logger.error('Failed to checkout ' + jNativeMergeBranch)
logger.error(output)
throw new GradleException('Failed to checkout dependencies.')
}
}
}
includeFlat(jNativeMergeName)