-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
120 lines (103 loc) · 3.01 KB
/
Copy pathbuild.gradle
File metadata and controls
120 lines (103 loc) · 3.01 KB
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
import org.flywaydb.gradle.FlywayExtension
import org.flywaydb.gradle.task.FlywayMigrateTask
buildscript {
ext {
springBootVersion = '1.5.3.RELEASE'
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath 'org.flywaydb:flyway-gradle-plugin:4.2.0'
}
}
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'org.flywaydb.flyway'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
mavenLocal()
}
ext {
springCloudVersion = 'Dalston.SR1'
}
configurations {
deployment
}
dependencies {
compile 'org.springframework:spring-jdbc:3.1.0.RELEASE'
compile 'postgresql:postgresql:9.1-901-1.jdbc4'
deployment 'postgresql:postgresql:9.1-901-1.jdbc4'
compile 'net.sourceforge.collections:collections-generic:4.01'
compile 'org.json:json:20090211'
compile 'commons-lang:commons-lang:2.6'
compile 'org.springframework.cloud:spring-cloud-starter-config'
compile 'org.springframework.boot:spring-boot-starter-web'
compile('org.springframework.cloud:spring-cloud-starter-eureka')
compile 'com.monederobingo:libs:0.0.8'
compile 'xyz.greatapp:libs-database:0.0.11'
compile 'xyz.greatapp:libs:0.0.23'
compile 'org.flywaydb:flyway-core:3.0'
deployment 'org.flywaydb:flyway-core:3.0'
testCompile 'org.mockito:mockito-core:2.8.9'
testCompile 'org.springframework.boot:spring-boot-starter-test'
testCompile group: 'com.h2database', name: 'h2', version: '1.3.148'
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
test {
exclude '**/*IntegrationTest*'
}
task migrateMonedero(type: FlywayMigrateTask) {
extension = new FlywayExtension()
extension.schemas = ["monedero"]
extension.url = 'jdbc:postgresql://localhost:5432'
extension.user = 'postgres'
extension.password = 'root'
extension.locations = ["filesystem:${projectDir}/migrations/common",
"filesystem:${projectDir}/migrations/postgresql"]
extension.sqlMigrationPrefix = ""
extension.baselineOnMigrate = true
extension.outOfOrder = true
}
task migrateMonederoTest(type: FlywayMigrateTask) {
extension = new FlywayExtension()
extension.schemas = ["monedero_test"]
extension.url = 'jdbc:postgresql://localhost:5432'
extension.user = 'postgres'
extension.password = 'root'
extension.locations = ["filesystem:${projectDir}/migrations/common",
"filesystem:${projectDir}/migrations/postgresql"]
extension.sqlMigrationPrefix = ""
extension.baselineOnMigrate = true
extension.outOfOrder = true
}
task migrate
migrate.dependsOn migrateMonedero
migrate.dependsOn migrateMonederoTest
task copyDeploymentJars(type: Copy) {
from configurations.deployment
into "$buildDir/dependencies"
}
build.dependsOn copyDeploymentJars
task stage(type: Copy, dependsOn: [clean, build]) {
from jar.archivePath
into project.rootDir
rename {
'app.jar'
}
}
stage.mustRunAfter(clean)
clean {
doLast {
project.file('app.jar').delete()
}
}