Skip to content

Commit 0695bfb

Browse files
committed
feat: Java 25
1 parent 0a957e4 commit 0695bfb

File tree

4 files changed

+88
-74
lines changed

4 files changed

+88
-74
lines changed

backend/build.gradle

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,22 @@
1313
plugins {
1414
id 'java'
1515
id 'org.springframework.boot' version '3.5.0'
16-
id 'org.graalvm.buildtools.native' version '0.10.6'
1716
id 'io.spring.dependency-management' version '1.1.7'
18-
id 'org.hibernate.orm' version '6.6.15.Final'
1917
}
2018

2119
group = 'ch.xxx'
2220
version = '0.0.1-SNAPSHOT'
2321

2422
java {
2523
toolchain {
26-
languageVersion = JavaLanguageVersion.of(24)
24+
languageVersion = JavaLanguageVersion.of(25)
2725
}
2826
}
2927

3028
repositories {
3129
mavenCentral()
3230
}
3331

34-
hibernate {
35-
enhancement {
36-
enableAssociationManagement = true
37-
//lazyInitialization = true
38-
//dirtyTracking = true
39-
}
40-
}
41-
4232
dependencies {
4333
implementation project(':frontend')
4434
implementation 'org.springframework.boot:spring-boot-starter'
@@ -55,7 +45,7 @@ dependencies {
5545
testImplementation 'org.springframework.boot:spring-boot-starter-test'
5646
testImplementation 'org.springframework.security:spring-security-test'
5747
testImplementation 'org.springframework.graphql:spring-graphql-test'
58-
testImplementation 'com.tngtech.archunit:archunit-junit5:1.4.0'
48+
testImplementation 'com.tngtech.archunit:archunit-junit5:1.4.1'
5949

6050
if(project.hasProperty('withAngular')) {
6151
implementation 'org.postgresql:postgresql'
@@ -73,23 +63,18 @@ test {
7363
useJUnitPlatform()
7464
}
7565

76-
graalvmNative {
77-
binaries {
78-
main {
79-
buildArgs.add("--gc=G1")
80-
}
81-
}
66+
// Ensure backend tasks wait for frontend
67+
68+
tasks.named('processResources') {
69+
dependsOn(':frontend:buildAngular')
70+
}
71+
72+
tasks.named('classes') {
73+
dependsOn(':frontend:buildAngular')
8274
}
8375

84-
//eclpise fix
85-
tasks.register('copyClasses') {
86-
doLast{
87-
copy {
88-
from layout.buildDirectory.dir("classes/java")
89-
include "**/*.class"
90-
into layout.projectDirectory.dir("bin")
91-
}
92-
}
76+
tasks.named('bootJar') {
77+
dependsOn(':frontend:buildAngular')
9378
}
9479

9580
task buildDockerImage {
@@ -102,5 +87,3 @@ task buildDockerImage {
10287
}
10388
}
10489
}
105-
106-
build.dependsOn copyClasses

frontend/build.gradle

Lines changed: 74 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,51 +18,82 @@ group = 'ch.xxx'
1818
version = '0.0.1-SNAPSHOT'
1919

2020
task cleanAngular {
21-
if(project.hasProperty('withAngular')) {
22-
println('Task cleanAngular')
23-
delete('src/angular/node_modules')
24-
}
21+
onlyIf {
22+
project.hasProperty('withAngular')
23+
}
24+
doLast {
25+
println('Task cleanAngular')
26+
delete('src/angular/node_modules')
27+
}
2528
}
2629

27-
task buildAngular(type:Exec) {
28-
if(project.hasProperty('withAngular')) {
29-
exec{
30-
println('Task buildAngular - npm install')
31-
workingDir 'src/angular'
32-
if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")){
33-
commandLine 'npm.cmd', 'install'
34-
} else {
35-
commandLine 'npm', 'install'
36-
}
37-
}
38-
exec {
39-
println('Task buildAngular - npm run build')
40-
workingDir 'src/angular'
41-
if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")){
42-
commandLine 'npm.cmd', 'run', 'build'
43-
} else {
44-
commandLine 'npm', 'run', 'build'
45-
}
46-
}
47-
}
30+
task cleanDist {
31+
onlyIf {
32+
project.hasProperty('withAngular')
33+
}
34+
doLast {
35+
delete('src/angular/dist')
36+
}
4837
}
4938

50-
task testAngular(type:Exec) {
51-
if(project.hasProperty('withAngular')) {
52-
exec {
53-
workingDir 'src/angular'
54-
if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")){
55-
println('Task buildAngular - npm run test')
56-
commandLine 'npm.cmd', 'run', 'test'
57-
} else {
58-
if(project.hasProperty("useChromium")) {
59-
println('Task buildAngular - npm run test-chromium')
60-
commandLine 'npm', 'run', 'test-chromium'
61-
} else {
62-
println('Task buildAngular - npm run test')
63-
commandLine 'npm', 'run', 'test'
64-
}
65-
}
66-
}
67-
}
39+
task createDist {
40+
onlyIf {
41+
project.hasProperty('withAngular')
42+
}
43+
doLast {
44+
mkdir('src/angular/dist')
45+
}
6846
}
47+
48+
task npmInstall(type: Exec) {
49+
onlyIf {
50+
project.hasProperty('withAngular')
51+
}
52+
workingDir = file('src/angular')
53+
if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")){
54+
commandLine 'npm.cmd', 'install'
55+
} else {
56+
commandLine 'npm', 'install'
57+
}
58+
dependsOn cleanAngular
59+
}
60+
61+
task npmBuild(type: Exec) {
62+
onlyIf {
63+
project.hasProperty('withAngular')
64+
}
65+
workingDir = file('src/angular')
66+
if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")){
67+
commandLine 'npm.cmd', 'run', 'build'
68+
} else {
69+
commandLine 'npm', 'run', 'build'
70+
}
71+
dependsOn npmInstall, cleanDist, createDist
72+
}
73+
74+
task testAngular(type: Exec) {
75+
onlyIf {
76+
project.hasProperty('withAngular')
77+
}
78+
workingDir = file('src/angular')
79+
if (System.getProperty("os.name").toUpperCase().contains("WINDOWS")){
80+
commandLine 'npm.cmd', 'run', 'test'
81+
} else {
82+
if(project.hasProperty("useChromium")) {
83+
commandLine 'npm', 'run', 'test-chromium'
84+
} else {
85+
commandLine 'npm', 'run', 'test'
86+
}
87+
}
88+
dependsOn npmInstall
89+
doFirst {
90+
println("Running ${commandLine.join(' ')}")
91+
}
92+
}
93+
94+
task buildAngular {
95+
dependsOn npmBuild, testAngular
96+
}
97+
98+
// Make sure the main build task depends on buildAngular
99+
build.dependsOn buildAngular
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
rootProject.name = 'maps'
2-
include 'frontend' , 'backend'
2+
include ('frontend' , 'backend')

0 commit comments

Comments
 (0)