Skip to content

Commit eef5aff

Browse files
committed
fix: Update build configuration to handle clean task properly
1 parent fbd0736 commit eef5aff

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ WORKDIR /app
44
COPY . .
55
WORKDIR /app/Location-based-target-authentication
66

7-
# Skip clean task and run assemble directly
8-
RUN chmod +x ./gradlew && \
9-
./gradlew assemble -x test -x clean --build-cache --parallel
7+
# Create a custom build script
8+
COPY <<EOF /app/build.sh
9+
#!/bin/bash
10+
cd /app/Location-based-target-authentication
11+
chmod +x ./gradlew
12+
./gradlew bootJar -x test --build-cache --parallel
13+
EOF
14+
15+
RUN chmod +x /app/build.sh && /app/build.sh
1016

1117
FROM cloudtype/jre:17
1218
WORKDIR /app

Location-based-target-authentication/build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,9 @@ tasks.withType(Jar) {
7474
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
7575
}
7676

77-
task clean {
78-
doLast {
79-
delete fileTree(dir: projectDir) {
80-
include '**/*.class'
81-
}
82-
delete 'build'
77+
clean {
78+
delete layout.buildDirectory
79+
delete fileTree(dir: projectDir) {
80+
include '**/*.class'
8381
}
8482
}

0 commit comments

Comments
 (0)