From 0c91c536353216777c03d0796e477c3e66e73262 Mon Sep 17 00:00:00 2001 From: Younglong Date: Fri, 22 Mar 2024 19:18:02 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20build.gradle,=20cicd-prod.yml=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - build.gradle 내 buildDir -> Deprecated 되어 다른 방식으로 변경함 - build.gradle 내 bootJar -> apiDocNeeded 설정값에 따라 다르게 동작하도록 변경 - cicd-prod.yml -> gradle bootJar 시 apiDocNeeded 설정값 추가 --- .github/workflows/cicd-prod.yml | 2 +- module-api/build.gradle | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cicd-prod.yml b/.github/workflows/cicd-prod.yml index f4972ace..5da8b233 100644 --- a/.github/workflows/cicd-prod.yml +++ b/.github/workflows/cicd-prod.yml @@ -75,7 +75,7 @@ jobs: working-directory: ./module-api run: | chmod +x ./gradlew - ./gradlew bootJar + ./gradlew bootJar -PapiDocNeeded=false - name: Grant execute permission And Build with Gradle (batch) working-directory: ./module-batch diff --git a/module-api/build.gradle b/module-api/build.gradle index febda179..04cbd94e 100644 --- a/module-api/build.gradle +++ b/module-api/build.gradle @@ -106,7 +106,7 @@ tasks.withType(GenerateSwaggerUI) { swaggerSources { sample { - setInputFile(file("${project.buildDir}/api-spec/openapi3.yaml")) + setInputFile(file("${layout.buildDirectory.get().asFile}/api-spec/openapi3.yaml")) } } @@ -122,9 +122,13 @@ openapi3 { } bootJar { - dependsOn generateSwaggerUISample - from("${generateSwaggerUISample.outputDir}") { - into 'static/docs' + def apiDocNeeded = !project.hasProperty('apiDocNeeded') ? true : apiDocNeeded.toBoolean() + + if (apiDocNeeded) { + dependsOn generateSwaggerUISample + from("${generateSwaggerUISample.outputDir}") { + into 'static/docs' + } } }