forked from Parrit/Parrit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
100 lines (78 loc) · 2.43 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
import java.time.LocalDateTime
import java.time.ZoneId
import java.time.ZoneOffset
group 'com.example'
version '0.0.1-SNAPSHOT'
description 'parrit'
buildscript {
ext {
springBootVersion = '1.3.7.RELEASE'
gruntPluginVersion = '0.13'
nodePluginVersion = '0.13'
}
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
mavenCentral()
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion"
classpath "com.moowork.gradle:gradle-grunt-plugin:${gruntPluginVersion}"
classpath "com.moowork.gradle:gradle-node-plugin:${nodePluginVersion}"
}
}
apply plugin: 'java'
apply plugin: 'spring-boot'
apply plugin: 'com.moowork.node'
apply plugin: 'com.moowork.grunt'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-security'
compile 'org.springframework.boot:spring-boot-starter-thymeleaf'
compile 'org.springframework.boot:spring-boot-starter-data-jpa'
compile 'org.postgresql:postgresql'
compile('org.springframework.boot:spring-boot-starter-test') {
exclude(module: "commons-logging")
}
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.flywaydb:flyway-core'
}
grunt {
colors = true
bufferOutput = true
}
test {
filter {
includeTestsMatching '*Test'
}
}
task jsTest(type: NodeTask) {
workingDir project.projectDir
script = file('node_modules/karma/bin/karma')
args = ['start', 'karma.conf.js']
}
test.dependsOn(jsTest)
task jsBuild(type: Copy, dependsOn: grunt_build) {
from "$project.projectDir/src/main/resources/static/built"
into "$project.projectDir/build/classes/main/static/built"
}
task jsClean(type: Delete) {
delete 'src/main/resources/static/built/bundle.js'
delete 'src/main/resources/static/built/bundle.css'
}
jar.dependsOn(jsBuild)
task createMigration << {
def utc = ZoneId.of("UTC")
def timestamp = LocalDateTime.now(utc).toEpochSecond(ZoneOffset.UTC)
def path = "src/main/resources/db/migration/V${timestamp}__CHANGEME.sql"
"touch $project.projectDir/$path".execute()
}
task deploy(type: Exec, dependsOn: build) {
workingDir project.projectDir
commandLine 'cf', 'push'
}
defaultTasks 'clean', 'jsClean', 'build', 'jsBuild'