-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.gradle
123 lines (103 loc) · 3.35 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
116
117
118
119
120
121
122
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'shadow'
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
project.sourceCompatibility = 1.7
project.targetCompatibility = 1.7
repositories {
mavenCentral()
}
configurations {
/** Guice 2.0 has been superseded...this is in openid4java which needs to be updated **/
all*.exclude group: 'com.google.code.guice'
}
dependencies {
compile "com.yammer.dropwizard:dropwizard-core:$dropwizardVersion"
/** Authentication support **/
compile "com.yammer.dropwizard:dropwizard-auth:$dropwizardVersion"
/** Resource testing support **/
compile "com.yammer.dropwizard:dropwizard-testing:$dropwizardVersion"
/** HTML Freemarker views support **/
compile "com.yammer.dropwizard:dropwizard-views:$dropwizardVersion"
/** REST client support for upstream data **/
compile "com.yammer.dropwizard:dropwizard-client:$dropwizardVersion"
/** OpenID library **/
/** Guice 2.0 has been superseded **/
compile ('org.openid4java:openid4java-consumer:0.9.6') {
exclude group: 'com.google.code.guice'
}
compile "com.google.inject:guice:3.0"
/** OAuth library **/
compile "org.brickred:socialauth:4.+";
compile "org.brickred:socialauth-filter:2.+";
/** markdown support for web pages **/
compile "org.pegdown:pegdown:1.1.0"
}
jar {
manifest {
attributes 'Main-Class': pkgname+'.'+appclass
}
}
/**
* One-JAR plugin integration
*/
buildscript {
repositories {
maven {
name 'Gradle Shadow'
url 'http://dl.bintray.com/content/johnrengelman/gradle-plugins'
}
}
dependencies {
classpath 'org.gradle.plugins:shadow:0.7.4'
}
}
import org.gradle.api.plugins.shadow.transformers.AppendingTransformer
shadow {
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
transformer(AppendingTransformer) {
resource = 'META-INF/spring.handlers'
}
transformer(AppendingTransformer) {
resource = 'META-INF/spring.schemas'
}
}
task run(dependsOn: 'classes', type: JavaExec) {
main = pkgname+'.'+appclass
classpath = sourceSets.main.runtimeClasspath
args 'server','app.yml'
}
project.ext {
oneJarName = jarprefix+'-'+version+'-standalone.jar'
shadowJarName = jarprefix+'-'+version+'-shadow.jar'
}
task runShadow(type:Exec, dependsOn: 'shadow') {
workingDir = "build/libs"
commandLine = ['java', '-jar', '-server', project.shadowJarName,'server','../../app.yml']
}
task bdd(type: Exec, dependsOn: 'shadow') {
description = "Tests BDDs against the running application"
// fix to run cucumber on a particular infernal OS properly
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'cmd', '/c', 'bundle.bat', 'exec', 'cucumber'
}
else {
commandLine = ['cucumber']
}
workingDir = "./src/test/resources/bdd"
def jarProcess = null
doFirst{
println "Starting application on separate thread..."
Thread.startDaemon {
jarProcess = 'java -jar -server build/libs/'+project.shadowJarName+' server app.yml'.execute()
}
println "Waiting for application to start before executing tests..."
addShutdownHook {
println "Shutting down application"
jarProcess.destroy()
}
}
}