forked from jvm-bloggers/jvm-bloggers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
194 lines (166 loc) · 5.56 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
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.5.2.RELEASE'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0'
classpath 'se.transmode.gradle:gradle-docker:1.2'
classpath 'cz.alenkacz.gradle:json-validator:0.9.10'
classpath 'com.ofg:uptodate-gradle-plugin:+'
}
}
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'checkstyle'
apply plugin: 'jacoco'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'application'
apply plugin: 'docker'
apply plugin: 'cz.alenkacz.gradle.jsonvalidator'
apply plugin: 'com.ofg.uptodate'
jar {
baseName = 'jvm-bloggers'
version = '1.0.0'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
ext {
wicketVersion = '7.6.0'
akkaVersion = '2.4.12'
scalaVersion = "2.11"
jacksonVersion = '2.24'
}
dependencies {
// Spring Boot stuff
compile "org.springframework.boot:spring-boot-starter-data-jpa"
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile 'com.github.ulisesbocchio:jasypt-spring-boot:1.9'
compile 'org.springframework.boot:spring-boot-devtools'
// Logic
compile "com.typesafe.akka:akka-actor_$scalaVersion:$akkaVersion"
compile "com.typesafe.akka:akka-slf4j_$scalaVersion:$akkaVersion"
compile 'com.rometools:rome:1.7.0'
// View
compile 'com.giffing.wicket.spring.boot.starter:wicket-spring-boot-starter:1.0.5'
compile "org.apache.wicket:wicket-devutils:$wicketVersion"
compile "org.apache.wicket:wicket-auth-roles:$wicketVersion"
compile "com.googlecode.wicket-jquery-ui:wicket-jquery-ui:$wicketVersion"
compile "com.googlecode.wicket-jquery-ui:wicket-jquery-ui-plugins:$wicketVersion"
compile "org.wicketstuff:wicketstuff-annotation:$wicketVersion"
compile "org.apache.wicket:wicket-bean-validation:$wicketVersion"
// Utils and helpers
compile "org.projectlombok:lombok:1.16.10"
compile 'com.google.guava:guava:21.0'
compile 'org.apache.commons:commons-lang3:3.5'
compile 'org.antlr:ST4:4.0.8'
compile "org.glassfish.jersey.core:jersey-client:$jacksonVersion"
compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jacksonVersion"
compile 'net.jcip:jcip-annotations:1.0'
compile 'org.objenesis:objenesis:2.4'
compile 'commons-validator:commons-validator:1.5.1'
compile 'net.ftlines.wicket-source:wicket-source:7.0.0'
compile 'io.javaslang:javaslang:2.0.5'
// Database related
compile "org.postgresql:postgresql:9.4.1212.jre7"
compile 'org.liquibase:liquibase-core:3.5.3'
compile 'com.mattbertolini:liquibase-slf4j:2.0.0'
compile 'org.webjars:webjars-locator:0.32'
compile 'org.webjars:startbootstrap-sb-admin-2:3.3.7+1'
compile 'org.webjars:html5shiv:3.7.3'
compile 'org.webjars:respond:1.4.2'
// Test dependencies
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile 'org.spockframework:spock-core:1.1-groovy-2.4-rc-3'
testCompile 'org.spockframework:spock-spring:1.1-groovy-2.4-rc-3'
testCompile 'org.springframework:spring-test'
testCompile 'com.jayway.jsonpath:json-path:2.2.0'
testCompile 'cglib:cglib-nodep:3.2.4'
testCompile 'org.codehaus.groovy:groovy:2.4.7'
testCompile "com.typesafe.akka:akka-testkit_$scalaVersion:$akkaVersion"
runtime 'com.h2database:h2'
}
checkstyle {
toolVersion = "7.2"
}
jacoco {
toolVersion = "0.7.7.201606060606"
}
jacocoTestReport {
reports {
xml.enabled = true // coveralls plugin depends on xml format report
html.enabled = true
}
}
tasks.coveralls {
dependsOn 'check'
}
group = 'jvmbloggers'
task buildDocker(type: Docker, dependsOn: build) {
push = true
applicationName = jar.baseName
dockerfile = file('src/main/docker/Dockerfile')
tagVersion = jar.version + '-' + getTimestampWithGitHash()
doFirst {
copy {
from jar
into stageDir
}
}
}
bootRun {
systemProperties = System.properties
}
test {
systemProperty "file.encoding", "utf-8"
dependsOn 'validateBlogsData'
}
uptodate {
connectionTimeout 10000
}
check.dependsOn 'uptodate'
String getTimestampWithGitHash() {
String timeStamp = new Date().format('yyyyMMdd-HHmmss')
String cmd = "git log --pretty=format:%h -n 1"
def proc = cmd.execute()
proc.waitFor()
return timeStamp + '-' + proc.in.text
}
task validateBlogsData() {
def blogsDir = "src/main/resources/blogs"
def blogsData = ["bloggers", "videos", "companies"]
blogsData.each { fileName ->
def taskName = "validate" + fileName.capitalize()
tasks.create(taskName, cz.alenkacz.gradle.jsonvalidator.ValidateJsonTask) {
jsonSchema = new File(blogsDir, "schema.json")
targetJsonFile = new File(blogsDir, "${fileName}.json")
}
dependsOn taskName
}
}
task stage(dependsOn: ['build', 'clean'])
build.mustRunAfter clean
wrapper {
gradleVersion "3.1"
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
sourceSets.main.resources.srcDir 'src/main/java'