2
0

docs.gradle 4.3 KB

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