2
0

docs.gradle 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. // Docbook and Javadoc building and uploading tasks
  2. subprojects {
  3. apply plugin: 'base'
  4. apply plugin: 'docbook'
  5. docbookHtmlSingle.stylesheet = new File(projectDir, 'src/xsl/html-single-custom.xsl')
  6. }
  7. project('faq') {
  8. defaultTasks 'docbookHtmlSingle'
  9. [docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceFileName = 'faq.xml'
  10. docbookHtmlSingle.suffix = ''
  11. spec = copySpec {
  12. into ('faq') {
  13. from("$buildDir/docs")
  14. from("$projectDir/src/resources")
  15. }
  16. }
  17. }
  18. project('manual') {
  19. defaultTasks 'docbookHtml', 'docbookHtmlSingle', 'docbookFoPdf'
  20. [docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceFileName = 'springsecurity.xml'
  21. docbookHtml.stylesheet = new File(projectDir, 'src/xsl/html-custom.xsl')
  22. docbookHtmlSingle.stylesheet = new File(projectDir, 'src/xsl/html-single-custom.xsl')
  23. docbookFoPdf.stylesheet = new File(projectDir, 'src/xsl/pdf-custom.xsl')
  24. def imagesDir = new File(projectDir, 'src/docbook/images');
  25. docbookFoPdf.admonGraphicsPath = "${imagesDir}/"
  26. spec = copySpec {
  27. into ('reference') {
  28. from("$buildDir/docs")
  29. from("$projectDir/src/resources")
  30. }
  31. into ('reference/images') {
  32. from (imagesDir)
  33. }
  34. }
  35. }
  36. task apidocs(type: Javadoc) {
  37. destinationDir = new File(buildDir, 'apidocs')
  38. title = "Spring Security $version API"
  39. optionsFile = file("$buildDir/tmp/javadoc.options")
  40. source coreModuleProjects.collect { project ->
  41. project.sourceSets.main.allJava
  42. }
  43. classpath = files(coreModuleProjects.collect { project ->
  44. project.sourceSets.main.compileClasspath
  45. })
  46. }
  47. apiSpec = copySpec {
  48. into('apidocs') {
  49. from(apidocs.destinationDir)
  50. }
  51. }
  52. task docSiteLogin(type: Login) {
  53. if (project.hasProperty('sshHost')) {
  54. host = project.property('sshHost')
  55. }
  56. }
  57. // Define remoteSiteDir and sshHost in gradle.properties
  58. def remoteDocsDir = null
  59. if (hasProperty('remoteSiteDir')) {
  60. remoteDocsDir="$remoteSiteDir/docs/3.1.x"
  61. }
  62. task uploadApidocs(type: TarUpload) {
  63. dependsOn apidocs
  64. baseName = "${rootProject.name}"
  65. appendix = 'apidocs'
  66. remoteDir = remoteDocsDir
  67. login = docSiteLogin
  68. with(apiSpec)
  69. }
  70. task uploadManual(type: TarUpload) {
  71. dependsOn 'manual:docbook'
  72. baseName = "${rootProject.name}"
  73. appendix = 'doc'
  74. remoteDir = remoteDocsDir
  75. login = docSiteLogin
  76. with(project('manual').spec)
  77. }
  78. task uploadFaq(type: TarUpload) {
  79. dependsOn 'faq:docbookHtmlSingle'
  80. baseName = "${rootProject.name}"
  81. appendix = 'faq'
  82. if (project.hasProperty('remoteSiteDir')) {
  83. remoteDir = project.property('remoteSiteDir')
  84. }
  85. login = docSiteLogin
  86. with(project('faq').spec)
  87. }