How can I get tycho materialize-product and archive-product to use the directory prefix for my RCP application archive file

How to add a prefix directory so that when unpacking the zip containing my RCP application, I get a directory containing the contents?

When tycho supports and archives my rcp application, it zips up the target / products / my.rcp.app / linux / gtk / x86_64 / files without a directory prefix.

Current zip content:

  • ./functions
  • ./ plugins
  • ...

Desired zip content:

  • ./MYAPP/functions
  • ./MyApp/ plugins
  • ...

When the user unpacks the zip, I would like to create an application directory. I looked at tycho files, but neither archiving nor materialization seems to be the right place to configure it. I could always use antrun or the build plugin to do the job, but that doesn't seem like the right maven way to solve the problem.

Please let me know how to add a prefix directory.

+4
source share
2 answers

The configuration is really a bit messed up and not really documented . Since you (currently) can have multiple product files in one eclipse-repository module, you need to select the product identifier for which you want to apply the configuration.

So, to set the root archive folder for the product with the identifier product.id , you need the following configuration:

 <build> <plugins> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-p2-director-plugin</artifactId> <version>${tycho-version}</version> <executions> <execution> <id>materialize-products</id> <goals> <goal>materialize-products</goal> </goals> </execution> <execution> <id>archive-products</id> <goals> <goal>archive-products</goal> </goals> </execution> </executions> <configuration> <products> <product> <id>product.id</id> <rootFolder>myapp</rootFolder> </product> </products> </configuration> </plugin> </plugins> </build> 
+6
source

Thanks, but I needed to use the rootFolder parameter to add an extra directory. I tried to insert the achivePrefix file into the .product file, but that did not work. I finally broke down, grabbed the tycho source and worked back to find the rootFolder. After this journey, I saw it in the document and understood its meaning.

Doc: http://wiki.eclipse.org/Tycho/Packaging_Types#Creating_Product_Zip_Files

Related: https://issues.sonatype.org/browse/TYCHO-507

  <plugins> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-p2-director-plugin</artifactId> <version>${tycho-version}</version> <configuration> <products> <product> <id>match-product-uid-field-from-foo.product-file</id> <rootFolder>workbench</rootFolder> </product> </products> </configuration> <executions> <execution> <!-- install the product using the p2 director --> <id>materialize-products</id> <goals> <goal>materialize-products</goal> </goals> </execution> <execution> <!-- create zip file with the installed product --> <id>archive-products</id> <goals> <goal>archive-products</goal> </goals> <configuration> <formats> <linux>tar.gz</linux> <win32>zip</win32> </formats> </configuration> </execution> </executions> </plugin> 
0
source

Source: https://habr.com/ru/post/1498254/


All Articles