Search in sources :

Example 1 with KEY_GOFISH_PACKAGES

use of org.jreleaser.util.Constants.KEY_GOFISH_PACKAGES in project jreleaser by jreleaser.

the class GofishPackagerProcessor method fillPackagerProperties.

@Override
protected void fillPackagerProperties(Map<String, Object> props, Distribution distribution) throws PackagerProcessingException {
    List<Artifact> artifacts = collectArtifacts(distribution);
    List<GofishPackage> packages = artifacts.stream().filter(artifact -> isNotBlank(artifact.getPlatform())).map(artifact -> new GofishPackage(props, context, distribution, artifact)).collect(toList());
    if (packages.isEmpty()) {
        for (Artifact artifact : artifacts) {
            if (isNotBlank(artifact.getPlatform()))
                continue;
            for (String os : new String[] { "darwin", "linux", "windows" }) {
                for (String arch : new String[] { "x86_64", "aarch64" }) {
                    Artifact copy = artifact.copy();
                    copy.setPlatform(os + "-" + arch);
                    packages.add(new GofishPackage(props, context, distribution, copy));
                }
            }
        }
    }
    props.put(KEY_GOFISH_PACKAGES, packages);
}
Also used : TemplateUtils.trimTplExtension(org.jreleaser.templates.TemplateUtils.trimTplExtension) MustacheUtils.passThrough(org.jreleaser.util.MustacheUtils.passThrough) KEY_GOFISH_PACKAGES(org.jreleaser.util.Constants.KEY_GOFISH_PACKAGES) Artifact(org.jreleaser.model.Artifact) FileType(org.jreleaser.util.FileType) PackagerProcessingException(org.jreleaser.model.packager.spi.PackagerProcessingException) Algorithm(org.jreleaser.util.Algorithm) PlatformUtils(org.jreleaser.util.PlatformUtils) StringUtils.isNotBlank(org.jreleaser.util.StringUtils.isNotBlank) Project(org.jreleaser.model.Project) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) StringUtils.getFilename(org.jreleaser.util.StringUtils.getFilename) Gofish(org.jreleaser.model.Gofish) Map(java.util.Map) JReleaserContext(org.jreleaser.model.JReleaserContext) StringUtils.capitalize(org.jreleaser.util.StringUtils.capitalize) Distribution(org.jreleaser.model.Distribution) Path(java.nio.file.Path) Artifacts(org.jreleaser.model.util.Artifacts) Artifact(org.jreleaser.model.Artifact)

Aggregations

Path (java.nio.file.Path)1 List (java.util.List)1 Map (java.util.Map)1 Collectors.toList (java.util.stream.Collectors.toList)1 Artifact (org.jreleaser.model.Artifact)1 Distribution (org.jreleaser.model.Distribution)1 Gofish (org.jreleaser.model.Gofish)1 JReleaserContext (org.jreleaser.model.JReleaserContext)1 Project (org.jreleaser.model.Project)1 PackagerProcessingException (org.jreleaser.model.packager.spi.PackagerProcessingException)1 Artifacts (org.jreleaser.model.util.Artifacts)1 TemplateUtils.trimTplExtension (org.jreleaser.templates.TemplateUtils.trimTplExtension)1 Algorithm (org.jreleaser.util.Algorithm)1 KEY_GOFISH_PACKAGES (org.jreleaser.util.Constants.KEY_GOFISH_PACKAGES)1 FileType (org.jreleaser.util.FileType)1 MustacheUtils.passThrough (org.jreleaser.util.MustacheUtils.passThrough)1 PlatformUtils (org.jreleaser.util.PlatformUtils)1 StringUtils.capitalize (org.jreleaser.util.StringUtils.capitalize)1 StringUtils.getFilename (org.jreleaser.util.StringUtils.getFilename)1 StringUtils.isNotBlank (org.jreleaser.util.StringUtils.isNotBlank)1