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

jreleaser / jreleaser / #510

27 Jul 2025 12:31PM UTC coverage: 45.783% (-3.6%) from 49.39%
#510

push

github

aalmiray
feat(packagers): Stage distribution publication in a fixed directory

Closes #1943

12 of 25 new or added lines in 4 files covered. (48.0%)

2208 existing lines in 190 files now uncovered.

23924 of 52255 relevant lines covered (45.78%)

0.46 hits per line

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

90.32
/api/jreleaser-model-api/src/main/java/org/jreleaser/model/api/JReleaserContext.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.model.api;
19

20
import org.jreleaser.logging.JReleaserLogger;
21
import org.jreleaser.model.api.signing.Keyring;
22
import org.jreleaser.model.api.signing.SigningException;
23
import org.jreleaser.mustache.TemplateContext;
24

25
import java.io.Serializable;
26
import java.nio.file.Path;
27
import java.util.List;
28
import java.util.Map;
29

30
import static org.jreleaser.model.Constants.KEY_CHANGELOG;
31
import static org.jreleaser.model.Constants.KEY_CHANGELOG_CHANGES;
32
import static org.jreleaser.model.Constants.KEY_CHANGELOG_CONTRIBUTORS;
33
import static org.jreleaser.mustache.MustacheUtils.passThrough;
34

35
/**
36
 * @author Andres Almiray
37
 * @since 0.1.0
38
 */
39
public interface JReleaserContext extends Serializable {
40
    String BASEDIR = "BASEDIR";
41
    String YOLO = "YOLO";
42
    String DRY_RUN = "DRY_RUN";
43
    String GIT_ROOT_SEARCH = "GIT_ROOT_SEARCH";
44
    String STRICT = "STRICT";
45
    String SELECT_CURRENT_PLATFORM = "SELECT_CURRENT_PLATFORM";
46
    String SELECT_PLATFORMS = "SELECT_PLATFORMS";
47
    String REJECT_PLATFORMS = "REJECT_PLATFORMS";
48

49
    Path relativize(Path basedir, Path other);
50

51
    Path relativizeToBasedir(Path other);
52

53
    JReleaserLogger getLogger();
54

55
    Mode getMode();
56

57
    JReleaserModel getModel();
58

59
    Path getBasedir();
60

61
    Path getOutputDirectory();
62

63
    Path getChecksumsDirectory();
64

65
    Path getCatalogsDirectory();
66

67
    Path getSignaturesDirectory();
68

69
    Path getPrepareDirectory();
70

71
    Path getPackageDirectory();
72

73
    Path getPublishDirectory();
74

75
    Path getAssembleDirectory();
76

77
    Path getDownloadDirectory();
78

79
    Path getArtifactsDirectory();
80

81
    Path getDeployDirectory();
82

83
    boolean isYolo();
84

85
    boolean isDryrun();
86

87
    boolean isGitRootSearch();
88

89
    boolean isStrict();
90

91
    List<String> getIncludedAnnouncers();
92

93
    List<String> getIncludedAssemblers();
94

95
    List<String> getIncludedDistributions();
96

97
    List<String> getIncludedPackagers();
98

99
    List<String> getIncludedDownloaderTypes();
100

101
    List<String> getIncludedDownloaderNames();
102

103
    List<String> getIncludedDeployerTypes();
104

105
    List<String> getIncludedDeployerNames();
106

107
    List<String> getIncludedUploaderTypes();
108

109
    List<String> getIncludedUploaderNames();
110

111
    List<String> getExcludedAnnouncers();
112

113
    List<String> getExcludedAssemblers();
114

115
    List<String> getExcludedDistributions();
116

117
    List<String> getExcludedPackagers();
118

119
    List<String> getExcludedDownloaderTypes();
120

121
    List<String> getExcludedDownloaderNames();
122

123
    List<String> getExcludedDeployerTypes();
124

125
    List<String> getExcludedDeployerNames();
126

127
    List<String> getExcludedUploaderTypes();
128

129
    List<String> getExcludedUploaderNames();
130

131
    JReleaserCommand getCommand();
132

133
    TemplateContext props();
134

135
    TemplateContext fullProps();
136

137
    void nag(String version, String message);
138

139
    Keyring createKeyring() throws SigningException;
140

141
    Changelog getChangelog();
142

143
    Map<String, Object> getAdditionalProperties();
144

145
    class Changelog implements Serializable {
1✔
146
        private static final long serialVersionUID = -7619174395858420344L;
147

148
        private String resolvedChangelog;
149
        private String formattedChanges;
150
        private String formattedContributors;
151

152
        public String getResolvedChangelog() {
153
            return resolvedChangelog;
1✔
154
        }
155

156
        public void setResolvedChangelog(String resolvedChangelog) {
157
            this.resolvedChangelog = resolvedChangelog;
1✔
158
        }
1✔
159

160
        public String getFormattedChanges() {
UNCOV
161
            return formattedChanges;
×
162
        }
163

164
        public void setFormattedChanges(String formattedChanges) {
165
            this.formattedChanges = formattedChanges;
1✔
166
        }
1✔
167

168
        public String getFormattedContributors() {
UNCOV
169
            return formattedContributors;
×
170
        }
171

172
        public void setFormattedContributors(String formattedContributors) {
173
            this.formattedContributors = formattedContributors;
1✔
174
        }
1✔
175

176
        public void apply(TemplateContext props) {
177
            if (!props.contains(KEY_CHANGELOG)) props.set(KEY_CHANGELOG, passThrough(resolvedChangelog));
1✔
178
            if (!props.contains(KEY_CHANGELOG_CHANGES)) props.set(KEY_CHANGELOG_CHANGES, passThrough(formattedChanges));
1✔
179
            if (!props.contains(KEY_CHANGELOG_CONTRIBUTORS)) {
1✔
180
                props.set(KEY_CHANGELOG_CONTRIBUTORS, passThrough(formattedContributors));
1✔
181
            }
182
        }
1✔
183
    }
184

185
    enum Mode {
1✔
186
        CONFIG,
1✔
187
        DOWNLOAD,
1✔
188
        ASSEMBLE,
1✔
189
        DEPLOY,
1✔
190
        FULL,
1✔
191
        CHANGELOG,
1✔
192
        ANNOUNCE;
1✔
193

194
        public boolean validateChangelog() {
195
            return this == CHANGELOG;
×
196
        }
197

198
        public boolean validateAnnounce() {
199
            return this == ANNOUNCE;
1✔
200
        }
201

202
        public boolean validateDeploy() {
203
            return this == DEPLOY;
1✔
204
        }
205

206
        public boolean validateDownload() {
207
            return this == DOWNLOAD;
1✔
208
        }
209

210
        public boolean validateAssembly() {
211
            return this == ASSEMBLE;
1✔
212
        }
213

214
        public boolean validateStandalone() {
215
            return validateAssembly() || validateDownload() || validateDeploy();
1✔
216
        }
217

218
        public boolean validateConfig() {
219
            return this == CONFIG || this == FULL;
1✔
220
        }
221

222
        public boolean validatePaths() {
223
            return this == FULL;
1✔
224
        }
225
    }
226
}
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