Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51c85a9
commit f10b5eb
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
core/src/main/java/hudson/matrix/listeners/MatrixBuildListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package hudson.matrix.listeners; | ||
|
||
import hudson.ExtensionList; | ||
import hudson.ExtensionPoint; | ||
import hudson.matrix.MatrixConfiguration; | ||
import hudson.matrix.MatrixBuild; | ||
import hudson.model.Hudson; | ||
|
||
public abstract class MatrixBuildListener implements ExtensionPoint { | ||
|
||
/** | ||
* Determine whether to build a given configuration or not | ||
* @param b | ||
* @param c | ||
* @return | ||
*/ | ||
public boolean doBuildConfiguration(MatrixBuild b, MatrixConfiguration c){return true;} | ||
|
||
public static boolean buildConfiguration(MatrixBuild b, MatrixConfiguration c) { | ||
for (MatrixBuildListener l : all()) { | ||
if(!l.doBuildConfiguration(b, c)) { | ||
return false; | ||
} | ||
|
||
} | ||
|
||
return true; | ||
} | ||
|
||
/** | ||
* Returns all the registered {@link MatrixBuildListener} descriptors. | ||
*/ | ||
public static ExtensionList<MatrixBuildListener> all() { | ||
return Hudson.getInstance().getExtensionList(MatrixBuildListener.class); | ||
} | ||
} |