Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rename ZIP files created by tycho-p2-director-plugin

tycho-p2-director-plugin does not seem to have a way to add a version number to the final ZIP file names. it produces

myproduct-win32.win32.x86.zip
myproduct-macosx.cocoa.x86.zip
myproduct-linux.gtk.x86.zip

while I'd like to have

myproduct-1.6.0-win32.zip
myproduct-1.6.0-linux32.zip
myproduct-1.6.0-macos.zip

what's the best way? rename with maven-antrun-plugin somehow? rename with maven resources plugin? anything elese?

like image 689
Alex Avatar asked Dec 21 '11 00:12

Alex


Video Answer


1 Answers

From the bug report at https://bugs.eclipse.org/bugs/show_bug.cgi?id=357503 it seems that they've added the ability to change the filename of the zip files directly from Tycho 0.14.0. I'm using the following for my tycho-p2-director-plugin block.

<plugins>
  <plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-p2-director-plugin</artifactId>
    <version>0.16.0</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>MY_PRODUCT_ID</id>
          <archiveFileName>MyProduct-${project.version}</archiveFileName>
        </product>
      </products>
    </configuration>
  </plugin>

The key bit is in the <configuration> section at the end, where you can specify the prefix of the zip file using the <archiveFileName> tag. The suffix of the file is still -<os>.<ws>.<arch>.<archiveExtension>, as one might hope.

like image 54
Joey Coleman Avatar answered Dec 29 '22 13:12

Joey Coleman