2
0

spring-security-docs-guides.gradle 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. apply plugin: 'org.asciidoctor.gradle.asciidoctor'
  2. asciidoctor {
  3. baseDir = file('src/docs/asciidoc')
  4. options eruby: 'erubis'
  5. attributes copycss : '',
  6. icons : 'font',
  7. 'source-highlighter': 'prettify',
  8. sectanchors : '',
  9. toc: '',
  10. 'toc-placement' : 'preamble',
  11. idprefix: '',
  12. idseparator: '-',
  13. doctype: 'book',
  14. 'spring-security-version' : project.version,
  15. 'download-url' : getDownloadUrl(),
  16. 'include-maven-repository' : getMavenRepositoryInclude(),
  17. revnumber : project.version
  18. }
  19. ext.spec = copySpec {
  20. into ('guides') {
  21. from(asciidoctor.outputDir)
  22. exclude 'build', 'Guardfile'
  23. }
  24. }
  25. def getDownloadUrl() {
  26. snapshotBuild ? "https://github.com/spring-projects/spring-security/archive/master.zip" : "https://github.com/spring-projects/spring-security/archive/${project.version}.zip"
  27. }
  28. def getMavenRepositoryInclude() {
  29. if(snapshotBuild) {
  30. return "_includes/maven-repository-snapshot.asc"
  31. } else if(releaseBuild) {
  32. return "_includes/maven-repository-release.asc"
  33. } else {
  34. return "_includes/maven-repository-milestone.asc"
  35. }
  36. }