-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
146 lines (122 loc) · 4.19 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
buildscript {
ext {
springBootVersion = '2.0.3.RELEASE'
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
plugins {
id "com.moowork.node" version "1.2.0"
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'maven-publish'
//******************** Angular Part ********************
node {
// Version of node to use.
version = '10.13.0'
// Version of npm to use.
npmVersion = '6.2.0'
// Base URL for fetching node distributions (change if you have a mirror).
distBaseUrl = 'https://nodejs.org/dist'
// If true, it will download node using above parameters.
// If false, it will try to use globally installed node.
download = true
// Set the work directory for unpacking node
workDir = file("${project.buildDir}/web/reactiveUI/nodejs")
// Set the work directory for NPM
npmWorkDir = file("${project.buildDir}/web/reactiveUI/npm")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}/web/reactiveUI")
}
task cleanProject {
doFirst {
delete "web/reactiveUI/node_modules"
delete "web/reactiveUI/dist"
delete "src/main/resources/static"
}
doLast {
println "Cleaned the following\n\tweb/reactiveUI/node_modules\n\tweb/reactiveUI/dist\n\tsrc/main/resources/static"
}
}
task buildAngularProject(type: NpmTask) {
doFirst {
println "Building Angular Project..."
// Runs the build script from package.json
args = ['run-script', 'build_prod']
}
}
task springAngularMerge() {
doFirst {
println "Cleaning resources in Spring Boot..."
delete "src/main/resources/static"
mkdir 'src/main/resources/static'
copy {
from 'web/reactiveUI/dist/reactiveUI/'
into 'src/main/resources/static/'
}
}
doLast {
println 'Merged the Angular binaries into Spring Boot...'
}
}
//******************** Angular Part End ********************
group = 'org.springredis'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
// This will make sure that jar task runs even though there is a bootJar task
jar {
enabled = true
}
// This makes sure that bootJar task does not create a jar with the same name as jar task
bootJar {
classifier = 'boot'
}
// Publish to local maven repo
publishing {
publications {
maven(MavenPublication) {
from components.java
}
}
}
//Building Gradle dependency tree
clean.dependsOn(cleanProject)
buildAngularProject.dependsOn(npmInstall)
springAngularMerge.dependsOn(buildAngularProject)
if(System.getProperty("buildUI") == null || System.getProperty("buildUI") == "yes")
compileJava.dependsOn(springAngularMerge)
build.dependsOn(publishToMavenLocal)
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-redis')
compile('org.springframework.boot:spring-boot-starter-data-redis-reactive')
compile('org.apache.commons:commons-pool2:2.0')
// https://mvnrepository.com/artifact/redis.clients/jedis
compile group: 'redis.clients', name: 'jedis', version: '2.9.0'
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-webflux')
compileOnly('org.projectlombok:lombok:1.18.2')
compile('org.springframework.boot:spring-boot-starter-websocket')
compile('org.webjars:webjars-locator-core')
compile('org.webjars:sockjs-client:1.0.2')
compile('org.webjars:stomp-websocket:2.3.3')
compile('org.webjars:bootstrap:3.3.7')
compile('org.webjars:jquery:3.1.0')
// Swagger
compile group: 'io.springfox', name: 'springfox-swagger2', version: '2.8.0'
compile group: 'io.springfox', name: 'springfox-swagger-ui', version: '2.8.0'
runtime('org.springframework.boot:spring-boot-devtools')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('io.projectreactor:reactor-test')
}