Files
spring-data-dev-tools/antora/lib/version-fix.js
2023-09-07 09:21:56 +02:00

35 lines
1.3 KiB
JavaScript

/*
* Copyright 2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict'
/**
* The purpose of this extension is to fix invalid metadata saved to either antora.yml or gradle.properties in certain
* tags. This invalid metadata prevents Antora from classifying the component versions properly.
*
* This extension should be listed directly after @antora/collector-extension.
*/
module.exports.register = function () {
this.once('contentAggregated', ({ contentAggregate }) => {
contentAggregate.forEach((componentVersionBucket) => {
if (componentVersionBucket.version === '3.2.0-SNAPSHOT') {
componentVersionBucket.version = '3.2.0'
componentVersionBucket.prerelease = '-SNAPSHOT'
}
})
})
}