diff --git a/wingle/build.gradle b/wingle/build.gradle index 0587cd31..1ce5782c 100644 --- a/wingle/build.gradle +++ b/wingle/build.gradle @@ -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' } @@ -14,8 +14,8 @@ repositories { mavenCentral() } -ext { - set('snippetsDir', file("build/generated-snippets")) +configurations { + asciidoctorExt } dependencies { @@ -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 @@ -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' + } +} \ No newline at end of file