docs.gradle 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. // Docbook and Javadoc building and uploading tasks
  2. apply plugin: 'base'
  3. task docs {
  4. dependsOn 'manual:asciidoctor', 'apidocs', 'guides:asciidoctor'
  5. }
  6. project('manual') {
  7. apply plugin: 'base'
  8. apply plugin: 'asciidoctor'
  9. ext.expandPlaceholders = ""
  10. asciidoctor {
  11. options = [
  12. eruby: 'erubis',
  13. attributes: [
  14. copycss : '',
  15. icons : 'font',
  16. 'source-highlighter': 'prettify',
  17. sectanchors : '',
  18. toc2: '',
  19. idprefix: '',
  20. idseparator: '-',
  21. doctype: 'book',
  22. numbered: '',
  23. 'spring-security-version' : project.version,
  24. 'spring-version' : springVersion,
  25. revnumber : project.version
  26. ]
  27. ]
  28. }
  29. ext.spec = copySpec {
  30. into ('reference/htmlsingle') {
  31. from(asciidoctor.outputDir)
  32. exclude 'build', 'Guardfile'
  33. }
  34. }
  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.2.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:asciidoctor']
  75. task docsZip(type: Zip) {
  76. dependsOn docs
  77. evaluationDependsOn('guides')
  78. group = 'Distribution'
  79. baseName = rootProject.name
  80. classifier = 'docs'
  81. description = "Builds -${classifier} archive containing api and reference " +
  82. "for deployment at static.springframework.org/spring-security/site/docs."
  83. with(project(':docs').apiSpec)
  84. with(project(':docs:manual').spec)
  85. with(project(':docs:guides').spec)
  86. }
  87. task schemaZip(type: Zip) {
  88. group = 'Distribution'
  89. baseName = rootProject.name
  90. classifier = 'schema'
  91. description = "Builds -${classifier} archive containing all " +
  92. "XSDs for deployment at static.springframework.org/schema."
  93. coreModuleProjects.each { module ->
  94. def Properties schemas = new Properties();
  95. module.sourceSets.main.resources.find {
  96. it.path.endsWith('META-INF/spring.schemas')
  97. }?.withInputStream { schemas.load(it) }
  98. for (def key : schemas.keySet()) {
  99. def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
  100. assert shortName != key
  101. File xsdFile = module.sourceSets.main.resources.find {
  102. it.path.endsWith(schemas.get(key))
  103. }
  104. assert xsdFile != null
  105. into (shortName) {
  106. from xsdFile.path
  107. }
  108. }
  109. }
  110. }