use of org.eclipse.tycho.model.UpdateSite in project tycho by eclipse.
the class SiteXmlManipulator method writeMetadata.
@Override
public void writeMetadata(ProjectMetadata project) throws IOException {
File basedir = project.getBasedir();
UpdateSite site = project.getMetadata(UpdateSite.class);
if (site != null) {
UpdateSite.write(site, new File(basedir, UpdateSite.SITE_XML));
}
}
use of org.eclipse.tycho.model.UpdateSite in project tycho by eclipse.
the class ExpandReleaseVersionTest method test.
@Test
public void test() throws Exception {
Verifier verifier = getVerifier("/TYCHO0453expandReleaseVersion", false);
verifier.executeGoal("integration-test");
verifier.verifyErrorFreeLog();
File featureXml = new File(verifier.getBasedir(), "feature/target/feature.xml");
Feature feature = Feature.read(featureXml);
Assert.assertEquals("1.0.0.1234567890-bundle", feature.getPlugins().get(0).getVersion());
// TODO included features
File siteXml = new File(verifier.getBasedir(), "site/target/site/site.xml");
UpdateSite site = UpdateSite.read(siteXml);
Assert.assertEquals("1.0.0.1234567890-feature", site.getFeatures().get(0).getVersion());
// TODO .product version expansion
}
use of org.eclipse.tycho.model.UpdateSite in project tycho by eclipse.
the class GeneratePomsMojo method getSiteFeaturesAndPlugins.
private Set<File> getSiteFeaturesAndPlugins(File basedir) throws MojoExecutionException {
try {
Set<File> result = new LinkedHashSet<>();
UpdateSite site;
File siteFile = new File(basedir, "site.xml");
if (siteFile.exists()) {
site = UpdateSite.read(siteFile);
for (FeatureRef feature : site.getFeatures()) {
addFeature(result, feature.getId());
}
}
return result;
} catch (Exception e) {
throw new MojoExecutionException("Could not collect update site features and plugins", e);
}
}
Aggregations