-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.gradle
More file actions
187 lines (154 loc) · 6.82 KB
/
Copy pathbuild.gradle
File metadata and controls
187 lines (154 loc) · 6.82 KB
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
plugins {
id 'checkstyle'
id 'java'
id 'com.diffplug.spotless' version '8.3.0'
id 'com.github.ben-manes.versions' version '0.53.0'
id 'org.springframework.boot' version '4.0.3'
id 'io.spring.dependency-management' version '1.1.7'
id "org.springdoc.openapi-gradle-plugin" version "1.9.0"
id "org.openapi.generator" version "7.17.0"
id "com.github.node-gradle.node" version "7.1.0"
}
group = 'de.tum.cit.aet'
version = '0.0.1'
description = 'Harmonia'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
wrapper {
gradleVersion = "9.4.0"
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
}
spotless {
java {
target "src/*/java/**/*.java"
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
}
checkstyle {
// Exclude everything under the build directory
toolVersion = "${checkstyleVersion}"
configFile = file("checkstyle.xml")
checkstyleTest.enabled = false
maxErrors = 0
}
apply from: "gradle/openapi.gradle"
node {
download = true
version = "22.13.1"
npmVersion = "10.9.2"
workDir = file("${project.projectDir}/.gradle/nodejs")
nodeProjectDir = file("${project.projectDir}/src/main/webapp")
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-liquibase'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
// JGit
implementation 'org.eclipse.jgit:org.eclipse.jgit:7.5.0.202512021534-r'
// Excel parsing
implementation 'org.apache.poi:poi-ooxml:5.5.1'
// Spring AI for LLM interaction
implementation platform('org.springframework.ai:spring-ai-bom:2.0.0-M2')
implementation 'org.springframework.ai:spring-ai-starter-model-openai'
implementation 'org.springframework.ai:spring-ai-starter-model-azure-openai'
// use newest version of nimbus-jose-jwt to avoid security issues through outdated dependencies
implementation "com.nimbusds:nimbus-jose-jwt:10.8"
// Main database to persist entities
implementation 'org.postgresql:postgresql:42.7.10'
// Apache POI for Excel export
implementation 'org.apache.poi:poi-ooxml:5.5.1'
// Lombok for boilerplate code reduction
compileOnly 'org.projectlombok:lombok'
//Openapi dependencies
implementation "org.openapitools:jackson-databind-nullable:${jacksonDatabindNullableVersion}"
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.1"
implementation("org.yaml:snakeyaml") {
version {
strictly "${snakeyaml_version}"
// needed to reduce the number of vulnerabilities, also see https://mvnrepository.com/artifact/org.yaml/snakeyaml
}
}
// H2 in-memory database for OpenAPI generation and testing
runtimeOnly 'com.h2database:h2'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
testImplementation 'org.springframework.boot:spring-boot-starter-actuator-test'
testImplementation 'org.springframework.boot:spring-boot-starter-batch-test'
testImplementation 'org.springframework.boot:spring-boot-starter-data-jpa-test'
testImplementation 'org.springframework.boot:spring-boot-starter-liquibase-test'
testImplementation 'org.springframework.boot:spring-boot-starter-validation-test'
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.named('test') {
useJUnitPlatform {
// Exclude integration and e2e tests from regular test runs
// These require external services (LM Studio, Artemis, etc.)
excludeTags 'integration', 'e2e'
}
}
// Integration test task - requires external services
// Run with: ./gradlew integrationTest
// Automatically loads credentials from src/test/resources/test-credentials.properties
tasks.register('integrationTest', Test) {
description = 'Runs integration tests that require external services (LM Studio, Artemis, DB)'
group = 'verification'
useJUnitPlatform {
includeTags 'integration', 'e2e'
}
// Explicitly set the test classes and classpath
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
// Show standard output logs in the console
testLogging {
showStandardStreams = true
events "passed", "skipped", "failed"
}
shouldRunAfter tasks.named('test')
// Load credentials from properties file if it exists
def credentialsFile = file('src/test/resources/test-credentials.properties')
if (credentialsFile.exists()) {
def props = new Properties()
credentialsFile.withInputStream { stream ->
props.load(stream)
}
// Set all properties as environment variables
props.forEach { key, value ->
environment key.toString(), value.toString()
}
}
// Pass through system environment variables (override file if set)
if (System.getenv('ARTEMIS_TEST_URL')) environment 'ARTEMIS_TEST_URL', System.getenv('ARTEMIS_TEST_URL')
if (System.getenv('ARTEMIS_TEST_USERNAME')) environment 'ARTEMIS_TEST_USERNAME', System.getenv('ARTEMIS_TEST_USERNAME')
if (System.getenv('ARTEMIS_TEST_PASSWORD')) environment 'ARTEMIS_TEST_PASSWORD', System.getenv('ARTEMIS_TEST_PASSWORD')
if (System.getenv('ARTEMIS_TEST_COURSE')) environment 'ARTEMIS_TEST_COURSE', System.getenv('ARTEMIS_TEST_COURSE')
if (System.getenv('ARTEMIS_TEST_EXERCISE_ID')) environment 'ARTEMIS_TEST_EXERCISE_ID', System.getenv('ARTEMIS_TEST_EXERCISE_ID')
if (System.getenv('ARTEMIS_TEST_MAX_TEAMS')) environment 'ARTEMIS_TEST_MAX_TEAMS', System.getenv('ARTEMIS_TEST_MAX_TEAMS')
// Always enable LLM tests for this task
environment 'LLM_INTEGRATION_TESTS', 'true'
}
// Available commands:
// -------------------
// 1) Build production: ./gradlew clean bootJar
// 2) Execute tests: ./gradlew test
// 3) Check Java code format: ./gradlew spotlessCheck
// 4) Apply Java code formatter: ./gradlew spotlessApply
// 5) Check JavaDoc: ./gradlew checkstyleMain
// 6) Find dependency updates: ./gradlew dependencyUpdates -Drevision=release