• 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

0.0
/core/jreleaser-engine/src/main/java/org/jreleaser/engine/context/ModelAutoConfigurer.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.engine.context;
19

20
import org.jreleaser.bundle.RB;
21
import org.jreleaser.logging.JReleaserLogger;
22
import org.jreleaser.model.Active;
23
import org.jreleaser.model.JReleaserException;
24
import org.jreleaser.model.JReleaserVersion;
25
import org.jreleaser.model.UpdateSection;
26
import org.jreleaser.model.api.JReleaserCommand;
27
import org.jreleaser.model.api.JReleaserContext.Mode;
28
import org.jreleaser.model.internal.JReleaserContext;
29
import org.jreleaser.model.internal.JReleaserModel;
30
import org.jreleaser.model.internal.common.Artifact;
31
import org.jreleaser.model.internal.release.BaseReleaser;
32
import org.jreleaser.model.internal.release.CodebergReleaser;
33
import org.jreleaser.model.internal.release.GithubReleaser;
34
import org.jreleaser.model.internal.release.GitlabReleaser;
35
import org.jreleaser.model.internal.util.Artifacts;
36
import org.jreleaser.model.spi.release.Repository;
37
import org.jreleaser.sdk.git.GitSdk;
38
import org.jreleaser.util.Env;
39

40
import java.io.IOException;
41
import java.nio.file.Path;
42
import java.util.ArrayList;
43
import java.util.LinkedHashSet;
44
import java.util.List;
45
import java.util.Set;
46

47
import static java.util.Objects.requireNonNull;
48
import static org.jreleaser.util.StringUtils.isNotBlank;
49

50
/**
51
 * @author Andres Almiray
52
 * @since 0.3.0
53
 */
