-
-
Notifications
You must be signed in to change notification settings - Fork 102
/
WorkflowListener.java
165 lines (149 loc) · 5.68 KB
/
WorkflowListener.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020-2022 The JReleaser authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jreleaser.extensions.api.workflow;
import org.jreleaser.extensions.api.ExtensionPoint;
import org.jreleaser.model.api.JReleaserContext;
import org.jreleaser.model.api.announce.Announcer;
import org.jreleaser.model.api.assemble.Assembler;
import org.jreleaser.model.api.deploy.Deployer;
import org.jreleaser.model.api.distributions.Distribution;
import org.jreleaser.model.api.download.Downloader;
import org.jreleaser.model.api.hooks.ExecutionEvent;
import org.jreleaser.model.api.packagers.Packager;
import org.jreleaser.model.api.release.Releaser;
import org.jreleaser.model.api.upload.Uploader;
/**
* @author Andres Almiray
* @since 1.3.0
*/
public interface WorkflowListener extends ExtensionPoint {
/**
* Signals JReleaser to halt execution if this listener fails.
*
* @return {@code false} to halt execution on failure, {@code true} to continue.
*/
boolean isContinueOnError();
/**
* Triggered when the execution session starts.
*
* @param context the execution context.
*/
void onSessionStart(JReleaserContext context);
/**
* Triggered when the execution session ends.
*
* @param context the execution context.
*/
void onSessionEnd(JReleaserContext context);
/**
* Triggered when a workflow step starts/ends/fails.
*
* @param event event metadata.
* @param context the execution context.
*/
void onWorkflowStep(ExecutionEvent event, JReleaserContext context);
/**
* Triggered when an announcer starts/ends/fails.
*
* @param event event metadata.
* @param context the execution context.
* @param announcer the executing announcer.
*/
void onAnnounceStep(ExecutionEvent event, JReleaserContext context, Announcer announcer);
/**
* Triggered when an assembler starts/ends/fails.
*
* @param event event metadata.
* @param context the execution context.
* @param assembler the executing assembler.
*/
void onAssembleStep(ExecutionEvent event, JReleaserContext context, Assembler assembler);
/**
* Triggered when a deployer starts/ends/fails.
*
* @param event event metadata.
* @param context the execution context.
* @param deployer the executing deployer.
*/
void onDeployStep(ExecutionEvent event, JReleaserContext context, Deployer deployer);
/**
* Triggered when a downloader starts/ends/fails.
*
* @param event event metadata.
* @param context the execution context.
* @param downloader the executing downloader.
*/
void onDownloadStep(ExecutionEvent event, JReleaserContext context, Downloader downloader);
/**
* Triggered when an uploader starts/ends/fails.
*
* @param event event metadata.
* @param context the execution context.
* @param uploader the executing uploader.
*/
void onUploadStep(ExecutionEvent event, JReleaserContext context, Uploader uploader);
/**
* Triggered when a releaser starts/ends/fails.
*
* @param event event metadata.
* @param context the execution context.
* @param releaser the executing releaser.
*/
void onReleaseStep(ExecutionEvent event, JReleaserContext context, Releaser releaser);
/**
* Triggered when a distribution is about to be processed.
*
* @param context the execution context.
* @param distribution the distribution to be processed.
*/
void onDistributionStart(JReleaserContext context, Distribution distribution);
/**
* Triggered when a distribution has been processed.
*
* @param context the execution context.
* @param distribution the processed distribution.
*/
void onDistributionEnd(JReleaserContext context, Distribution distribution);
/**
* Triggered when a packager starts/ends/fails the preparing step.
*
* @param event event metadata.
* @param context the execution context.
* @param distribution the distribution to be processed.
* @param packager the executing packager.
*/
void onPackagerPrepareStep(ExecutionEvent event, JReleaserContext context, Distribution distribution, Packager packager);
/**
* Triggered when a packager starts/ends/fails the packaging step.
*
* @param event event metadata.
* @param context the execution context.
* @param distribution the distribution to be processed.
* @param packager the executing packager.
*/
void onPackagerPackageStep(ExecutionEvent event, JReleaserContext context, Distribution distribution, Packager packager);
/**
* Triggered when a packager starts/ends/fails the publishing step.
*
* @param event event metadata.
* @param context the execution context.
* @param distribution the distribution to be processed.
* @param packager the executing packager.
*/
void onPackagerPublishStep(ExecutionEvent event, JReleaserContext context, Distribution distribution, Packager packager);
}