Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] Tycho cannot find p2 advice file during product materialization

Title: Tycho cannot find p2 advice file during product materialization

Hi All,

Im attempting to associate a p2 advice file with my product definition as described on the wiki [1].  My product definition file is named “com.utc.pw.ome.idds.product.workbench.product”, thus I named my p2 advice file “com.utc.pw.ome.idds.product.workbench.p2.inf.  However, Tycho doesnt appear to copy the p2.inf file to the appropriate location under target/products for it to be processed by the p2 director.

Looking through the code, I found the relevant bit that computes the name of the products p2 advice file in o.e.t.plugins.p2.publisher.PublishProductMojo.getSourceP2InfFile() [2]:

        // This must match org.eclipse.tycho.p2.impl.publisher.ProductDependenciesAction.addPublisherAdvice(IPublisherInfo)

        final int indexOfExtension = productFile.getName().indexOf(".product");

        final String p2infFilename = productFile.getName().substring(0, indexOfExtension) + ".p2.inf";

        return new File(productFile.getParentFile(), p2infFilename);

It appears the problem is that my product definition file uses .product in the base name, as well as using it as the extension.  Thus, the above code finds the first occurrence of .product and expects a p2 advice file named com.utc.pw.ome.idds.p2.inf.  I verified that renaming my p2 advice file to this value causes the build to behave as expected.

Obviously, my problem could be solved by replacing indexOf() with lastIndexOf() in the above code (and in ProductDependenciesAction.addPublisherAdvice) Before I submit a change request, I just wanted to verify that this is a legitimate defect and not that Im violating some product naming convention of which Im unfamiliar.

Thanks,

Steve

[1] http://wiki.eclipse.org/Tycho/Packaging_Types#eclipse-repository

[2] http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-p2/tycho-p2-publisher-plugin/src/main/java/org/eclipse/tycho/plugins/p2/publisher/PublishProductMojo.java


Back to the top