Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyPlugin implements Plugin {
- @Override
- public void define(Context context) {
- context.addExtension(MyPostAnalysisTask.class);
- }
- }
- public class MyPostAnalysisTask implements PostProjectAnalysisTask, Sensor {
- private String param = "";
- @Override
- public void describe(SensorDescriptor descriptor) {
- descriptor.name(getClass().getName());
- }
- @Override
- public void execute(SensorContext context) {
- // Get command line param.
- Optional<String> param = context.config().get('my.param.name');
- if (param.isPresent()) {
- this.param = param.get();
- }
- }
- @Override
- public void finished(final ProjectAnalysis analysis) {
- if (!this.param.isEmpty()) {
- // Perform custom post analysis task.
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement