[BUILD] Move all doc tasks to spring-pulsar-docs (#47)
This commit is contained in:
248
build.gradle
248
build.gradle
@@ -15,9 +15,6 @@ plugins {
|
||||
id 'io.spring.nohttp' version '0.0.5.RELEASE'
|
||||
id 'io.spring.dependency-management' version '1.0.10.RELEASE' apply false
|
||||
id 'com.jfrog.artifactory' version '4.18.2' apply false
|
||||
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
|
||||
id 'org.asciidoctor.jvm.gems' version '3.3.2'
|
||||
id 'org.asciidoctor.jvm.convert' version '3.3.2'
|
||||
}
|
||||
|
||||
apply plugin: 'io.spring.nohttp'
|
||||
@@ -36,12 +33,6 @@ ext {
|
||||
linkScmUrl = 'https://github.com/spring-projects-experimental/spring-pulsar'
|
||||
linkScmConnection = 'https://github.com/spring-projects-experimental/spring-pulsar.git'
|
||||
linkScmDevConnection = 'git@github.com:spring-projects-experimental/spring-pulsar.git'
|
||||
docResourcesVersion = '0.2.5'
|
||||
|
||||
javadocLinks = [
|
||||
'https://docs.oracle.com/en/java/javase/17/docs/api/',
|
||||
'https://docs.spring.io/spring-framework/docs/current/javadoc-api/'
|
||||
] as String[]
|
||||
|
||||
if (gitPresent) {
|
||||
modifiedFiles =
|
||||
@@ -259,7 +250,6 @@ subprojects { subproject ->
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes(
|
||||
@@ -344,38 +334,6 @@ project ('spring-pulsar-boot-autoconfigure') {
|
||||
}
|
||||
}
|
||||
|
||||
project ('spring-pulsar-docs') {
|
||||
description = 'Spring Pulsar Code Snippets For Docs'
|
||||
|
||||
dependencies {
|
||||
api "org.springframework.boot:spring-boot-starter:$springBootVersion"
|
||||
api project (':spring-pulsar')
|
||||
optionalApi 'com.fasterxml.jackson.core:jackson-core'
|
||||
optionalApi 'com.fasterxml.jackson.core:jackson-databind'
|
||||
}
|
||||
|
||||
jar {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
javadocJar {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
publishMavenJavaPublicationToMavenLocal {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
project.afterEvaluate {
|
||||
project.tasks.artifactoryPublish.enabled(false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
project ('spring-pulsar-sample-apps') {
|
||||
description = 'Spring Pulsar Sample Applications'
|
||||
|
||||
@@ -416,209 +374,3 @@ if (project.hasProperty('artifactoryUsername')) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task dist(dependsOn: assemble) {
|
||||
group = 'Distribution'
|
||||
description = 'Builds -dist, -docs distribution archives.'
|
||||
}
|
||||
|
||||
configurations {
|
||||
docs
|
||||
}
|
||||
|
||||
dependencies {
|
||||
docs "io.spring.docresources:spring-doc-resources:${docResourcesVersion}@zip"
|
||||
}
|
||||
|
||||
task prepareAsciidocBuild(type: Sync) {
|
||||
dependsOn configurations.docs
|
||||
from {
|
||||
configurations.docs.collect { zipTree(it) }
|
||||
}
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
from 'spring-pulsar-docs/src/main/asciidoc/'
|
||||
into "$buildDir/asciidoc"
|
||||
}
|
||||
|
||||
asciidoctorPdf {
|
||||
dependsOn prepareAsciidocBuild
|
||||
baseDirFollowsSourceFile()
|
||||
configurations 'asciidoctorExt'
|
||||
|
||||
asciidoctorj {
|
||||
sourceDir "$buildDir/asciidoc"
|
||||
inputs.dir(sourceDir)
|
||||
sources {
|
||||
include 'index.adoc'
|
||||
}
|
||||
options doctype: 'book'
|
||||
attributes 'icons': 'font',
|
||||
'sectanchors': '',
|
||||
'sectnums': '',
|
||||
'toc': '',
|
||||
'source-highlighter' : 'coderay',
|
||||
revnumber: project.version,
|
||||
'project-version': project.version
|
||||
}
|
||||
}
|
||||
|
||||
asciidoctorj {
|
||||
version = '2.4.1'
|
||||
// fatalWarnings ".*"
|
||||
options doctype: 'book', eruby: 'erubis'
|
||||
attributes([
|
||||
icons: 'font',
|
||||
idprefix: '',
|
||||
idseparator: '-',
|
||||
docinfo: 'shared',
|
||||
revnumber: project.version,
|
||||
sectanchors: '',
|
||||
sectnums: '',
|
||||
'source-highlighter': 'highlight.js',
|
||||
highlightjsdir: 'js/highlight',
|
||||
'highlightjs-theme': 'googlecode',
|
||||
stylesdir: 'css/',
|
||||
stylesheet: 'stylesheet.css',
|
||||
'spring-version': project.version,
|
||||
'project-version': project.version
|
||||
])
|
||||
}
|
||||
|
||||
asciidoctor {
|
||||
dependsOn asciidoctorPdf
|
||||
baseDirFollowsSourceFile()
|
||||
configurations 'asciidoctorExt'
|
||||
sourceDir = file("$buildDir/asciidoc")
|
||||
sources {
|
||||
include '*.adoc'
|
||||
}
|
||||
resources {
|
||||
from(sourceDir) {
|
||||
include 'images/*', 'css/**', 'js/**'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task api(type: Javadoc) {
|
||||
group = 'Documentation'
|
||||
description = 'Generates aggregated Javadoc API documentation.'
|
||||
title = "${rootProject.description} ${version} API"
|
||||
options {
|
||||
encoding = 'UTF-8'
|
||||
memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
|
||||
author = true
|
||||
header = rootProject.description
|
||||
use = true
|
||||
overview = 'src/api/overview.html'
|
||||
splitIndex = true
|
||||
links(project.ext.javadocLinks)
|
||||
addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
|
||||
}
|
||||
|
||||
source subprojects.collect { project ->
|
||||
if (project.name != 'spring-pulsar-sample-apps') {
|
||||
project.sourceSets.main.allJava
|
||||
}
|
||||
}
|
||||
|
||||
classpath = files(subprojects.collect { project ->
|
||||
if (project.name != 'spring-pulsar-sample-apps') {
|
||||
project.sourceSets.main.compileClasspath
|
||||
}
|
||||
})
|
||||
destinationDir = new File(buildDir, 'api')
|
||||
}
|
||||
|
||||
|
||||
task reference(dependsOn: asciidoctor) {
|
||||
group = 'Documentation'
|
||||
description = 'Generate the reference documentation'
|
||||
}
|
||||
|
||||
reference.onlyIf {
|
||||
"$System.env.NO_REFERENCE_TASK" != 'true' || project.hasProperty('ignoreEnvToStopReference')
|
||||
}
|
||||
|
||||
task docsZip(type: Zip, dependsOn: [reference]) {
|
||||
group = 'Distribution'
|
||||
archiveClassifier = 'docs'
|
||||
description = "Builds -${archiveClassifier} archive containing api and reference " +
|
||||
"for deployment at static.spring.io/spring-pulsar/docs."
|
||||
|
||||
from('src/dist') {
|
||||
include 'changelog.txt'
|
||||
}
|
||||
|
||||
from(api) {
|
||||
into 'api'
|
||||
}
|
||||
|
||||
from ('build/docs/asciidoc') {
|
||||
into 'reference/html'
|
||||
}
|
||||
|
||||
from ('build/docs/asciidocPdf') {
|
||||
include 'index.pdf'
|
||||
rename 'index.pdf', 'spring-pulsar-reference.pdf'
|
||||
into 'reference/pdf'
|
||||
}
|
||||
}
|
||||
|
||||
task distZip(type: Zip, dependsOn: [docsZip]) { //, schemaZip]) {
|
||||
group = 'Distribution'
|
||||
archiveClassifier = 'dist'
|
||||
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
|
||||
"suitable for community download page."
|
||||
|
||||
ext.baseDir = "${project.name}-${project.version}"
|
||||
|
||||
from('src/dist') {
|
||||
include 'readme.txt'
|
||||
include 'notice.txt'
|
||||
into "${baseDir}"
|
||||
}
|
||||
|
||||
from("$project.rootDir") {
|
||||
include 'LICENSE.txt'
|
||||
into "${baseDir}"
|
||||
}
|
||||
|
||||
from(zipTree(docsZip.archivePath)) {
|
||||
into "${baseDir}/docs"
|
||||
}
|
||||
|
||||
subprojects.each { subproject ->
|
||||
into ("${baseDir}/libs") {
|
||||
from subproject.jar
|
||||
from subproject.sourcesJar
|
||||
from subproject.javadocJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives distZip
|
||||
archives docsZip
|
||||
}
|
||||
|
||||
apply from: "${rootProject.projectDir}/gradle/publish-artifactory.gradle"
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact docsZip
|
||||
artifact distZip
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
artifactoryPublish {
|
||||
publications(publishing.publications.mavenJava)
|
||||
properties {
|
||||
mavenJava '*:*:*:*@zip', 'zip.name': 'spring-pulsar', 'zip.displayname': 'Spring Pulsar', 'zip.deployed': false
|
||||
mavenJava '*:*:*:docs@zip', 'zip.type': 'docs'
|
||||
mavenJava '*:*:*:dist@zip', 'zip.type': 'dist'
|
||||
}
|
||||
}
|
||||
|
||||
apply from: "${rootDir}/gradle/docs.gradle"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
version=0.1.0-SNAPSHOT
|
||||
|
||||
org.gradle.caching=true
|
||||
org.gradle.parallel=true
|
||||
org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
configurations {
|
||||
asciidoctorExt
|
||||
}
|
||||
|
||||
dependencies {
|
||||
asciidoctorExt("io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:0.5.0")
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url "https://repo.spring.io/release"
|
||||
mavenContent {
|
||||
includeGroup "io.spring.asciidoctor"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,21 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
maven { url 'https://repo.spring.io/plugins-release' }
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "com.gradle.enterprise" version "3.5"
|
||||
id "io.spring.ge.conventions" version "0.0.7"
|
||||
id 'com.gradle.enterprise' version '3.10.2'
|
||||
id 'io.spring.ge.conventions' version '0.0.7'
|
||||
}
|
||||
|
||||
gradleEnterprise {
|
||||
buildScan {
|
||||
publishOnFailure()
|
||||
settings.gradle.projectsLoaded {
|
||||
gradleEnterprise {
|
||||
buildScan {
|
||||
publishOnFailure()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
239
spring-pulsar-docs/build.gradle
Normal file
239
spring-pulsar-docs/build.gradle
Normal file
@@ -0,0 +1,239 @@
|
||||
plugins {
|
||||
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
|
||||
id 'org.asciidoctor.jvm.gems' version '3.3.2'
|
||||
id 'org.asciidoctor.jvm.convert' version '3.3.2'
|
||||
}
|
||||
|
||||
apply from: "${rootProject.projectDir}/gradle/publish-artifactory.gradle"
|
||||
|
||||
description = 'Spring Pulsar Docs'
|
||||
|
||||
ext {
|
||||
blockSwitchVersion = '0.5.0'
|
||||
docResourcesVersion = '0.2.5'
|
||||
}
|
||||
|
||||
configurations {
|
||||
asciidoctorExt
|
||||
docs
|
||||
}
|
||||
|
||||
dependencies {
|
||||
api "org.springframework.boot:spring-boot-starter:$springBootVersion"
|
||||
api project (':spring-pulsar')
|
||||
asciidoctorExt "io.spring.asciidoctor:spring-asciidoctor-extensions-block-switch:$blockSwitchVersion"
|
||||
docs "io.spring.docresources:spring-doc-resources:${docResourcesVersion}@zip"
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url "https://repo.spring.io/release"
|
||||
mavenContent {
|
||||
includeGroup "io.spring.asciidoctor"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
javadocJar {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
publishMavenJavaPublicationToMavenLocal {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
project.afterEvaluate {
|
||||
project.tasks.artifactoryPublish.enabled(false)
|
||||
}
|
||||
|
||||
task aggregatedJavadoc(type: Javadoc) {
|
||||
group = 'Documentation'
|
||||
description = 'Generates aggregated Javadoc API documentation.'
|
||||
title = "${rootProject.description} ${version} API"
|
||||
|
||||
project.rootProject.gradle.projectsEvaluated {
|
||||
Set<String> excludedProjects = ['spring-pulsar-sample-apps']
|
||||
Set<Project> publishedProjects = rootProject.subprojects.findAll { it != project}
|
||||
.findAll { it.plugins.hasPlugin(JavaPlugin) && it.plugins.hasPlugin(MavenPublishPlugin) }
|
||||
.findAll { !excludedProjects.contains(it.name) }
|
||||
dependsOn publishedProjects.javadoc
|
||||
source publishedProjects.javadoc.source
|
||||
classpath = project.files(publishedProjects.javadoc.classpath)
|
||||
destinationDir = project.file "${buildDir}/api"
|
||||
options {
|
||||
encoding = "UTF-8"
|
||||
author = true
|
||||
docTitle = "Spring Pulsar ${project.version} API"
|
||||
windowTitle = "Spring Pulsar ${project.version} API"
|
||||
overview = 'src/api/overview.html'
|
||||
memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
|
||||
outputLevel = org.gradle.external.javadoc.JavadocOutputLevel.QUIET
|
||||
splitIndex = true
|
||||
use = true
|
||||
addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
|
||||
links = [
|
||||
"https://docs.oracle.com/en/java/javase/17/docs/api/",
|
||||
"https://docs.spring.io/spring-framework/docs/current/javadoc-api/"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task prepareAsciidocBuild(type: Sync, dependsOn: configurations.docs) {
|
||||
from {
|
||||
configurations.docs.collect { zipTree(it) }
|
||||
}
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
from 'src/main/asciidoc/'
|
||||
into "$buildDir/asciidoc"
|
||||
}
|
||||
|
||||
asciidoctorPdf {
|
||||
dependsOn prepareAsciidocBuild
|
||||
|
||||
baseDirFollowsSourceFile()
|
||||
configurations 'asciidoctorExt'
|
||||
|
||||
asciidoctorj {
|
||||
sourceDir "$buildDir/asciidoc"
|
||||
inputs.dir(sourceDir)
|
||||
sources {
|
||||
include 'index.adoc'
|
||||
}
|
||||
options doctype: 'book'
|
||||
attributes 'icons': 'font',
|
||||
'sectanchors': '',
|
||||
'sectnums': '',
|
||||
'toc': '',
|
||||
'source-highlighter' : 'coderay',
|
||||
revnumber: project.version,
|
||||
'project-version': project.version
|
||||
}
|
||||
}
|
||||
|
||||
asciidoctorj {
|
||||
version = '2.4.1'
|
||||
// fatalWarnings ".*"
|
||||
options doctype: 'book', eruby: 'erubis'
|
||||
attributes([
|
||||
icons: 'font',
|
||||
idprefix: '',
|
||||
idseparator: '-',
|
||||
docinfo: 'shared',
|
||||
revnumber: project.version,
|
||||
sectanchors: '',
|
||||
sectnums: '',
|
||||
'source-highlighter': 'highlight.js',
|
||||
highlightjsdir: 'js/highlight',
|
||||
'highlightjs-theme': 'googlecode',
|
||||
stylesdir: 'css/',
|
||||
stylesheet: 'stylesheet.css',
|
||||
'spring-version': project.version,
|
||||
'project-version': project.version
|
||||
])
|
||||
}
|
||||
|
||||
asciidoctor {
|
||||
dependsOn asciidoctorPdf
|
||||
baseDirFollowsSourceFile()
|
||||
configurations 'asciidoctorExt'
|
||||
sourceDir = file("$buildDir/asciidoc")
|
||||
sources {
|
||||
include '*.adoc'
|
||||
}
|
||||
resources {
|
||||
from(sourceDir) {
|
||||
include 'images/*', 'css/**', 'js/**'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task reference(dependsOn: asciidoctor) {
|
||||
group = 'Documentation'
|
||||
description = 'Generate the reference documentation'
|
||||
}
|
||||
|
||||
task docsZip(type: Zip, dependsOn: reference) {
|
||||
group = 'Distribution'
|
||||
archiveClassifier = 'docs'
|
||||
description = "Builds -${archiveClassifier} archive containing api and reference " +
|
||||
"for deployment at static.spring.io/spring-pulsar/docs."
|
||||
from("$project.rootDir/src/dist") {
|
||||
include 'changelog.txt'
|
||||
}
|
||||
from(asciidoctor.outputDir) {
|
||||
into "reference/html"
|
||||
}
|
||||
from(asciidoctorPdf.outputDir) {
|
||||
into "reference/pdf"
|
||||
include "index.pdf"
|
||||
rename { "spring-pulsar-reference.pdf" }
|
||||
}
|
||||
from(aggregatedJavadoc) {
|
||||
into "api"
|
||||
}
|
||||
}
|
||||
|
||||
task distZip(type: Zip, dependsOn: docsZip) {
|
||||
group = 'Distribution'
|
||||
archiveClassifier = 'dist'
|
||||
description = "Builds -${archiveClassifier} archive, containing all jars and docs, " +
|
||||
"suitable for community download page."
|
||||
|
||||
ext.baseDir = "${project.name}-${project.version}"
|
||||
from("$project.rootDir/src/dist") {
|
||||
include 'readme.txt'
|
||||
include 'notice.txt'
|
||||
into "${baseDir}"
|
||||
}
|
||||
from("$project.rootDir") {
|
||||
include 'LICENSE.txt'
|
||||
into "${baseDir}"
|
||||
}
|
||||
from(zipTree(docsZip.archiveFile)) {
|
||||
into "${baseDir}/docs"
|
||||
}
|
||||
subprojects.each { subproject ->
|
||||
into ("${baseDir}/libs") {
|
||||
from subproject.jar
|
||||
from subproject.sourcesJar
|
||||
from subproject.javadocJar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives distZip
|
||||
archives docsZip
|
||||
}
|
||||
|
||||
task dist(dependsOn: assemble) {
|
||||
group = 'Distribution'
|
||||
description = 'Builds -dist, -docs distribution archives.'
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
artifact docsZip
|
||||
artifact distZip
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
artifactoryPublish {
|
||||
publications(publishing.publications.mavenJava)
|
||||
properties {
|
||||
mavenJava '*:*:*:*@zip', 'zip.name': 'spring-pulsar', 'zip.displayname': 'Spring Pulsar', 'zip.deployed': false
|
||||
mavenJava '*:*:*:docs@zip', 'zip.type': 'docs'
|
||||
mavenJava '*:*:*:dist@zip', 'zip.type': 'dist'
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user