2
0

build.gradle 926 B

12345678910111213141516171819202122232425262728293031323334
  1. import org.asciidoctor.gradle.*
  2. file("src/asciidoc").eachFileMatch(~/.*\.asc/) { file->
  3. task "asciidoctor-${file.name}"(type: AsciidoctorTask) {
  4. outputDir = project.file("$buildDir/docs")
  5. sourceDocumentName = file
  6. options = [
  7. eruby: 'erubis',
  8. attributes: [
  9. copycss : '',
  10. icons : 'font',
  11. 'source-highlighter': 'prettify',
  12. sectanchors : '',
  13. 'toc-placement' : 'preamble',
  14. toc: '',
  15. idprefix: '',
  16. idseparator: '-',
  17. 'spring-security-version' : project.version
  18. ]
  19. ]
  20. }
  21. }
  22. task asciidoctor {
  23. group = 'Documentation'
  24. description = "Generates the asciidoc for $project.name"
  25. dependsOn tasks.matching { t -> t.name.startsWith('asciidoctor-') }
  26. }
  27. ext.spec = copySpec {
  28. into ('guides') {
  29. from("$buildDir/docs/")
  30. }
  31. }