Rather than introducing a custom macro, this commit opts to implicitly configure the snippets attribute instead. The attribute is configured will the path into which snippets are generated, relative to the directory that contains the Asciidoctor document that is being rendered. The samples and documentation have been updated to use the new spring-restdocs-asciidoctor module and the implicitly configured snippets attribute. Closes gh-297
104 lines
2.7 KiB
Groovy
104 lines
2.7 KiB
Groovy
buildscript {
|
|
ext {
|
|
grailsVersion = project.grailsVersion
|
|
}
|
|
repositories {
|
|
mavenLocal()
|
|
maven { url "https://repo.grails.org/grails/core" }
|
|
maven { url 'https://repo.spring.io/libs-snapshot' }
|
|
}
|
|
dependencies {
|
|
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
|
|
classpath "org.grails.plugins:hibernate:4.3.10.5"
|
|
classpath 'org.ajoberstar:gradle-git:1.1.0'
|
|
}
|
|
}
|
|
|
|
plugins {
|
|
id "io.spring.dependency-management" version "0.5.4.RELEASE"
|
|
id 'org.asciidoctor.convert' version '1.5.3'
|
|
}
|
|
|
|
version "0.1"
|
|
group "com.example"
|
|
|
|
apply plugin: "spring-boot"
|
|
apply plugin: "war"
|
|
apply plugin: 'eclipse'
|
|
apply plugin: 'idea'
|
|
apply plugin: "org.grails.grails-web"
|
|
|
|
ext {
|
|
grailsVersion = project.grailsVersion
|
|
gradleWrapperVersion = project.gradleWrapperVersion
|
|
restDocsVersion = "1.2.0.BUILD-SNAPSHOT"
|
|
snippetsDir = file('src/docs/generated-snippets')
|
|
}
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
maven { url 'https://repo.spring.io/libs-snapshot' }
|
|
maven { url "https://repo.grails.org/grails/core" }
|
|
}
|
|
|
|
dependencyManagement {
|
|
dependencies {
|
|
dependency "org.springframework.restdocs:spring-restdocs-restassured:$restDocsVersion"
|
|
dependency "org.springframework.restdocs:spring-restdocs-asciidoctor:$restDocsVersion"
|
|
}
|
|
imports {
|
|
mavenBom "org.grails:grails-bom:$grailsVersion"
|
|
mavenBom "org.springframework:spring-framework-bom:4.3.1.RELEASE"
|
|
}
|
|
applyMavenExclusions false
|
|
}
|
|
|
|
dependencies {
|
|
asciidoctor "org.springframework.restdocs:spring-restdocs-asciidoctor"
|
|
|
|
compile "org.springframework.boot:spring-boot-starter-logging"
|
|
compile "org.springframework.boot:spring-boot-starter-actuator"
|
|
compile "org.springframework.boot:spring-boot-autoconfigure"
|
|
compile "org.springframework.boot:spring-boot-starter-tomcat"
|
|
compile "org.grails:grails-plugin-url-mappings"
|
|
compile "org.grails:grails-plugin-rest"
|
|
compile "org.grails:grails-plugin-interceptors"
|
|
compile "org.grails:grails-plugin-services"
|
|
compile "org.grails:grails-plugin-datasource"
|
|
compile "org.grails:grails-plugin-databinding"
|
|
compile "org.grails:grails-plugin-async"
|
|
compile "org.grails:grails-web-boot"
|
|
compile "org.grails:grails-logging"
|
|
|
|
compile "org.grails.plugins:hibernate"
|
|
compile "org.grails.plugins:cache"
|
|
compile "org.hibernate:hibernate-ehcache"
|
|
|
|
runtime "com.h2database:h2"
|
|
|
|
testCompile "org.grails:grails-plugin-testing"
|
|
testCompile "org.grails.plugins:geb"
|
|
testCompile 'org.springframework.restdocs:spring-restdocs-restassured'
|
|
|
|
console "org.grails:grails-console"
|
|
}
|
|
|
|
task wrapper(type: Wrapper) {
|
|
gradleVersion = gradleWrapperVersion
|
|
}
|
|
|
|
ext {
|
|
snippetsDir = file('build/generated-snippets')
|
|
}
|
|
|
|
test {
|
|
outputs.dir snippetsDir
|
|
}
|
|
|
|
asciidoctor {
|
|
dependsOn integrationTest
|
|
inputs.dir snippetsDir
|
|
}
|
|
|
|
build.dependsOn asciidoctor
|