aQute.bnd.ant.ReleaseTask Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bnd Show documentation
Show all versions of bnd Show documentation
A command line utility and Ant plugin to wrap, build, or examine bundles.
package aQute.bnd.ant;
import org.apache.tools.ant.*;
import aQute.bnd.build.*;
import aQute.bnd.build.Project;
/**
*
* ANT task to release into a repository, equivalent to:
* <bnd command="release"/>
*
*
* To release into the default repository (defined by
* -releaserepo
in build.bnd
):
*
*
*
* <bndrelease/>
*
*
* To release into a specific named repository:
*
*
* <bndrelease releaserepo="My Repository"/>
*
*
* @author Neil Bartlett
* @see {@link BndTask} for setup instructions.
*/
public class ReleaseTask extends BaseTask {
String releaseRepo = null;
@Override
public void execute() throws BuildException {
try {
Project project = Workspace.getProject(getProject().getBaseDir());
if (releaseRepo == null) {
project.release(false);
} else {
project.release(releaseRepo);
}
if (report(project))
throw new BuildException("Release failed");
}
catch (Exception e) {
e.printStackTrace();
throw new BuildException(e);
}
}
public void setReleaserepo(String releaseRepo) {
this.releaseRepo = releaseRepo;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy