Search in sources :

Example 6 with UpdateSite

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));
    }
}
Also used : PomFile(org.eclipse.tycho.versions.pom.PomFile) File(java.io.File) UpdateSite(org.eclipse.tycho.model.UpdateSite)

Example 7 with UpdateSite

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
}
Also used : Verifier(org.apache.maven.it.Verifier) File(java.io.File) Feature(org.eclipse.tycho.model.Feature) UpdateSite(org.eclipse.tycho.model.UpdateSite) Test(org.junit.Test) AbstractTychoIntegrationTest(org.eclipse.tycho.test.AbstractTychoIntegrationTest)

Example 8 with UpdateSite

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);
    }
}
Also used : LinkedHashSet(java.util.LinkedHashSet) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) FeatureRef(org.eclipse.tycho.model.FeatureRef) File(java.io.File) UpdateSite(org.eclipse.tycho.model.UpdateSite) BundleException(org.osgi.framework.BundleException) XmlPullParserException(org.codehaus.plexus.util.xml.pull.XmlPullParserException) IOException(java.io.IOException) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) MojoFailureException(org.apache.maven.plugin.MojoFailureException)

Aggregations

UpdateSite (org.eclipse.tycho.model.UpdateSite)8 File (java.io.File)7 IOException (java.io.IOException)3 FeatureRef (org.eclipse.tycho.model.FeatureRef)3 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)2 MojoFailureException (org.apache.maven.plugin.MojoFailureException)2 ReactorProject (org.eclipse.tycho.ReactorProject)2 ArtifactDependencyVisitor (org.eclipse.tycho.core.ArtifactDependencyVisitor)2 Feature (org.eclipse.tycho.model.Feature)2 SiteFeatureRef (org.eclipse.tycho.model.UpdateSite.SiteFeatureRef)2 PomFile (org.eclipse.tycho.versions.pom.PomFile)2 LinkedHashSet (java.util.LinkedHashSet)1 Verifier (org.apache.maven.it.Verifier)1 XmlPullParserException (org.codehaus.plexus.util.xml.pull.XmlPullParserException)1 ArtifactDescriptor (org.eclipse.tycho.ArtifactDescriptor)1 ArtifactKey (org.eclipse.tycho.ArtifactKey)1 DependencyArtifacts (org.eclipse.tycho.artifacts.DependencyArtifacts)1 ClasspathEntry (org.eclipse.tycho.classpath.ClasspathEntry)1 ArtifactDependencyWalker (org.eclipse.tycho.core.ArtifactDependencyWalker)1 FeatureDescription (org.eclipse.tycho.core.FeatureDescription)1