1
0
mirror of synced 2026-08-04 01:07:02 +00:00

eliminate the dependency on the generated-docs repository

- add and register Antora Collector
- configure Antora Collection at runtime using another extension
This commit is contained in:
Dan Allen
2022-09-07 18:34:22 -06:00
committed by Steve Riesenberg
parent 6bd10b4056
commit f2f7eb7482
4 changed files with 36 additions and 7 deletions
@@ -0,0 +1,28 @@
'use strict'
const BASE_COMMAND = 'gradlew -PbuildSrc.skipTests=true'
const JVM_ARGS='-Xmx3g -XX:+HeapDumpOnOutOfMemoryError'
const REPO_URL = 'https://github.com/spring-projects/spring-security'
const TASK_NAME=':spring-security-docs:generateAntora'
module.exports.register = function () {
this.once('contentAggregated', ({ contentAggregate }) => {
for (const { origins } of contentAggregate) {
for (const origin of origins) {
if (origin.url === REPO_URL && origin.descriptor.ext?.collector === undefined) {
origin.descriptor.ext = {
collector: {
run: {
command: `${BASE_COMMAND} "-Dorg.gradle.jvmargs=${JVM_ARGS}" ${TASK_NAME}`,
local: true,
},
scan: {
dir: './build/generateAntora',
},
}
}
}
}
}
})
}