@atomist/sdm-core
Version:
Atomist Software Delivery Machine - Implementation
41 lines • 1.93 kB
JavaScript
/*
* Copyright © 2019 Atomist, Inc.
*
* 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
*
* http://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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const sdm_1 = require("@atomist/sdm");
const projectVersioner_1 = require("../../internal/delivery/build/local/projectVersioner");
/**
* Goal that performs project visioning: For example using Maven to increment the project version number
*/
class Version extends sdm_1.FulfillableGoalWithRegistrations {
constructor(goalDetailsOrUniqueName = sdm_1.DefaultGoalNameGenerator.generateName("version"), ...dependsOn) {
super(Object.assign(Object.assign({ workingDescription: "Calculating project version", completedDescription: "Versioned" }, sdm_1.getGoalDefinitionFrom(goalDetailsOrUniqueName, sdm_1.DefaultGoalNameGenerator.generateName("version"))), { displayName: "version" }), ...dependsOn);
}
with(registration) {
this.addFulfillment(Object.assign({ goalExecutor: projectVersioner_1.executeVersioner(registration.versioner), name: sdm_1.DefaultGoalNameGenerator.generateName("versioner") }, registration));
return this;
}
withVersioner(versioner) {
this.with({
name: sdm_1.DefaultGoalNameGenerator.generateName("versioner"),
pushTest: sdm_1.AnyPush,
versioner,
});
return this;
}
}
exports.Version = Version;
//# sourceMappingURL=Version.js.map
;