Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] Logic in Manipulators of tycho-versions-plugin

Hello everybody,

 

I am trying to use the tycho-versions-plugin to increase version numbers in all pom.xml, feature.xml, MANIFEST.MF, and *.product files in a project structure as follows:

 

- trunk (pom.xml)

|-- feature-project (packaging type “eclipse-feature”)

      |-- feature.xml

      |-- build.properties

      |-- pom.xml

|-- product-project (packaging type “eclipse-repository”)

      |-- myproduct.product

      |-- pom.xml

|-- bundle-project (packaging type “eclipse-plugin”)

      |-- MANIFEST-INF

            |-- MANIFEST.MF

      |-- pom.xml

 

Is there a particular reason for the org.eclipse.tycho.versions.manipulation.FeatureXmlManipulator and org.eclipse.tycho.versions.manipulation.ProductFileManipulator implementation to NOT update my feature.xml and myproduct.product files in some cases:

 

-          org.eclipse.tycho.versions.manipulation.FeatureXmlManipulator only updates the feature.xml, if my reactor project (the pom.xml in the trunk) is of packaging type “eclipse-feature” or “eclipse-plugin”:

 

public void applyChange(ProjectMetadata project, VersionChange change, Set<VersionChange> allChanges) {

        if (isFeature(project)) {

            Feature feature = getFeatureXml(project);

            if (isFeature(change.getProject().getPackaging())) {

if (change.getArtifactId().equals(feature.getId()) && change.getVersion().equals(feature.getVersion())) {

                    logger.info("  feature.xml//feature/@version: " + change.getVersion() + " => "

                            + change.getNewVersion());

                    feature.setVersion(change.getNewVersion());

                }

                // could be included feature

                changeIncludedFeatures(change, feature);

            } else if (isBundle(change.getProject())) {

                changeIncludedPlugins(change, feature);

            }

        }

}

 

-          org.eclipse.tycho.versions.manipulation.ProductFileManipulator only updates the myproduct.product file if my reactor project (pom.xml in the trunk) shares the same artifactId (which will never happen, right?) or is of packaging type “eclipse-feature” or “eclipse-plugin”:

 

protected void applyChangeToProduct(ProjectMetadata project, ProductConfiguration product, String productFileName, VersionChange change) {

 

        if (isSameProject(project, change.getProject())) {

            // in eclipse-repository, change.getArtifactId() doesn't have to match product.getId()

            if (change.getVersion().equals(product.getVersion())) {

                logger.info("  " + productFileName + "//product/@version: " + change.getVersion() + " => "

                        + change.getNewVersion());

                product.setVersion(change.getNewVersion());

            }

        } else if (isBundle(change.getProject())) {

            for (PluginRef plugin : product.getPlugins()) {

if (change.getArtifactId().equals(plugin.getId()) &&    change.getVersion().equals(plugin.getVersion())) {

                    logger.info("  " + productFileName + "//product/plugins/plugin/@id=" + plugin.getId()

                            + "/@version: " + change.getVersion() + " => " + change.getNewVersion());

                    plugin.setVersion(change.getNewVersion());

                }

            }

        } else if (isFeature(change.getProject().getPackaging())) {

            for (FeatureRef feature : product.getFeatures()) {

if (change.getArtifactId().equals(feature.getId()) && change.getVersion().equals(feature.getVersion())) {

                    logger.info("  " + productFileName + "//product/features/feature/@id=" + feature.getId()

                            + "/@version: " + change.getVersion() + " => " + change.getNewVersion());

                    feature.setVersion(change.getNewVersion());

                }

            }

        }

}

 

I do not fully understand why these checks are implemented that way. Is my project structure invalid? Am I trying to do something weird in the sense of Maven/Tycho?

 

Looking forward to your responses.

 

Regards

Timo Rohrberg



Hinweis: Diese Email enthält evtl. vertrauliche und rechtlich geschützte
Informationen. Sollten Sie nicht der richtige Adressat sein oder diese
Email irrtümlich erhalten haben, informieren Sie bitte sofort den Absender,
und löschen Sie anschließend diese E-Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe des Inhalts dieser Email sind nicht gestattet.

Attention: This e-mail may contain confidential and/or privileged
information. If you are not the intended recipient or if you have received
this e-mail in error, please notify the sender immediately and delete this
e-mail. Any unauthorized copying, disclosure or distribution of the
contents of this e-mail is strictly prohibited.

Back to the top