Search in sources :

Example 1 with IReleaseParticipant

use of bndtools.release.api.IReleaseParticipant in project bndtools by bndtools.

the class Activator method getReleaseParticipants.

public static List<IReleaseParticipant> getReleaseParticipants() {
    //$NON-NLS-1$
    IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(PLUGIN_ID, "bndtoolsReleaseParticipant");
    if (elements.length == 0) {
        return Collections.emptyList();
    }
    List<IReleaseParticipant> participants = new ArrayList<IReleaseParticipant>();
    for (IConfigurationElement element : elements) {
        try {
            //$NON-NLS-1$
            IReleaseParticipant participant = (IReleaseParticipant) element.createExecutableExtension("class");
            //$NON-NLS-1$
            String strRanking = element.getAttribute("ranking");
            int ranking = 0;
            if (strRanking != null && strRanking.length() > 0) {
                ranking = Integer.parseInt(strRanking);
            }
            participant.setRanking(ranking);
            participants.add(participant);
        } catch (CoreException e) {
            logError(Messages.errorExecutingStartupParticipant, e);
        }
    }
    return participants;
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) IReleaseParticipant(bndtools.release.api.IReleaseParticipant) ArrayList(java.util.ArrayList) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement)

Example 2 with IReleaseParticipant

use of bndtools.release.api.IReleaseParticipant in project bndtools by bndtools.

the class ReleaseHelper method postRelease.

private static void postRelease(ReleaseContext context, List<IReleaseParticipant> participants, boolean success) {
    context.setCurrentScope(Scope.POST_RELEASE);
    for (IReleaseParticipant participant : participants) {
        participant.postRelease(context, success);
    }
    context.close();
}
Also used : IReleaseParticipant(bndtools.release.api.IReleaseParticipant)

Aggregations

IReleaseParticipant (bndtools.release.api.IReleaseParticipant)2 ArrayList (java.util.ArrayList)1 CoreException (org.eclipse.core.runtime.CoreException)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1