54
public final class ModelAutoConfigurer {
55
    private static final String GLOB_PREFIX = "glob:";
56
    private static final String REGEX_PREFIX = "regex:";
57

UNCOV
58
    private final List<String> authors = new ArrayList<>();
×
UNCOV
59
    private final List<String> files = new ArrayList<>();
×
UNCOV
60
    private final List<String> globs = new ArrayList<>();
×
UNCOV
61
    private final List<String> selectedPlatforms = new ArrayList<>();
×
UNCOV
62
    private final List<String> rejectedPlatforms = new ArrayList<>();
×
UNCOV
63
    private final Set<UpdateSection> updateSections = new LinkedHashSet<>();
×
64
    private JReleaserLogger logger;
65
    private Path basedir;
66
    private Path settings;
67
    private Path outputDirectory;
68
    private Boolean yolo;
69
    private Boolean dryrun;
70
    private Boolean gitRootSearch;
71
    private Boolean strict;
72
    private String projectName;
73
    private String projectVersion;
74
    private String projectVersionPattern;
75
    private String projectSnapshotPattern;
76
    private String projectSnapshotLabel;
77
    private boolean projectSnapshotFullChangelog;
78
    private String projectCopyright;
79
    private String projectDescription;
80
    private String projectInceptionYear;
81
    private String projectStereotype;
82
    private String tagName;
83
    private String previousTagName;
84
    private String releaseName;
85
    private String milestoneName;
86
    private String branch;
87
    private Boolean prerelease;
88
    private String prereleasePattern;
89
    private Boolean draft;
90
    private boolean overwrite;
91
    private boolean update;
92
    private boolean skipTag;
93
    private boolean skipRelease;
94
    private boolean skipChecksums;
95
    private String changelog;
96
    private boolean changelogFormatted;
97
    private String username;
98
    private String commitAuthorName;
99
    private String commitAuthorEmail;
100
    private boolean signing;
101
    private boolean armored;
102

UNCOV
103
    private ModelAutoConfigurer() {
×
104
        // noop
UNCOV
105
    }
×
106

107
    public ModelAutoConfigurer logger(JReleaserLogger logger) {
UNCOV
108
        this.logger = logger;
×
UNCOV
109
        return this;
×
110
    }
111

112
    public ModelAutoConfigurer basedir(Path basedir) {
UNCOV
113
        this.basedir = basedir;
×
UNCOV
114
        return this;
×
115
    }
116

117
    public ModelAutoConfigurer settings(Path settings) {
UNCOV
118
        this.settings = settings;
×
UNCOV
119
        return this;
×
120
    }
121

122

123
    public ModelAutoConfigurer outputDirectory(Path outputDirectory) {
UNCOV
124
        this.outputDirectory = outputDirectory;
×
UNCOV
125
        return this;
×
126
    }
127

128
    public ModelAutoConfigurer yolo(Boolean yolo) {
UNCOV
129
        this.yolo = yolo;
×
UNCOV
130
        return this;
×
131
    }
132

133
    public ModelAutoConfigurer dryrun(Boolean dryrun) {
UNCOV
134
        this.dryrun = dryrun;
×
UNCOV
135
        return this;
×
136
    }
137

138
    public ModelAutoConfigurer gitRootSearch(Boolean gitRootSearch) {
UNCOV
139
        this.gitRootSearch = gitRootSearch;
×
UNCOV
140
        return this;
×
141
    }
142

143
    public ModelAutoConfigurer strict(Boolean strict) {
UNCOV
144
        this.strict = strict;
×
UNCOV
145
        return this;
×
146
    }
147

148
    public ModelAutoConfigurer projectName(String projectName) {
UNCOV
149
        this.projectName = projectName;
×
UNCOV
150
        return this;
×
151
    }
152

153
    public ModelAutoConfigurer projectVersion(String projectVersion) {
UNCOV
154
        this.projectVersion = projectVersion;
×
UNCOV
155
        return this;
×
156
    }
157

158
    public ModelAutoConfigurer projectVersionPattern(String projectVersionPattern) {
UNCOV
159
        this.projectVersionPattern = projectVersionPattern;
×
UNCOV
160
        return this;
×
161
    }
162

163
    public ModelAutoConfigurer projectSnapshotPattern(String projectSnapshotPattern) {
UNCOV
164
        this.projectSnapshotPattern = projectSnapshotPattern;
×
UNCOV
165
        return this;
×
166
    }
167

168
    public ModelAutoConfigurer projectSnapshotLabel(String projectSnapshotLabel) {
UNCOV
169
        this.projectSnapshotLabel = projectSnapshotLabel;
×
UNCOV
170
        return this;
×
171
    }
172

173
    public ModelAutoConfigurer projectSnapshotFullChangelog(boolean projectSnapshotFullChangelog) {
UNCOV
174
        this.projectSnapshotFullChangelog = projectSnapshotFullChangelog;
×
UNCOV
175
        return this;
×
176
    }
177

178
    public ModelAutoConfigurer projectCopyright(String projectCopyright) {
UNCOV
179
        this.projectCopyright = projectCopyright;
×
UNCOV
180
        return this;
×
181
    }
182

183
    public ModelAutoConfigurer projectDescription(String projectDescription) {
UNCOV
184
        this.projectDescription = projectDescription;
×
UNCOV
185
        return this;
×
186
    }
187

188
    public ModelAutoConfigurer projectInceptionYear(String projectInceptionYear) {
UNCOV
189
        this.projectInceptionYear = projectInceptionYear;
×
UNCOV
190
        return this;
×
191
    }
192

193
    public ModelAutoConfigurer projectStereotype(String projectStereotype) {
UNCOV
194
        this.projectStereotype = projectStereotype;
×
UNCOV
195
        return this;
×
196
    }
197

198
    public ModelAutoConfigurer tagName(String tagName) {
UNCOV
199
        this.tagName = tagName;
×
UNCOV
200
        return this;
×
201
    }
202

203
    public ModelAutoConfigurer previousTagName(String previousTagName) {
UNCOV
204
        this.previousTagName = previousTagName;
×
UNCOV
205
        return this;
×
206
    }
207

208
    public ModelAutoConfigurer branch(String branch) {
UNCOV
209
        this.branch = branch;
×
UNCOV
210
        return this;
×
211
    }
212

213
    public ModelAutoConfigurer releaseName(String releaseName) {
UNCOV
214
        this.releaseName = releaseName;
×
UNCOV
215
        return this;
×
216
    }
217

218
    public ModelAutoConfigurer milestoneName(String milestoneName) {
UNCOV
219
        this.milestoneName = milestoneName;
×
UNCOV
220
        return this;
×
221
    }
222

223
    public ModelAutoConfigurer prerelease(Boolean prerelease) {
UNCOV
224
        this.prerelease = prerelease;
×
UNCOV
225
        return this;
×
226
    }
227

228
    public ModelAutoConfigurer prereleasePattern(String prereleasePattern) {
UNCOV
229
        this.prereleasePattern = prereleasePattern;
×
UNCOV
230
        return this;
×
231
    }
232

233
    public ModelAutoConfigurer draft(Boolean draft) {
UNCOV
234
        this.draft = draft;
×
UNCOV
235
        return this;
×
236
    }
237

238
    public ModelAutoConfigurer overwrite(boolean overwrite) {
UNCOV
239
        this.overwrite = overwrite;
×
UNCOV
240
        return this;
×
241
    }
242

243
    public ModelAutoConfigurer update(boolean update) {
UNCOV
244
        this.update = update;
×
UNCOV
245
        return this;
×
246
    }
247

248
    public ModelAutoConfigurer updateSections(Set<UpdateSection> updateSections) {
UNCOV
249
        this.updateSections.clear();
×
UNCOV
250
        if (null != updateSections && !updateSections.isEmpty()) {
×
251
            updateSections.forEach(this::updateSection);
×
252
        }
UNCOV
253
        return this;
×
254
    }
255

256
    public ModelAutoConfigurer updateSection(UpdateSection updateSection) {
257
        if (null != updateSection) {
×
258
            this.updateSections.add(updateSection);
×
259
        }
260
        return this;
×
261
    }
262

263
    public ModelAutoConfigurer skipTag(boolean skipTag) {
UNCOV
264
        this.skipTag = skipTag;
×
UNCOV
265
        return this;
×
266
    }
267

268
    public ModelAutoConfigurer skipRelease(boolean skipRelease) {
UNCOV
269
        this.skipRelease = skipRelease;
×
UNCOV
270
        return this;
×
271
    }
272

273
    public ModelAutoConfigurer skipChecksums(boolean skipChecksums) {
UNCOV
274
        this.skipChecksums = skipChecksums;
×
UNCOV
275
        return this;
×
276
    }
277

278
    public ModelAutoConfigurer changelog(String changelog) {
UNCOV
279
        this.changelog = changelog;
×
UNCOV
280
        return this;
×
281
    }
282

283
    public ModelAutoConfigurer changelogFormatted(boolean changelogFormatted) {
UNCOV
284
        this.changelogFormatted = changelogFormatted;
×
UNCOV
285
        return this;
×
286
    }
287

288
    public ModelAutoConfigurer username(String username) {
UNCOV
289
        this.username = username;
×
UNCOV
290
        return this;
×
291
    }
292

293
    public ModelAutoConfigurer commitAuthorName(String commitAuthorName) {
UNCOV
294
        this.commitAuthorName = commitAuthorName;
×
UNCOV
295
        return this;
×
296
    }
297

298
    public ModelAutoConfigurer commitAuthorEmail(String commitAuthorEmail) {
UNCOV
299
        this.commitAuthorEmail = commitAuthorEmail;
×
UNCOV
300
        return this;
×
301
    }
302

303
    public ModelAutoConfigurer signing(boolean signing) {
UNCOV
304
        this.signing = signing;
×
UNCOV
305
        return this;
×
306
    }
307

308
    public ModelAutoConfigurer armored(boolean armored) {
UNCOV
309
        this.armored = armored;
×
UNCOV
310
        return this;
×
311
    }
312

313
    public ModelAutoConfigurer authors(List<String> authors) {
UNCOV
314
        this.authors.clear();
×
UNCOV
315
        if (null != authors && !authors.isEmpty()) {
×
316
            authors.forEach(this::file);
×
317
        }
UNCOV
318
        return this;
×
319
    }
320

321
    public ModelAutoConfigurer author(String author) {
322
        if (isNotBlank(author)) {
×
323
            this.authors.add(author.trim());
×
324
        }
325
        return this;
×
326
    }
327

328
    public ModelAutoConfigurer files(List<String> files) {
UNCOV
329
        this.files.clear();
×
UNCOV
330
        if (null != files && !files.isEmpty()) {
×
331
            files.forEach(this::file);
×
332
        }
UNCOV
333
        return this;
×
334
    }
335

336
    public ModelAutoConfigurer file(String file) {
337
        if (isNotBlank(file)) {
×
338
            this.files.add(file.trim());
×
339
        }
340
        return this;
×
341
    }
342

343
    public ModelAutoConfigurer globs(List<String> globs) {
UNCOV
344
        this.globs.clear();
×
UNCOV
345
        if (null != globs && !globs.isEmpty()) {
×
346
            globs.forEach(this::glob);
×
347
        }
UNCOV
348
        return this;
×
349
    }
350

351
    public ModelAutoConfigurer glob(String glob) {
352
        if (isNotBlank(glob)) {
×
353
            if (glob.startsWith(GLOB_PREFIX) || glob.startsWith(REGEX_PREFIX)) {
×
354
                this.globs.add(glob.trim());
×
355
            } else {
356
                this.globs.add(GLOB_PREFIX + glob.trim());
×
357
            }
358
        }
359
        return this;
×
360
    }
361

362
    public ModelAutoConfigurer selectedPlatforms(List<String> platforms) {
UNCOV
363
        this.selectedPlatforms.clear();
×
UNCOV
364
        if (null != platforms && !platforms.isEmpty()) {
×
365
            platforms.forEach(this::selectedPlatform);
×
366
        }
UNCOV
367
        return this;
×
368
    }
369

370
    public ModelAutoConfigurer selectedPlatform(String platform) {
371
        if (isNotBlank(platform)) {
×
372
            this.selectedPlatforms.add(platform.trim());
×
373
        }
374
        return this;
×
375
    }
376

377
    public ModelAutoConfigurer rejectedPlatforms(List<String> platforms) {
UNCOV
378
        this.rejectedPlatforms.clear();
×
UNCOV
379
        if (null != platforms && !platforms.isEmpty()) {
×
380
            platforms.forEach(this::rejectedPlatform);
×
381
        }
UNCOV
382
        return this;
×
383
    }
384

385
    public ModelAutoConfigurer rejectedPlatform(String platform) {
386
        if (isNotBlank(platform)) {
×
387
            this.rejectedPlatforms.add(platform.trim());
×
388
        }
389
        return this;
×
390
    }
391

392
    public JReleaserContext autoConfigure() {
UNCOV
393
        requireNonNull(logger, "Argument 'logger' ust not be null");
×
UNCOV
394
        requireNonNull(basedir, "Argument 'basedir' ust not be null");
×
UNCOV
395
        requireNonNull(outputDirectory, "Argument 'outputDirectory' ust not be null");
×
396

UNCOV
397
        logger.info("JReleaser {}", JReleaserVersion.getPlainVersion());
×
UNCOV
398
        JReleaserVersion.banner(logger.getTracer());
×
UNCOV
399
        logger.info(RB.$("context.configurer.auto-config.on"));
×
UNCOV
400
        logger.increaseIndent();
×
UNCOV
401
        logger.info(RB.$("context.configurer.basedir.set"), basedir.toAbsolutePath());
×
UNCOV
402
        dumpAutoConfig();
×
UNCOV
403
        logger.decreaseIndent();
×
UNCOV
404
        return createAutoConfiguredContext();
×
405
    }
406

407
    private JReleaserContext createAutoConfiguredContext() {
UNCOV
408
        return ContextCreator.create(
×
409
            logger,
410
            JReleaserContext.Configurer.CLI,
411
            Mode.FULL,
412
            JReleaserCommand.RELEASE,
UNCOV
413
            autoConfiguredModel(basedir),
×
414
            basedir,
415
            settings,
416
            outputDirectory,
UNCOV
417
            resolveBoolean(org.jreleaser.model.api.JReleaserContext.YOLO, yolo),
×
UNCOV
418
            resolveBoolean(org.jreleaser.model.api.JReleaserContext.DRY_RUN, dryrun),
×
UNCOV
419
            resolveBoolean(org.jreleaser.model.api.JReleaserContext.GIT_ROOT_SEARCH, gitRootSearch),
×
UNCOV
420
            resolveBoolean(org.jreleaser.model.api.JReleaserContext.STRICT, strict),
×
421
            selectedPlatforms,
422
            rejectedPlatforms);
423
    }
424

425
    private boolean resolveBoolean(String key, Boolean value) {
UNCOV
426
        if (null != value) return value;
×
UNCOV
427
        String resolvedValue = Env.resolve(key, "");
×
UNCOV
428
        return isNotBlank(resolvedValue) && Boolean.parseBoolean(resolvedValue);
×
429
    }
430

431
    private void dumpAutoConfig() {
UNCOV
432
        if (isNotBlank(projectName)) logger.info("- project.name: {}", projectName);
×
UNCOV
433
        if (isNotBlank(projectVersion)) logger.info("- project.version: {}", projectVersion);
×
UNCOV
434
        if (isNotBlank(projectVersionPattern)) logger.info("- project.version.pattern: {}", projectVersionPattern);
×
UNCOV
435
        if (isNotBlank(projectSnapshotPattern)) logger.info("- project.snapshot.pattern: {}", projectSnapshotPattern);
×
UNCOV
436
        if (isNotBlank(projectSnapshotLabel)) logger.info("- project.snapshot.label: {}", projectSnapshotLabel);
×
UNCOV
437
        if (projectSnapshotFullChangelog) logger.info("- project.snapshot.full.changelog: true");
×
UNCOV
438
        if (isNotBlank(projectDescription)) logger.info("- project.description: {}", projectDescription);
×
UNCOV
439
        if (isNotBlank(projectCopyright)) logger.info("- project.copyright: {}", projectCopyright);
×
UNCOV
440
        if (isNotBlank(projectInceptionYear)) logger.info("- project.inceptionYear: {}", projectInceptionYear);
×
UNCOV
441
        if (isNotBlank(projectStereotype)) logger.info("- project.stereotype: {}", projectStereotype);
×
UNCOV
442
        if (!authors.isEmpty()) {
×
443
            for (String author : authors) {
×
444
                logger.info("- author: {}", author);
×
445
            }
×
446
        }
UNCOV
447
        if (isNotBlank(username)) logger.info("- release.username: {}", username);
×
UNCOV
448
        if (isNotBlank(tagName)) logger.info("- release.tagName: {}", tagName);
×
UNCOV
449
        if (isNotBlank(previousTagName)) logger.info("- release.previousTagName: {}", previousTagName);
×
UNCOV
450
        if (isNotBlank(branch)) logger.info("- release.branch: {}", branch);
×
UNCOV
451
        if (isNotBlank(releaseName)) logger.info("- release.releaseName: {}", releaseName);
×
UNCOV
452
        if (isNotBlank(milestoneName)) logger.info("- release.milestone.name: {}", milestoneName);
×
UNCOV
453
        if (overwrite) logger.info("- release.overwrite: true");
×
UNCOV
454
        if (update) logger.info("- release.update: true");
×
UNCOV
455
        if (!updateSections.isEmpty()) logger.info("- release.updateSections: " + updateSections);
×
UNCOV
456
        if (skipTag) logger.info("- release.skipTag: true");
×
UNCOV
457
        if (skipRelease) logger.info("- release.skipRelease: true");
×
UNCOV
458
        if (skipChecksums) logger.info("- checksums.disabled: true");
×
UNCOV
459
        if (null != prerelease && prerelease) logger.info("- release.prerelease: true");
×
UNCOV
460
        if (isNotBlank(prereleasePattern)) logger.info("- release.prerelease.pattern: {}", prereleasePattern);
×
UNCOV
461
        if (null != draft && draft) logger.info("- release.draft: true");
×
UNCOV
462
        if (isNotBlank(changelog)) logger.info(" - release.changelog: {}", changelog);
×
UNCOV
463
        if (changelogFormatted) logger.info("- release.changelog.formatted: true");
×
UNCOV
464
        if (isNotBlank(commitAuthorName)) logger.info("- release.commitAuthor.name: {}", commitAuthorName);
×
UNCOV
465
        if (isNotBlank(commitAuthorEmail)) logger.info("- release.commitAuthor.email: {}", commitAuthorEmail);
×
UNCOV
466
        if (signing) logger.info("- signing.enabled: true");
×
UNCOV
467
        if (armored) logger.info("- signing.armored: true");
×
UNCOV
468
        if (!files.isEmpty()) {
×
469
            for (String file : files) {
×
470
                logger.info("- file: {}", basedir.relativize(basedir.resolve(file)));
×
471
            }
×
472
        }
UNCOV
473
        if (!globs.isEmpty()) {
×
474
            for (String glob : globs) {
×
475
                logger.info("- glob: {}", glob);
×
476
            }
×
477
        }
UNCOV
478
        if (!selectedPlatforms.isEmpty()) {
×
479
            for (String platform : selectedPlatforms) {
×
480
                logger.info("- platform: {}", platform);
×
481
            }
×
482
        }
UNCOV
483
        if (!rejectedPlatforms.isEmpty()) {
×
484
            for (String platform : rejectedPlatforms) {
×
485
                logger.info("- !platform: {}", platform);
×
486
            }
×
487
        }
UNCOV
488
    }
×
489

490
    private JReleaserModel autoConfiguredModel(Path basedir) {
UNCOV
491
        JReleaserModel model = new JReleaserModel();
×
UNCOV
492
        model.getProject().setName(projectName);
×
UNCOV
493
        model.getProject().setDescription(projectDescription);
×
UNCOV
494
        model.getProject().setCopyright(projectCopyright);
×
UNCOV
495
        model.getProject().setStereotype(projectStereotype);
×
UNCOV
496
        model.getProject().setInceptionYear(projectInceptionYear);
×
UNCOV
497
        model.getProject().setAuthors(authors);
×
UNCOV
498
        model.getProject().setVersion(projectVersion);
×
UNCOV
499
        model.getProject().setVersionPattern(projectVersionPattern);
×
UNCOV
500
        model.getProject().getSnapshot().setPattern(projectSnapshotPattern);
×
UNCOV
501
        model.getProject().getSnapshot().setLabel(projectSnapshotLabel);
×
UNCOV
502
        model.getProject().getSnapshot().setFullChangelog(projectSnapshotFullChangelog);
×
503

504
        try {
UNCOV
505
            boolean grs = resolveBoolean(org.jreleaser.model.api.JReleaserContext.GIT_ROOT_SEARCH, gitRootSearch);
×
UNCOV
506
            Repository repository = GitSdk.of(basedir, grs).getRemote();
×
UNCOV
507
            BaseReleaser<?, ?> service = null;
×
UNCOV
508
            switch (repository.getKind()) {
×
509
                case GITHUB:
UNCOV
510
                    service = new GithubReleaser();
×
UNCOV
511
                    model.getRelease().setGithub((GithubReleaser) service);
×
UNCOV
512
                    service.getPrerelease().setEnabled(prerelease);
×
UNCOV
513
                    service.getPrerelease().setPattern(prereleasePattern);
×
UNCOV
514
                    ((GithubReleaser) service).setDraft(draft);
×
UNCOV
515
                    break;
×
516
                case GITLAB:
517
                    service = new GitlabReleaser();
×
518
                    model.getRelease().setGitlab((GitlabReleaser) service);
×
519
                    break;
×
520
                case CODEBERG:
521
                    service = new CodebergReleaser();
×
522
                    model.getRelease().setCodeberg((CodebergReleaser) service);
×
523
                    service.getPrerelease().setEnabled(prerelease);
×
524
                    service.getPrerelease().setPattern(prereleasePattern);
×
525
                    ((CodebergReleaser) service).setDraft(draft);
×
526
                    break;
×
527
                default:
528
                    throw new JReleaserException(RB.$("ERROR_context_configurer_unsupported_url", repository.getHttpUrl()));
×
529
            }
530

UNCOV
531
            service.setUsername(username);
×
UNCOV
532
            service.setTagName(tagName);
×
UNCOV
533
            service.setPreviousTagName(previousTagName);
×
UNCOV
534
            service.setReleaseName(releaseName);
×
UNCOV
535
            service.getMilestone().setName(milestoneName);
×
UNCOV
536
            service.setOverwrite(overwrite);
×
UNCOV
537
            service.getUpdate().setEnabled(update);
×
UNCOV
538
            if (!updateSections.isEmpty()) {
×
539
                if (!update) {
×
540
                    throw new JReleaserException(RB.$("ERROR_context_configurer_update_not_set"));
×
541
                }
542
                service.getUpdate().setSections(updateSections);
×
543
            }
UNCOV
544
            service.setSkipTag(skipTag);
×
UNCOV
545
            service.setSkipRelease(skipRelease);
×
UNCOV
546
            if (isNotBlank(branch)) service.setBranch(branch);
×
UNCOV
547
            if (isNotBlank(changelog)) service.getChangelog().setExternal(changelog);
×
UNCOV
548
            if (isNotBlank(commitAuthorName)) service.getCommitAuthor().setName(commitAuthorName);
×
UNCOV
549
            if (isNotBlank(commitAuthorEmail)) service.getCommitAuthor().setEmail(commitAuthorEmail);
×
UNCOV
550
            if (changelogFormatted) service.getChangelog().setFormatted(Active.ALWAYS);
×
551
        } catch (IOException e) {
×
552
            throw new JReleaserException(e.getMessage());
×
UNCOV
553
        }
×
554

UNCOV
555
        if (skipChecksums) {
×
556
            model.getChecksum().setArtifacts(false);
×
557
            model.getChecksum().setFiles(false);
×
558
            model.getSigning().setChecksums(false);
×
559
        }
560

UNCOV
561
        if (signing) {
×
562
            model.getSigning().setActive(Active.ALWAYS);
×
563
            model.getSigning().setArmored(armored);
×
564
        }
565

UNCOV
566
        if (!files.isEmpty()) {
×
567
            for (String file : files) {
×
568
                model.getFiles().addArtifact(Artifact.of(basedir.resolve(file)));
×
569
            }
×
570
        }
571

UNCOV
572
        if (!globs.isEmpty()) {
×
573
            model.getFiles().addArtifacts(Artifacts.resolveFiles(logger, basedir, globs));
×
574
        }
575

UNCOV
576
        return model;
×
577
    }
578

579
    public static ModelAutoConfigurer builder() {
UNCOV
580
        return new ModelAutoConfigurer();
×
581
    }
582
}
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