forked from ryanfb/cite-collection-editor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
78 lines (67 loc) · 1.82 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
import org.gradle.plugins.javascript.coffeescript.CoffeeScriptCompile
import org.apache.tools.ant.filters.ReplaceTokens
apply plugin: 'coffeescript-base'
group = "edu.harvard.chs"
version = '0.1.0'
repositories {
mavenCentral()
maven {
url "https://repo.gradle.org/gradle/javascript-public"
}
maven {
url "http://beta.hpcc.uh.edu/nexus/content/repositories/releases"
}
}
configurations {
schemas {
description = 'Manage schemas'
transitive = true
}
}
dependencies {
schemas group: 'edu.harvard.chs', name: 'cite', version: '0.12.20', classifier: 'schemas', ext: 'zip'
}
task compileCoffee(type: CoffeeScriptCompile) {
source fileTree(coffeesrc)
include "**/*.coffee"
destinationDir file("${buildDir.path}/cce/js")
}
task filter(type: Copy) {
from 'src'
into "${buildDir.path}/cce"
include "index.html"
expand(gradle.properties)
filter(ReplaceTokens, tokens: [google_client_id: google_client_id, capabilities_url: capabilities_url])
}
task copy(type: Copy) {
from 'src'
into "${buildDir.path}/cce"
include "**/*.html"
include "**/*.js"
include "**/*.coffee"
include "**/*.css"
include "**/*.xml"
include "**/*.png"
include "**/*.swf"
exclude "index.html"
exclude "js/collection-editor.js"
from({zipTree(configurations.schemas.singleFile)}) {
into 'capabilities'
include 'collections/CiteCollection.rng'
eachFile { FileCopyDetails fcp ->
if (fcp.relativePath.pathString.startsWith('capabilities/collections/')) {
fcp.relativePath = new RelativePath(true, "capabilities", fcp.relativePath.segments[-1])
} else {
fcp.exclude()
}
}
}
}
task buildZip(type: Zip) {
dependsOn compileCoffee, filter, copy
from "${buildDir.path}/cce"
description = 'Builds zip file of java/groovy docs'
}
artifacts {
archives buildZip
}