Search in sources :

Example 1 with Packagers

use of org.jreleaser.model.Packagers in project jreleaser by jreleaser.

the class PackagersValidator method validatePackagers.

public static void validatePackagers(JReleaserContext context, JReleaserContext.Mode mode, Errors errors) {
    if (!mode.validateConfig()) {
        return;
    }
    context.getLogger().debug("packagers");
    JReleaserModel model = context.getModel();
    Packagers packagers = model.getPackagers();
    Project project = model.getProject();
    packagers.getBrew().resolveEnabled(project);
    packagers.getBrew().getTap().resolveEnabled(project);
    validatePackager(context, packagers.getBrew(), packagers.getBrew().getTap(), errors);
    packagers.getChocolatey().resolveEnabled(project);
    packagers.getChocolatey().getBucket().resolveEnabled(project);
    validatePackager(context, packagers.getChocolatey(), packagers.getChocolatey().getBucket(), errors);
    packagers.getDocker().resolveEnabled(project);
    packagers.getDocker().getRepository().resolveEnabled(project);
    validatePackager(context, packagers.getDocker(), packagers.getDocker().getRepository(), errors);
    if (!packagers.getDocker().getSpecs().isEmpty()) {
        errors.configuration(RB.$("validation_packagers_docker_specs"));
    }
    packagers.getGofish().resolveEnabled(project);
    packagers.getGofish().getRepository().resolveEnabled(project);
    validatePackager(context, packagers.getGofish(), packagers.getGofish().getRepository(), errors);
    if (isBlank(packagers.getGofish().getRepository().getName())) {
        packagers.getGofish().getRepository().setName(model.getRelease().getGitService().getOwner() + "-fish-food");
    }
    packagers.getGofish().getRepository().setTapName(model.getRelease().getGitService().getOwner() + "-fish-food");
    packagers.getJbang().resolveEnabled(project);
    packagers.getJbang().getCatalog().resolveEnabled(project);
    validatePackager(context, packagers.getJbang(), packagers.getJbang().getCatalog(), errors);
    packagers.getMacports().resolveEnabled(project);
    packagers.getMacports().getRepository().resolveEnabled(project);
    validatePackager(context, packagers.getMacports(), packagers.getMacports().getRepository(), errors);
    packagers.getScoop().resolveEnabled(project);
    packagers.getScoop().getBucket().resolveEnabled(project);
    validatePackager(context, packagers.getScoop(), packagers.getScoop().getBucket(), errors);
    if (isBlank(packagers.getScoop().getBucket().getName())) {
        packagers.getScoop().getBucket().setName("scoop-" + model.getRelease().getGitService().getOwner());
    }
    packagers.getScoop().getBucket().setTapName("scoop-" + model.getRelease().getGitService().getOwner());
    packagers.getSnap().resolveEnabled(project);
    packagers.getSnap().getSnap().resolveEnabled(project);
    validatePackager(context, packagers.getSnap(), packagers.getSnap().getSnap(), errors);
    packagers.getSpec().resolveEnabled(project);
    packagers.getSpec().getRepository().resolveEnabled(project);
    validatePackager(context, packagers.getSpec(), packagers.getSpec().getRepository(), errors);
    if (isBlank(packagers.getSpec().getRepository().getName())) {
        packagers.getSpec().getRepository().setName(model.getRelease().getGitService().getOwner() + "-spec");
    }
    packagers.getSpec().getRepository().setTapName(model.getRelease().getGitService().getOwner() + "-spec");
    validateSdkman(context, packagers.getSdkman(), errors);
}
Also used : Project(org.jreleaser.model.Project) JReleaserModel(org.jreleaser.model.JReleaserModel) Packagers(org.jreleaser.model.Packagers)

Aggregations

JReleaserModel (org.jreleaser.model.JReleaserModel)1 Packagers (org.jreleaser.model.Packagers)1 Project (org.jreleaser.model.Project)1