• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jreleaser / jreleaser / #556

22 Nov 2025 04:17PM UTC coverage: 46.213% (-2.0%) from 48.203%
#556

push

github

aalmiray
feat(jdks): Allow filtering by platform

Closes #2000

Co-authored-by: Ixchel Ruiz <ixchelruiz@yahoo.com>

0 of 42 new or added lines in 5 files covered. (0.0%)

1116 existing lines in 107 files now uncovered.

24939 of 53965 relevant lines covered (46.21%)

0.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

43.48
/plugins/jreleaser/src/main/java/org/jreleaser/cli/Assemble.java
1
/*
2
 * SPDX-License-Identifier: Apache-2.0
3
 *
4
 * Copyright 2020-2025 The JReleaser authors.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *     https://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
package org.jreleaser.cli;
19

20
import org.jreleaser.model.api.JReleaserCommand;
21
import org.jreleaser.model.api.JReleaserContext.Mode;
22
import org.jreleaser.model.internal.JReleaserContext;
23
import org.jreleaser.workflow.Workflows;
24
import picocli.CommandLine;
25

26
import java.util.Set;
27

28
/**
29
 * @author Andres Almiray
30
 * @since 0.2.0
31
 */
32
@CommandLine.Command(name = "assemble")
33
public class Assemble extends AbstractPlatformAwareModelCommand<Main> {
1✔
34
    @CommandLine.ArgGroup
35
    Composite composite;
36

37
    static class Composite {
×
38
        @CommandLine.ArgGroup(exclusive = false, order = 1,
39
            headingKey = "include.filter.header")
40
        Include include;
41

42
        @CommandLine.ArgGroup(exclusive = false, order = 2,
43
            headingKey = "exclude.filter.header")
44
        Exclude exclude;
45

46
        String[] includedAssemblers() {
47
            return null != include ? include.includedAssemblers : null;
×
48
        }
49

50
        String[] includedDistributions() {
51
            return null != include ? include.includedDistributions : null;
×
52
        }
53

54
        String[] excludedAssemblers() {
55
            return null != exclude ? exclude.excludedAssemblers : null;
×
56
        }
57

58
        String[] excludedDistributions() {
59
            return null != exclude ? exclude.excludedDistributions : null;
×
60
        }
61
    }
62

63
    static class Include {
×
64
        @CommandLine.Option(names = {"-s", "--assembler"},
65
            paramLabel = "<assembler>")
66
        String[] includedAssemblers;
67

68
        @CommandLine.Option(names = {"-d", "--distribution"},
69
            paramLabel = "<distribution>")
70
        String[] includedDistributions;
71
    }
72

73
    static class Exclude {
×
74
        @CommandLine.Option(names = {"-xs", "--exclude-assembler"},
75
            paramLabel = "<assembler>")
76
        String[] excludedAssemblers;
77

78
        @CommandLine.Option(names = {"-xd", "--exclude-distribution"},
79
            paramLabel = "<distribution>")
80
        String[] excludedDistributions;
81
    }
82

83
    @Override
84
    protected void collectCandidateDeprecatedArgs(Set<AbstractCommand.DeprecatedArg> args) {
85
        super.collectCandidateDeprecatedArgs(args);
1✔
86
        args.add(new DeprecatedArg("-s", "--assembler", "1.5.0"));
1✔
87
        args.add(new DeprecatedArg("-xs", "--exclude-assembler", "1.5.0"));
1✔
88
        args.add(new DeprecatedArg("-d", "--distribution", "1.5.0"));
1✔
89
        args.add(new DeprecatedArg("-xd", "--exclude-distribution", "1.5.0"));
1✔
90
    }
1✔
91

92
    @Override
93
    protected void doExecute(JReleaserContext context) {
94
        if (null != composite) {
1✔
95
            context.setIncludedAssemblers(collectEntries(composite.includedAssemblers(), true));
×
96
            context.setIncludedDistributions(collectEntries(composite.includedDistributions()));
×
97
            context.setExcludedAssemblers(collectEntries(composite.excludedAssemblers(), true));
×
98
            context.setExcludedDistributions(collectEntries(composite.excludedDistributions()));
×
99
        }
UNCOV
100
        Workflows.assemble(context).execute();
×
UNCOV
101
    }
×
102

103
    @Override
104
    protected Mode getMode() {
105
        return Mode.ASSEMBLE;
1✔
106
    }
107

108
    @Override
109
    protected JReleaserCommand getCommand() {
110
        return JReleaserCommand.ASSEMBLE;
1✔
111
    }
112
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc