This repository has been archived by the owner on Dec 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
75 lines (67 loc) · 1.45 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
def JENA_VERSION='3.16.0'
def DATASET_FILES='$(find dataset/* -type f)'
def TDB_LOCATION='fuseki/run/databases/dataset'
configurations {
jenaServer
jenaTdbLoader
}
repositories {
jcenter()
}
dependencies {
jenaServer "org.apache.jena:jena-fuseki-fulljar:$JENA_VERSION"
jenaTdbLoader "org.apache.jena:jena-cmds:$JENA_VERSION"
}
task clean {
doLast {
delete {
delete "fuseki/jar", "fuseki/lib", "$TDB_LOCATION"
}
}
}
task tdbclean {
doLast {
delete {
delete "$TDB_LOCATION"
}
}
}
task download() {
mustRunAfter clean
doLast {
// download jena standalone server
copy {
from configurations.jenaServer
into 'fuseki/jar'
}
// download tdbloader command
copy {
from configurations.jenaTdbLoader
into 'fuseki/lib'
}
def binDir = new File("fuseki/bin")
binDir.mkdirs()
for (f in ['tdbloader2', 'tdbloader2common', 'tdbloader2data', 'tdbloader2index']) {
exec {
executable "sh"
args "-c", "curl --silent https://raw.githubusercontent.com/apache/jena/jena-$JENA_VERSION/apache-jena/bin/$f > fuseki/bin/$f"
}
}
exec {
executable "sh"
args "-c", "chmod +x fuseki/bin/tdbloader2*"
}
}
}
task tdbload() {
mustRunAfter clean, tdbclean, download
doLast {
exec{
executable "sh"
args "-c", "fuseki/bin/tdbloader2 --loc $TDB_LOCATION $DATASET_FILES"
}
}
}
task stage() {
dependsOn download, tdbload
}