2
0

docs.gradle 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // Docbook and Javadoc building and uploading tasks
  2. apply plugin: 'base'
  3. task docs {
  4. dependsOn 'manual:reference', 'faq:referenceHtmlSingle', 'apidocs'
  5. }
  6. subprojects {
  7. apply plugin: 'base'
  8. apply plugin: 'docbook-reference'
  9. [referenceHtmlMulti, referencePdf, referenceHtmlSingle]*.sourceDir = file('src/docbook')
  10. }
  11. project('faq') {
  12. defaultTasks 'referenceHtmlSingle'
  13. referenceHtmlSingle.stylesheet = 'html-single-custom.xsl'
  14. [referenceHtmlMulti, referencePdf, referenceHtmlSingle]*.sourceFileName = 'faq.xml'
  15. ext.spec = copySpec {
  16. into ('faq') {
  17. from("$buildDir/reference/htmlsingle")
  18. from("$projectDir/src/resources")
  19. }
  20. }
  21. }
  22. project('manual') {
  23. defaultTasks 'referenceHtmlMulti', 'referenceHtmlSingle', 'referencePdf'
  24. def imagesDir = new File(projectDir, 'src/docbook/images');
  25. ext.spec = copySpec {
  26. into ('reference') {
  27. from("$buildDir/reference")
  28. }
  29. }
  30. }
  31. task reference (type: Copy) {
  32. dependsOn 'manual:reference'
  33. destinationDir = buildDir
  34. with(project('manual').spec)
  35. }
  36. task apidocs(type: Javadoc) {
  37. destinationDir = new File(buildDir, 'apidocs')
  38. title = "Spring Security $version API"
  39. source coreModuleProjects.collect { project ->
  40. project.sourceSets.main.allJava
  41. }
  42. classpath = files(coreModuleProjects.collect { project ->
  43. project.sourceSets.main.compileClasspath
  44. })
  45. }
  46. apidocs.options.outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
  47. apidocs.options.links = [
  48. "http://static.springframework.org/spring/docs/3.0.x/javadoc-api",
  49. "http://static.springsource.org/spring-ldap/docs/1.3.x/apidocs/",
  50. "http://download.oracle.com/javase/6/docs/api/"
  51. ]
  52. apidocs.options.groups = [
  53. 'Spring Security Core':[
  54. 'org.springframework.security.core*',
  55. 'org.springframework.security.authentication*',
  56. 'org.springframework.security.access*',
  57. 'org.springframework.security.remoting*',
  58. 'org.springframework.security.provisioning*',
  59. 'org.springframework.security.util*'],
  60. 'Spring Security Web':['org.springframework.security.web*'],
  61. 'Spring Security LDAP':['org.springframework.security.ldap*'],
  62. 'Spring Security Crypto':['org.springframework.security.crypto*'],
  63. 'Spring Security OpenID':['org.springframework.security.openid*'],
  64. 'Spring Security CAS':['org.springframework.security.cas*'],
  65. 'Spring Security ACL':['org.springframework.security.acls*'],
  66. 'Spring Security Config':['org.springframework.security.config*'],
  67. 'Spring Security Taglibs':['org.springframework.security.taglibs*'],
  68. ]
  69. ext.apiSpec = copySpec {
  70. into('apidocs') {
  71. from(apidocs.destinationDir)
  72. }
  73. }
  74. assemble.dependsOn = [apidocs, 'manual:reference']
  75. task docsZip(type: Zip) {
  76. dependsOn docs
  77. group = 'Distribution'
  78. baseName = rootProject.name
  79. classifier = 'docs'
  80. description = "Builds -${classifier} archive containing api and reference " +
  81. "for deployment at static.springframework.org/spring-security/site/docs."
  82. with(project(':docs').apiSpec)
  83. with(project(':docs:manual').spec)
  84. with(project(':docs:faq').spec)
  85. }
  86. task schemaZip(type: Zip) {
  87. group = 'Distribution'
  88. baseName = rootProject.name
  89. classifier = 'schema'
  90. description = "Builds -${classifier} archive containing all " +
  91. "XSDs for deployment at static.springframework.org/schema."
  92. coreModuleProjects.each { module ->
  93. def Properties schemas = new Properties();
  94. module.sourceSets.main.resources.find {
  95. it.path.endsWith('META-INF/spring.schemas')
  96. }?.withInputStream { schemas.load(it) }
  97. for (def key : schemas.keySet()) {
  98. def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
  99. assert shortName != key
  100. File xsdFile = module.sourceSets.main.resources.find {
  101. it.path.endsWith(schemas.get(key))
  102. }
  103. assert xsdFile != null
  104. into (shortName) {
  105. from xsdFile.path
  106. }
  107. }
  108. }
  109. }