Skip to content

Commit

Permalink
refactor: build.gradle.kts 설정 리팩터링
Browse files Browse the repository at this point in the history
  • Loading branch information
seokjin8678 committed Dec 11, 2023
1 parent 1e1af72 commit 391ecdb
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ repositories {
mavenCentral()
}

val asciidoctorExt: Configuration by configurations.creating
val snippetsDir by extra { file("build/generated-snippets") }
val asciidoctorExt = "asciidoctorExt"
configurations.create(asciidoctorExt) {
extendsFrom(configurations["testImplementation"])
}

val snippetsDir = file("build/generated-snippets")

dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
Expand Down Expand Up @@ -64,22 +68,19 @@ tasks.withType<KotlinCompile> {
}
}

tasks.withType<Test> {
useJUnitPlatform()
}

tasks.test {
outputs.dir(snippetsDir)
useJUnitPlatform()
}

tasks.asciidoctor {
inputs.dir(snippetsDir)
dependsOn(tasks.test)
configurations("asciidoctorExt")
configurations(asciidoctorExt)
baseDirFollowsSourceFile()
}

tasks.register("copyDocument", Copy::class) {
val copyDocument = tasks.register<Copy>("copyDocument") {
dependsOn(tasks.asciidoctor)
doFirst {
delete(file("src/main/resources/static/docs"))
Expand All @@ -89,15 +90,15 @@ tasks.register("copyDocument", Copy::class) {
}

tasks.build {
dependsOn(tasks.getByName("copyDocument"))
dependsOn(copyDocument)
}

tasks.bootJar {
dependsOn(tasks.getByName("copyDocument"))
dependsOn(copyDocument)
}

allOpen {
annotation("jakarta.persistence.Entity")
annotation ("jakarta.persistence.Embeddable")
annotation ("jakarta.persistence.MappedSuperclass")
annotation("jakarta.persistence.Embeddable")
annotation("jakarta.persistence.MappedSuperclass")
}

0 comments on commit 391ecdb

Please sign in to comment.