-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
83 lines (71 loc) · 2.72 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
plugins {
id 'org.springframework.boot' version '2.5.7' apply false
id 'io.spring.dependency-management' version '1.0.11.RELEASE' apply false
id "com.diffplug.spotless" version "6.0.2" apply false
}
subprojects {
apply plugin: 'java'
apply plugin: "com.diffplug.spotless"
group 'de.uniba.dsg'
version '2.1.1'
repositories {
mavenCentral()
}
// Configure common Java stuff
if (plugins.hasPlugin('java')) {
sourceCompatibility = 11
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
}
test {
useJUnitPlatform()
}
}
// Plugins for WSS server core and implementations
if (name != 'wss-data-gen' || name != 'wss-commons') {
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
// Plugins for implementations only
if (name != 'wss-server-core') {
apply plugin: 'application'
// Set main class; may be overridden in build of actual implementation
application {
mainClass = 'de.uniba.dsg.wss.Application'
}
}
}
// Add all core Spring Boot dependencies to all modules using Spring Boot
if (plugins.hasPlugin('org.springframework.boot') && plugins.hasPlugin('io.spring.dependency-management')) {
configurations {
all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-log4j2'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-security'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.security:spring-security-test'
}
}
// Spotless plugin for formatting of files (general and code style)
spotless {
format 'misc', {
// Define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore', '.gitattributes'
// Define the steps to apply to those files
trimTrailingWhitespace()
indentWithSpaces()
endWithNewline()
}
java {
googleJavaFormat()
}
}
// Check formatting everytime code is being compiled
compileJava.dependsOn 'spotlessJavaCheck'
compileJava.dependsOn 'spotlessMiscCheck'
}