"use strict";
/*
 * Copyright © 2020 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 });
exports.computeArtifactId = exports.JavaProjectCreationParameterDefinitions = void 0;
const javaPatterns_1 = require("../javaPatterns");
/**
 * Java project generator parameters definitions.
 */
exports.JavaProjectCreationParameterDefinitions = {
    enteredArtifactId: Object.assign(Object.assign({}, javaPatterns_1.MavenArtifactIdRegExp), { displayName: "artifactId", required: false, defaultValue: "", order: 51 }),
    groupId: Object.assign(Object.assign({}, javaPatterns_1.MavenGroupIdRegExp), { required: true, order: 50 }),
    rootPackage: Object.assign(Object.assign({}, javaPatterns_1.JavaPackageRegExp), { required: true, order: 53 }),
    version: {
        pattern: /.*/,
        description: "Version to use",
        required: false,
        defaultValue: "0.1.0-SNAPSHOT",
    },
    description: {
        pattern: /.*/,
        required: false,
        description: "Description for the new project",
    },
};
/**
 * Compute the artifact id to use from the given parameters.
 * Falls back to repo name if not provided
 */
function computeArtifactId(params, project) {
    return params.enteredArtifactId || project.id.repo;
}
exports.computeArtifactId = computeArtifactId;
//# sourceMappingURL=JavaProjectCreationParameters.js.map