2
0

spring-security-docs-guides.gradle 1.1 KB

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