-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
141 lines (123 loc) · 4.89 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
buildscript {
ext {
springBootVersion = '3.4.1'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'war'
apply plugin: 'maven-publish'
group = 'conorheffron'
version = '5.4.3'
description = "Sample Data Manager"
sourceCompatibility = 23
targetCompatibility = 23
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
repositories {
mavenCentral()
}
sourceSets {
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration-test/java')
}
resources.srcDir file('src/integration-test/resources')
}
}
configurations {
integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
integrationTestImplementation.extendsFrom testImplementation
}
dependencies {
// Lombok
compileOnly 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.projectlombok:lombok:1.18.36'
// Spring
implementation 'org.springframework.boot:spring-boot-maven-plugin:' + springBootVersion
implementation 'org.springframework.boot:spring-boot-starter-web:' + springBootVersion
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:' + springBootVersion
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf:' + springBootVersion
implementation 'org.springframework.boot:spring-boot-starter-tomcat:' + springBootVersion
implementation 'org.springframework.boot:spring-boot-starter-validation:' + springBootVersion
// GC Secret Manager
implementation 'com.google.cloud:google-cloud-secretmanager:2.55.0'
// SQL
implementation group: 'mysql', name: 'mysql-connector-java', version:'8.0.33'
implementation group: 'com.h2database', name: 'h2', version:'2.3.232'
implementation group: 'org.apache.maven.reporting', name: 'maven-reporting-api', version:'4.0.0'
implementation group: 'org.jacoco', name: 'jacoco-maven-plugin', version:'0.8.12'
implementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version:'11.0.2'
implementation group: 'org.glassfish.web', name: 'jakarta.servlet.jsp.jstl', version: '3.0.1'
testImplementation group: 'junit', name: 'junit', version: '4.13.2'
testImplementation(group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: springBootVersion) {
exclude(module: 'commons-logging')
}
}
test {
// show standard out and standard error of the test JVM(s) on the console, without this
// the text output printed by the tests won't show.
// ref: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html
testLogging.showStandardStreams = true
def testCount = 0
afterTest { descriptor, result ->
// descriptor is of type TestDescriptor, result is of type TestResult
// ref: https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/TestDescriptor.html
// ref: https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/TestResult.html
logger.lifecycle("Test {count: ${++testCount} name: $descriptor.name result: $result.resultType}")
}
}
task integrationTest(type: Test) {
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}
check.dependsOn integrationTest
integrationTest.mustRunAfter test
integrationTest {
// show standard out and standard error of the test JVM(s) on the console, without this
// the text output printed by the tests won't show.
// ref: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html
testLogging.showStandardStreams = true
def testCount = 0
afterTest { descriptor, result ->
// descriptor is of type TestDescriptor, result is of type TestResult
// ref: https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/TestDescriptor.html
// ref: https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/TestResult.html
logger.lifecycle("Test {count: ${++testCount} name: $descriptor.name result: $result.resultType}")
}
}
// Build executable war file
tasks.war {
enabled = true
// Remove `plain` postfix from war file name
archiveClassifier.set("")
}
publishing {
repositories {
maven {
name = "Github"
url = uri("https://maven.pkg.github.com/conorheffron/ironoc-db")
credentials {
username = System.getenv("USERNAME")
password = System.getenv("TOKEN")
}
}
}
publications {
mavenWeb(MavenPublication) {
from components.web
}
}
}