This repository has been archived by the owner on Dec 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
203 lines (163 loc) · 5.26 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
buildscript {
dependencies {
classpath "com.moowork.gradle:gradle-node-plugin:1.1.1"
}
repositories {
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
}
plugins {
id 'io.spring.dependency-management' version '1.0.0.RC2'
id 'com.moowork.node' version '1.1.1'
id 'org.springframework.boot' version '1.5.7.RELEASE'
}
group 'petfinder'
version '1.0-SNAPSHOT'
apply plugin: 'project-report'
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.moowork.node'
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://repo.spring.io/libs-milestone"
}
}
dependencyManagement {
imports {
mavenBom 'io.spring.platform:platform-bom:Brussels-SR4'
mavenBom 'org.apache.logging.log4j:log4j-bom:2.7'
}
}
dependencies {
compile group: 'org.springframework.boot', name: 'spring-boot-starter-web'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-security'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf'
compile group: 'org.springframework.security', name: 'spring-security-jwt'
compile group: 'org.springframework.security.oauth', name: 'spring-security-oauth2'
compile group: 'org.apache.logging.log4j', name: 'log4j-api'
compile group: 'org.apache.logging.log4j', name: 'log4j-core'
compile group: 'org.apache.logging.log4j', name: 'log4j-jcl'
compile group: 'org.apache.logging.log4j', name: 'log4j-jul'
compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl'
compile group: 'org.apache.logging.log4j', name: 'log4j-1.2-api'
compile group: 'com.google.guava', name: 'guava', version: '23.6-jre'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.3'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.9.3'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.3'
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.9.3'
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jdk8', version: '2.9.3'
compile group: 'org.elasticsearch', name: 'elasticsearch', version: '6.4.2'
compile group: 'org.elasticsearch.client', name: 'elasticsearch-rest-high-level-client', version: '6.4.2'
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.4.0-b180725.0427'
compile group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0.1'
compile group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.4.0-b180725.0644'
compile group: 'javax.activation', name: 'activation', version: '1.1.1'
compile 'com.mashape.unirest:unirest-java:1.3.27'
testCompile group: 'junit', name: 'junit'
testCompile 'org.mockito:mockito-core:2.23.0'
}
configurations.all {
exclude group: "log4j", module: "log4j"
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "org.slf4j", module: "jcl-over-slf4j"
exclude group: "org.slf4j", module: "jul-to-slf4j"
exclude group: "org.slf4j", module: "log4j-over-slf4j"
exclude group: "junit", module: "junit-dep"
exclude group: 'ch.qos.logback'
}
task buildTests(type: Jar, dependsOn: 'test') {
from sourceSets.test.output
baseName "${baseName}-test"
}
configurations {
tests {
extendsFrom testRuntime
}
}
artifacts {
tests buildTests
}
tasks.build.dependsOn buildTests
test {
exclude '**/test/integration/**'
exclude '**/test/functional/**'
exclude '**/test/harness/**'
}
task integrationTest(type: Test, dependsOn: 'testClasses') {
testClassesDir = sourceSets.test.output.classesDir
classpath = sourceSets.test.runtimeClasspath
jvmArgs = ["-Druntime.environment=integrationdev"]
exclude "**/test/unit/**"
exclude "**/test/functional/**"
exclude "**/test/harness/**"
}
task functionalTest(type: Test, dependsOn: 'build') {
testClassesDir = sourceSets.test.output.classesDir
classpath = sourceSets.test.runtimeClasspath
// set the browser driver if given
if (project.hasProperty("pet.test.driver")) {
jvmArgs "-pet.test.driver=" + project.getProperty("pet.test.driver")
}
// set the target environment if given
if (project.hasProperty("pet.test.target")) {
jvmArgs "-pet.test.target=" + project.getProperty("pet.test.target")
}
exclude "**/test/unit/**"
exclude "**/test/integration/**"
exclude "**/test/harness/**"
}
def isNpmInstalled() {
try {
exec {
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
commandLine "npm.cmd", "--version"
} else {
commandLine "npm", "--version"
}
}
} catch (Exception e) {
return false
}
return true
}
node {
if (isNpmInstalled()) {
download = false
} else {
version = '7.7.3'
npmVersion = '4.1.2'
download = true
}
}
task petInstall(type: NpmTask) {
args = ['install']
}
task webpack(type: NpmTask, dependsOn: 'petInstall') {
if (project.hasProperty("release")) {
args = ['run', 'build-release']
} else {
args = ['run', 'build']
}
}
task testJs(type: NpmTask) {
args = ['test']
}
processResources {
from ('build/statics') {
include '*.*'
exclude 'index.html'
into 'statics'
}
}
tasks.processResources.dependsOn webpack
task stage() {
dependsOn clean, build
}
build.mustRunAfter clean