-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
122 lines (102 loc) · 3.42 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
buildscript {
ext {
def release = project.properties['releaseVersion'] ?: 'SNAPSHOT'
applicationVersion = '0.0.1-' + release
}
}
plugins {
id 'java'
id "io.spring.dependency-management" version "1.0.11.RELEASE" apply false
id "org.sonarqube" version "3.1.1" apply false
id "jacoco"
id "org.owasp.dependencycheck" version "6.1.1" apply false
id 'org.springframework.boot' version '2.4.3' apply false
}
apply from: rootProject.file('gradle/install-git-hooks.gradle')
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
allprojects {
group = 'br.com.mballoni'
sourceCompatibility = '11'
version = "${applicationVersion}"
}
subprojects {
apply plugin: "java"
apply plugin: "org.springframework.boot"
apply plugin: "io.spring.dependency-management"
apply plugin: "org.sonarqube"
apply plugin: "jacoco"
apply plugin: "org.owasp.dependencycheck"
apply plugin: 'maven-publish'
apply plugin: 'checkstyle'
repositories {
maven { url "https://repo.spring.io/libs-release" }
mavenCentral()
mavenLocal()
}
dependencies {
compileOnly 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
testImplementation('org.springframework.boot:spring-boot-starter-test')
}
sonarqube {
properties {
property "sonar.sourceEncoding", "UTF-8"
property "sonar.projectName", "Boot Validator"
property "sonar.organization", "$System.env.SONAR_ORG"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.login", "$System.env.SONAR_TOKEN"
property "sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/main.xml,build/reports/checkstyle/test.xml"
}
}
jacocoTestReport {
reports {
xml.enabled true
}
}
test {
testLogging {
events "passed", "skipped", "failed"
}
useJUnitPlatform()
}
checkstyle {
showViolations false
toolVersion '8.34'
}
tasks.withType(Checkstyle) {
reports {
xml.enabled true
html.enabled true
}
}
}
jar.enabled = false
tasks.register("configureIdea")
{
println "Configuring Idea"
outputs.upToDateWhen { false }
def home = System.properties['user.home']
[file("${home}/.config/JetBrains/"), file("${home}/Library/Application Support/JetBrains")]
.findAll { it.exists() }
.collect { it.listFiles() }
.flatten()
.findAll { it.toString().toLowerCase().contains("intellij") }
.each { intelliJHome -> copyJavaStyle intelliJHome }
copy {
from '.intellij/checkstyle'
into ".idea/codeStyles"
}
}
private void copyJavaStyle(intelliJHome) {
if (new File(intelliJHome, "codestyles").exists()) {
def target = new File(intelliJHome, "codestyles/intellij-java-google-style.xml")
new URL('https://raw.githubusercontent.com/google/styleguide/gh-pages/intellij-java-google-style.xml')
.withInputStream { input -> target.withOutputStream { output -> output << input } }
}
}