use of org.eclipse.tycho.model.FeatureRef 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);
}
}
use of org.eclipse.tycho.model.FeatureRef in project tycho by eclipse.
the class FeatureXmlTransformer method expandReferences.
/**
* Replaces references in the feature model with versions from the target platform.
*
* @param feature
* The feature model to have plug-in and feature references completed.
*/
public Feature expandReferences(Feature feature, TargetPlatform targetPlatform) throws MojoFailureException {
for (PluginRef pluginRef : feature.getPlugins()) {
ArtifactKey plugin = resolvePluginReference(targetPlatform, pluginRef);
pluginRef.setVersion(plugin.getVersion());
File location = targetPlatform.getArtifactLocation(plugin);
setDownloadAndInstallSize(pluginRef, location);
}
for (FeatureRef featureRef : feature.getIncludedFeatures()) {
ArtifactKey includedFeature = resolveFeatureReference(targetPlatform, featureRef);
featureRef.setVersion(includedFeature.getVersion());
}
return feature;
}
Aggregations