docs.gradle 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. // Docbook and Javadoc building and uploading tasks
  2. apply plugin: 'base'
  3. task docs {
  4. dependsOn 'manual:docbook', 'faq:docbookHtmlSingle', 'apidocs'
  5. }
  6. subprojects {
  7. apply plugin: 'base'
  8. apply plugin: 'docbook'
  9. docbookHtmlSingle.stylesheet = new File(projectDir, 'src/xsl/html-single-custom.xsl')
  10. }
  11. project('faq') {
  12. defaultTasks 'docbookHtmlSingle'
  13. [docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceFileName = 'faq.xml'
  14. docbookHtmlSingle.suffix = ''
  15. ext.spec = copySpec {
  16. into ('faq') {
  17. from("$buildDir/docs")
  18. from("$projectDir/src/resources")
  19. }
  20. }
  21. }
  22. project('manual') {
  23. defaultTasks 'docbookHtml', 'docbookHtmlSingle', 'docbookFoPdf'
  24. [docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceFileName = 'springsecurity.xml'
  25. docbookHtml.stylesheet = new File(projectDir, 'src/xsl/html-custom.xsl')
  26. docbookHtmlSingle.stylesheet = new File(projectDir, 'src/xsl/html-single-custom.xsl')
  27. docbookFoPdf.stylesheet = new File(projectDir, 'src/xsl/pdf-custom.xsl')
  28. def imagesDir = new File(projectDir, 'src/docbook/images');
  29. // docbookFoPdf.admonGraphicsPath = "${imagesDir}/"
  30. docbookFoPdf.imgSrcPath = "${projectDir}/src/docbook/"
  31. ext.spec = copySpec {
  32. into ('reference') {
  33. from("$buildDir/docs")
  34. from("$projectDir/src/resources")
  35. }
  36. into ('reference/images') {
  37. from (imagesDir)
  38. }
  39. }
  40. }
  41. task reference (type: Copy) {
  42. dependsOn 'manual:docbook'
  43. destinationDir = buildDir
  44. with(project('manual').spec)
  45. }
  46. task apidocs(type: Javadoc) {
  47. destinationDir = new File(buildDir, 'apidocs')
  48. title = "Spring Security $version API"
  49. source coreModuleProjects.collect { project ->
  50. project.sourceSets.main.allJava
  51. }
  52. classpath = files(coreModuleProjects.collect { project ->
  53. project.sourceSets.main.compileClasspath
  54. })
  55. }
  56. apidocs.options.outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
  57. apidocs.options.links = [
  58. "http://static.springframework.org/spring/docs/3.0.x/javadoc-api",
  59. "http://static.springsource.org/spring-ldap/docs/1.3.x/apidocs/",
  60. "http://download.oracle.com/javase/6/docs/api/"
  61. ]
  62. apidocs.options.groups = [
  63. 'Spring Security Core':[
  64. 'org.springframework.security.core*',
  65. 'org.springframework.security.authentication*',
  66. 'org.springframework.security.access*',
  67. 'org.springframework.security.remoting*',
  68. 'org.springframework.security.provisioning*',
  69. 'org.springframework.security.util*'],
  70. 'Spring Security Web':['org.springframework.security.web*'],
  71. 'Spring Security LDAP':['org.springframework.security.ldap*'],
  72. 'Spring Security Crypto':['org.springframework.security.crypto*'],
  73. 'Spring Security OpenID':['org.springframework.security.openid*'],
  74. 'Spring Security CAS':['org.springframework.security.cas*'],
  75. 'Spring Security ACL':['org.springframework.security.acls*'],
  76. 'Spring Security Config':['org.springframework.security.config*'],
  77. 'Spring Security Taglibs':['org.springframework.security.taglibs*'],
  78. ]
  79. ext.apiSpec = copySpec {
  80. into('apidocs') {
  81. from(apidocs.destinationDir)
  82. }
  83. }
  84. task docSiteLogin(type: Login) {
  85. if (project.hasProperty('sshHost')) {
  86. host = project.property('sshHost')
  87. }
  88. }
  89. // Define remoteSiteDir and sshHost in gradle.properties
  90. def remoteDocsDir = null
  91. if (hasProperty('remoteSiteDir')) {
  92. remoteDocsDir="$remoteSiteDir/docs/3.1.x"
  93. }
  94. task uploadApidocs(type: TarUpload) {
  95. dependsOn apidocs
  96. baseName = "${rootProject.name}"
  97. appendix = 'apidocs'
  98. remoteDir = remoteDocsDir
  99. login = docSiteLogin
  100. with(apiSpec)
  101. }
  102. task uploadManual(type: TarUpload) {
  103. dependsOn 'manual:docbook'
  104. baseName = "${rootProject.name}"
  105. appendix = 'doc'
  106. remoteDir = remoteDocsDir
  107. login = docSiteLogin
  108. with(project('manual').spec)
  109. }
  110. task uploadFaq(type: TarUpload) {
  111. dependsOn 'faq:docbookHtmlSingle'
  112. baseName = "${rootProject.name}"
  113. appendix = 'faq'
  114. if (project.hasProperty('remoteSiteDir')) {
  115. remoteDir = project.property('remoteSiteDir')
  116. }
  117. login = docSiteLogin
  118. with(project('faq').spec)
  119. }
  120. assemble.dependsOn = [apidocs, 'manual:docbook']