use of org.eclipse.tycho.versions.engine.VersionsEngine in project unleash-maven-plugin by shillner.
the class AbstractTychoVersionsStep method execute.
@Override
public void execute(ExecutionContext context) throws MojoExecutionException, MojoFailureException {
this.cachedPOMs = Maps.newHashMap();
this.cachedModuleVersions = Maps.newHashMap();
VersionsEngine versionsEngine = initializeVersionsEngine();
try {
for (MavenProject module : this.reactorProjects) {
ArtifactCoordinates coordinates = ProjectToCoordinates.EMPTY_VERSION.apply(module);
Optional<Document> parsedPOM = PomUtil.parsePOM(this.project);
if (parsedPOM.isPresent()) {
this.cachedPOMs.put(coordinates, parsedPOM.get());
}
this.cachedModuleVersions.put(coordinates, module.getVersion());
Map<ReleasePhase, ArtifactCoordinates> coordinatesByPhase = this.metadata.getArtifactCoordinatesByPhase(module.getGroupId(), module.getArtifactId());
String version = coordinatesByPhase.get(currentReleasePhase()).getVersion();
versionsEngine.addVersionChange(module.getArtifactId(), version);
if (module.getModel().getVersion() != null) {
module.getModel().setVersion(version);
}
}
versionsEngine.apply();
adaptProjectMetadataWithNewVersions();
} catch (IOException e) {
throw new MojoExecutionException("Error during tycho version upgrade.", e);
}
}
use of org.eclipse.tycho.versions.engine.VersionsEngine in project tycho by eclipse.
the class VersionsEngineTest method testAggregator.
public void testAggregator() throws Exception {
File basedir = TestUtil.getBasedir("projects/aggregator");
VersionsEngine engine = newEngine(basedir);
engine.addVersionChange("aggregator", "1.0.1.qualifier");
engine.addVersionChange("parent", "1.0.1.qualifier");
engine.apply();
assertPom(basedir);
assertPom(new File(basedir, "parent"));
assertPom(new File(basedir, "bundle"));
assertBundleManifest(new File(basedir, "bundle"));
assertPom(new File(basedir, "detached"));
assertBundleManifest(new File(basedir, "detached"));
}
use of org.eclipse.tycho.versions.engine.VersionsEngine in project tycho by eclipse.
the class VersionsEngineTest method testExplicitVersion.
public void testExplicitVersion() throws Exception {
File basedir = TestUtil.getBasedir("projects/exlicitversion");
VersionsEngine engine = newEngine(basedir);
engine.addVersionChange("parent", "1.0.1.qualifier");
engine.apply();
assertPom(basedir);
assertPom(new File(basedir, "otherversion"));
assertBundleManifest(new File(basedir, "otherversion"));
assertPom(new File(basedir, "sameversion"));
assertBundleManifest(new File(basedir, "sameversion"));
}
use of org.eclipse.tycho.versions.engine.VersionsEngine in project tycho by eclipse.
the class VersionsEngineTest method testDependencySimple.
public void testDependencySimple() throws Exception {
File basedir = TestUtil.getBasedir("projects/dependencysimple");
VersionsEngine engine = newEngine(basedir);
engine.addVersionChange("someproject", "1.0.1.qualifier");
engine.apply();
assertPom(basedir);
assertPom(new File(basedir, "bundle"));
assertBundleManifest(new File(basedir, "bundle"));
assertPom(new File(basedir, "someproject"));
}
use of org.eclipse.tycho.versions.engine.VersionsEngine in project tycho by eclipse.
the class VersionsEngineTest method testDependencyManagmentOtherVersion.
public void testDependencyManagmentOtherVersion() throws Exception {
File basedir = TestUtil.getBasedir("projects/dependencymanagementotherversion");
VersionsEngine engine = newEngine(basedir);
engine.addVersionChange("someproject", "1.0.1.qualifier");
engine.apply();
assertPom(basedir);
assertPom(new File(basedir, "bundle"));
assertBundleManifest(new File(basedir, "bundle"));
assertPom(new File(basedir, "someproject"));
}
Aggregations