build.gradle 969 B

1234567891011121314151617181920212223242526272829303132333435
  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. revnumber : project.version
  19. ]
  20. ]
  21. }
  22. }
  23. task asciidoctor {
  24. group = 'Documentation'
  25. description = "Generates the asciidoc for $project.name"
  26. dependsOn tasks.matching { t -> t.name.startsWith('asciidoctor-') }
  27. }
  28. ext.spec = copySpec {
  29. into ('guides') {
  30. from("$buildDir/docs/")
  31. }
  32. }