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

jreleaser / jreleaser / #477

04 Apr 2025 05:53PM UTC coverage: 35.124% (-5.1%) from 40.183%
#477

push

github

aalmiray
fix(deploy): Add missing Forgejo messages

Related to #1842

18210 of 51845 relevant lines covered (35.12%)

0.35 hits per line

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

51.61
/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 DRY_RUN = "DRY_RUN";
42
    String GIT_ROOT_SEARCH = "GIT_ROOT_SEARCH";
43
    String STRICT = "STRICT";
44
    String SELECT_CURRENT_PLATFORM = "SELECT_CURRENT_PLATFORM";
45
    String SELECT_PLATFORMS = "SELECT_PLATFORMS";
46
    String REJECT_PLATFORMS = "REJECT_PLATFORMS";
47

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

50
    Path relativizeToBasedir(Path other);
51

52
    JReleaserLogger getLogger();
53

54
    Mode getMode();
55

56
    JReleaserModel getModel();
57

58
    Path getBasedir();
59

60
    Path getOutputDirectory();
61

62
    Path getChecksumsDirectory();
63

64
    Path getCatalogsDirectory();
65

66
    Path getSignaturesDirectory();
67

68
    Path getPrepareDirectory();
69

70
    Path getPackageDirectory();
71

72
    Path getAssembleDirectory();
73

74
    Path getDownloadDirectory();
75

76
    Path getArtifactsDirectory();
77

78
    Path getDeployDirectory();
79

80
    boolean isDryrun();
81

82
    boolean isGitRootSearch();
83

84
    boolean isStrict();
85

86
    List<String> getIncludedAnnouncers();
87

88
    List<String> getIncludedAssemblers();
89

90
    List<String> getIncludedDistributions();
91

92
    List<String> getIncludedPackagers();
93

94
    List<String> getIncludedDownloaderTypes();
95

96
    List<String> getIncludedDownloaderNames();
97

98
    List<String> getIncludedDeployerTypes();
99

100
    List<String> getIncludedDeployerNames();
101

102
    List<String> getIncludedUploaderTypes();
103

104
    List<String> getIncludedUploaderNames();
105

106
    List<String> getExcludedAnnouncers();
107

108
    List<String> getExcludedAssemblers();
109

110
    List<String> getExcludedDistributions();
111

112
    List<String> getExcludedPackagers();
113

114
    List<String> getExcludedDownloaderTypes();
115

116
    List<String> getExcludedDownloaderNames();
117

118
    List<String> getExcludedDeployerTypes();
119

120
    List<String> getExcludedDeployerNames();
121

122
    List<String> getExcludedUploaderTypes();
123

124
    List<String> getExcludedUploaderNames();
125

126
    JReleaserCommand getCommand();
127

128
    TemplateContext props();
129

130
    TemplateContext fullProps();
131

132
    void nag(String version, String message);
133

134
    Keyring createKeyring() throws SigningException;
135

136
    Changelog getChangelog();
137

138
    Map<String, Object> getAdditionalProperties();
139

140
    class Changelog implements Serializable {
1✔
141
        private static final long serialVersionUID = -7619174395858420344L;
142

143
        private String resolvedChangelog;
144
        private String formattedChanges;
145
        private String formattedContributors;
146

147
        public String getResolvedChangelog() {
148
            return resolvedChangelog;
×
149
        }
150

151
        public void setResolvedChangelog(String resolvedChangelog) {
152
            this.resolvedChangelog = resolvedChangelog;
×
153
        }
×
154

155
        public String getFormattedChanges() {
156
            return formattedChanges;
×
157
        }
158

159
        public void setFormattedChanges(String formattedChanges) {
160
            this.formattedChanges = formattedChanges;
×
161
        }
×
162

163
        public String getFormattedContributors() {
164
            return formattedContributors;
×
165
        }
166

167
        public void setFormattedContributors(String formattedContributors) {
168
            this.formattedContributors = formattedContributors;
×
169
        }
×
170

171
        public void apply(TemplateContext props) {
172
            if (!props.contains(KEY_CHANGELOG)) props.set(KEY_CHANGELOG, passThrough(resolvedChangelog));
×
173
            if (!props.contains(KEY_CHANGELOG_CHANGES)) props.set(KEY_CHANGELOG_CHANGES, passThrough(formattedChanges));
×
174
            if (!props.contains(KEY_CHANGELOG_CONTRIBUTORS)) {
×
175
                props.set(KEY_CHANGELOG_CONTRIBUTORS, passThrough(formattedContributors));
×
176
            }
177
        }
×
178
    }
179

180
    enum Mode {
1✔
181
        CONFIG,
1✔
182
        DOWNLOAD,
1✔
183
        ASSEMBLE,
1✔
184
        DEPLOY,
1✔
185
        FULL,
1✔
186
        CHANGELOG,
1✔
187
        ANNOUNCE;
1✔
188

189
        public boolean validateChangelog() {
190
            return this == CHANGELOG;
×
191
        }
192

193
        public boolean validateAnnounce() {
194
            return this == ANNOUNCE;
1✔
195
        }
196

197
        public boolean validateDeploy() {
198
            return this == DEPLOY;
1✔
199
        }
200

201
        public boolean validateDownload() {
202
            return this == DOWNLOAD;
1✔
203
        }
204

205
        public boolean validateAssembly() {
206
            return this == ASSEMBLE;
1✔
207
        }
208

209
        public boolean validateStandalone() {
210
            return validateAssembly() || validateDownload() || validateDeploy();
1✔
211
        }
212

213
        public boolean validateConfig() {
214
            return this == CONFIG || this == FULL;
1✔
215
        }
216

217
        public boolean validatePaths() {
218
            return this == FULL;
1✔
219
        }
220
    }
221
}
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