This repository has been archived by the owner on Jan 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
98 lines (79 loc) · 2.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
buildscript {
ext {
springBootVersion = '1.4.0.RELEASE'
}
repositories {
jcenter()
maven {url 'http://developer.marklogic.com/maven2/'}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
plugins {
id 'java'
id 'com.moowork.node' version '1.1.1'
}
apply plugin: 'spring-boot'
apply plugin: 'war'
war {
baseName = 'marklogic-debugger'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
jcenter()
maven { url 'https://developer.marklogic.com/maven2/' }
}
dependencies {
// Main Boot library for running a webapp
compile("org.springframework.boot:spring-boot-starter:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-security:${springBootVersion}")
compile('com.marklogic:java-client-api:3.0.5')
compile('com.marklogic:marklogic-xcc:8.0.6')
compile('commons-io:commons-io:2.4')
// Optional Boot library - see https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html
compile("org.springframework.boot:spring-boot-devtools:${springBootVersion}")
compile("com.marklogic:marklogic-spring-web:1.0")
}
node {
// Set the work directory for unpacking node
workDir = file("${project.buildDir}/nodejs")
// Set the work directory where node_modules should be located
nodeModulesDir = file("${project.projectDir}")
}
task npmInstallUI(type: NpmTask) {
args = ['install']
}
task cleanUI(type: NpmTask) {
args = ['run', 'clean.dist']
dependsOn tasks.npmInstallUI
}
task cleanBuiltUI(type: Delete) {
delete 'src/main/resources/static'
}
task buildUI(type: NpmTask) {
args = ['run', 'build.prod']
dependsOn tasks.cleanBuiltUI
}
task copyUIAssets(type: Copy) {
from 'dist'
into 'src/main/resources/static'
dependsOn tasks.buildUI
}
clean.dependsOn cleanUI
if (!gradle.startParameter.taskNames.contains('bootrun')) {
processResources.dependsOn copyUIAssets
}
// Tell Spring Boot, when run by Gradle, to watch the resources directory
bootRun {
addResources = true
environment 'spring.profiles.active', 'dev'
}
// See http://docs.spring.io/spring-boot/docs/current/reference/html/deployment-install.html
springBoot {
executable = true
mainClass = "com.marklogic.debugger.App"
}