Skip to content

Commit

Permalink
[feat] restdocs 관련 설정 추가 #98
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJE20 committed Apr 11, 2023
1 parent 5f72088 commit 35a1879
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions wingle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id 'org.springframework.boot' version '2.7.7'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'org.asciidoctor.convert' version '1.5.8'
id "org.asciidoctor.jvm.convert" version "3.3.2"
id 'jacoco'
}

Expand All @@ -14,8 +14,8 @@ repositories {
mavenCentral()
}

ext {
set('snippetsDir', file("build/generated-snippets"))
configurations {
asciidoctorExt
}

dependencies {
Expand Down Expand Up @@ -49,25 +49,20 @@ dependencies {
implementation 'org.mapstruct:mapstruct:1.5.3.Final'
annotationProcessor 'org.mapstruct:mapstruct-processor:1.5.3.Final'
testAnnotationProcessor 'org.mapstruct:mapstruct-processor:1.5.3.Final'

// spring rest docs
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
}

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

tasks.named('asciidoctor') {
inputs.dir snippetsDir
dependsOn test
}

jacoco {
toolVersion = '0.8.8'
}

test {
finalizedBy 'jacocoTestReport'
}

jacocoTestReport {
dependsOn test
Expand Down Expand Up @@ -126,3 +121,27 @@ jacocoTestCoverageVerification {
jar {
enabled = false
}


ext {
snippetsDir = file('build/generated-snippets')
}

test {
finalizedBy 'jacocoTestReport'
outputs.dir snippetsDir
}

asciidoctor {
inputs.dir snippetsDir
configurations 'asciidoctorExt'
dependsOn test
}

bootJar {
// package the generated documentation
dependsOn asciidoctor
from("${asciidoctor.outputDir}/html5") {
into 'static/docs'
}
}

0 comments on commit 35a1879

Please sign in to comment.