-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
115 lines (101 loc) · 3.2 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/**
* Attempt to find the Groovy version to use depending on the Groovy JAR present
* in $SEARCH_HOME/lib/java/all/groovy-(all-)X.Y.Z.jar and the Funnelback release
*
* @return A Groovy version number
* @throws IllegalStateException if the Groovy JAR cannot be located
*/
def findGroovyVersion () {
def groovyJar = file(java.nio.file.Paths.get(System.getenv("SEARCH_HOME"), "lib/java/all/"))
.listFiles()
.find() { file -> file.name.matches(/groovy-(all-)?\d\.\d\.\d\.jar/) }
if (!groovyJar) {
throw new IllegalStateException("Unable to locate groovy-X.Y.Z.jar file in in \$SEARCH_HOME/lib/java/all/")
}
return groovyJar.name
.replace("groovy-", "")
.replace(".jar", "")
}
plugins {
id 'groovy'
id 'distribution'
}
repositories {
mavenCentral()
}
project.ext {
groovyVersion = findGroovyVersion()
}
project.with {
group = 'com.funnelback.stencils'
version = 'master-SNAPSHOT'
defaultTasks 'build'
}
dependencies {
testCompile (
'junit:junit:4.+',
'org.mockito:mockito-core:1.+'
)
compile (
"org.codehaus.groovy:groovy-all:${groovyVersion}",
fileTree(dir: "${System.getenv("SEARCH_HOME")}/lib/java/all/", include: '*.jar'),
/**
* Add script specific dependencies here that are used with @Grapes/@Grab
*
* Unfortunately, these third party dependencies have to be defined twice, once
* in the filter/script itself with @Grapes/@Grab and once again below this
* comment block.
* The definition in this file allows the Gradle build to run the test suite
* for the scripts as JUnit can't compile the tests if they use a @Grapes
* dependency.
*/
"us.codecraft:xsoup:0.3.1",
"com.jcraft:jsch:0.1.55",
)
}
compileGroovy {
groovyOptions.configurationScript = file("gradle/config.groovy")
}
test {
testLogging {
exceptionFormat = 'full'
}
}
distributions {
stencils {
baseName 'stencils'
contents {
includeEmptyDirs = false
exclude(
// Build output
'build',
'out',
// Stencils v1 stuff we don't want to distribute
'libraries/@docs',
'libraries/@default',
'libraries/**/controllers',
'libraries/**/views',
'resources/noresult',
'resources/facebook',
'resources/places',
'resources/compare',
'resources/recommender',
'resources/tabs',
'resources/courses',
'resources/core',
'resources/jira',
'resources/people',
'resources/social',
'resources/twitter',
'resources/flickr',
'resources/people',
'resources/youtube',
// Old Metadata scraper that's now part of the product
'src/main/groovy/com/funnelback/stencils/filter/scraper',
// IDE project files
'.idea',
)
from { '.' }
}
}
}