forked from jvm-bloggers/jvm-bloggers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
212 lines (175 loc) · 6.81 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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
}
ext {
}
dependencies {
classpath "org.springframework.boot:spring-boot-gradle-plugin:2.7.6"
classpath "com.bmuschko:gradle-docker-plugin:7.4.0"
classpath 'com.ofg:uptodate-gradle-plugin:1.6.3'
}
}
plugins {
id 'org.springframework.boot' version '2.7.6'
id 'io.spring.dependency-management' version '1.1.0'
id 'java'
id 'groovy'
id 'idea'
id 'eclipse'
id 'io.freefair.lombok' version '6.5.1'
id 'com.bmuschko.docker-spring-boot-application' version '7.4.0'
id 'jacoco'
id "com.ofg.uptodate" version "1.6.3"
}
group = 'com.jvm-bloggers'
version = '3.0.0'
sourceCompatibility = '17'
repositories {
mavenLocal()
mavenCentral()
}
ext {
wicketVersion = '9.12.0'
jerseyVersion = '2.37'
}
dependencies {
// Spring Boot stuff
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'com.github.ulisesbocchio:jasypt-spring-boot:3.0.4'
implementation 'org.springframework.boot:spring-boot-devtools'
// Logic
implementation 'com.rometools:rome:1.18.0'
// Facebook
implementation 'com.restfb:restfb:3.24.0'
// Twitter
implementation 'org.twitter4j:twitter4j-core:4.0.7'
// View
implementation 'com.giffing.wicket.spring.boot.starter:wicket-spring-boot-starter:3.1.6'
implementation "org.apache.wicket:wicket-core:$wicketVersion"
implementation "org.apache.wicket:wicket-spring:$wicketVersion"
implementation "org.apache.wicket:wicket-ioc:$wicketVersion"
implementation "org.apache.wicket:wicket-devutils:$wicketVersion"
implementation "org.apache.wicket:wicket-auth-roles:$wicketVersion"
implementation "org.apache.wicket:wicket-bean-validation:$wicketVersion"
implementation "org.wicketstuff:wicketstuff-annotation:$wicketVersion"
implementation "com.googlecode.wicket-jquery-ui:wicket-jquery-ui:9.11.0"
implementation "com.googlecode.wicket-jquery-ui:wicket-jquery-ui-plugins:9.11.0"
implementation 'de.agilecoders.wicket.webjars:wicket-webjars:3.0.6'
implementation 'org.webjars:jquery:3.6.1'
implementation 'org.webjars:webjars-locator:0.45'
implementation 'org.webjars:startbootstrap-sb-admin-2:3.3.7+1'
implementation 'org.webjars:html5shiv:3.7.3-1'
implementation 'org.webjars:respond:1.4.2-1'
implementation 'org.webjars.npm:ev-emitter:1.1.1'
implementation 'org.webjars.npm:fizzy-ui-utils:2.0.7'
implementation 'org.webjars.npm:infinite-scroll:3.0.6'
implementation 'org.webjars:toastr:2.1.2'
// Utils and helpers
implementation 'org.projectlombok:lombok'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'org.antlr:ST4:4.3.4'
implementation "org.glassfish.jersey.core:jersey-client:$jerseyVersion"
implementation "org.glassfish.jersey.media:jersey-media-json-jackson:$jerseyVersion"
implementation "org.glassfish.jersey.inject:jersey-hk2:$jerseyVersion"
implementation 'net.jcip:jcip-annotations:1.0'
implementation 'org.objenesis:objenesis:3.3'
implementation 'commons-validator:commons-validator:1.7'
implementation 'io.vavr:vavr:0.10.4'
implementation 'org.jsoup:jsoup:1.15.3'
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.2'
implementation 'org.json:json:20220924'
implementation('com.vdurmont:emoji-java:5.1.1') {
exclude group: 'org.json', module: 'json'
}
// Database related
implementation 'org.postgresql:postgresql'
implementation 'org.liquibase:liquibase-core'
implementation 'com.mattbertolini:liquibase-slf4j:4.1.0'
implementation 'org.hibernate:hibernate-search-orm:5.11.11.Final'
implementation 'org.hibernate:hibernate-search-engine:5.11.11.Final'
// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
testImplementation 'org.spockframework:spock-spring:2.3-groovy-3.0'
testImplementation 'org.springframework:spring-test'
testImplementation 'com.jayway.jsonpath:json-path:2.7.0'
testImplementation 'org.codehaus.groovy:groovy:3.0.13'
testImplementation 'org.codehaus.groovy:groovy-json:3.0.13'
testRuntimeOnly 'com.h2database:h2'
}
docker {
dockerCreateDockerfile {
instruction 'RUN apk update && apk add ca-certificates && update-ca-certificates && apk add openssl'
}
dockerBuildImage {
images = [
'jvmbloggers/jvm-bloggers:' + project.version + "-" + getTimestampWithGitHash(),
'jvmbloggers/jvm-bloggers:latest'
]
}
registryCredentials {
username = getConfigurationProperty('DOCKER_USERNAME', 'docker.username')
password = getConfigurationProperty('DOCKER_PASSWORD', 'docker.password')
email = getConfigurationProperty('DOCKER_EMAIL', 'docker.email')
}
springBootApplication {
baseImage = 'eclipse-temurin:17.0.5_8-jre-alpine'
maintainer = 'Tomasz Dziurko "tdziurko at gmail dottt com"'
ports = [8080, 8080]
jvmArgs = ['-Dwicket.ioc.useByteBuddy=true']
}
}
String getConfigurationProperty(String envVar, String sysProp) {
System.getenv(envVar) ?: project.findProperty(sysProp)
}
bootRun {
systemProperties = System.properties
}
test {
systemProperty 'file.encoding', 'utf-8'
dependsOn 'validateBlogsData'
useJUnitPlatform()
}
uptodate {
connectionTimeout 10000
}
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
}
jacocoTestReport {
reports {
xml.required.set(true)
csv.required.set(false)
}
}
task stage(dependsOn: ['build', 'clean'])
build.mustRunAfter clean
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
task validateBlogsData() {
def blogsDir = java.nio.file.Paths.get("${projectDir}", "src", "main", "resources", "blogs")
def schema = blogsDir.resolve("schema.json")
def blogsData = ['bloggers', 'presentations', 'companies', 'podcasts']
blogsData.each { fileName ->
def taskName = 'validate' + fileName.capitalize()
def json = blogsDir.resolve("${fileName}.json")
tasks.create(taskName, com.jvm_bloggers.validation.JsonValidationTask, schema, json)
dependsOn taskName
}
}
sourceSets.main.resources.srcDir 'src/main/java'
apply plugin: 'application'