Maven Tycho: How to Exclude eclipsec.exe in a product build?
Asked Answered
P

2

5

I switched the build of our Eclipse RCP product from PDE-build to Maven Tycho. In addition to the main (branded) launcher executable, the product now includes the "eclipsec.exe" file. We would like to omit this console-based launcher from our product as it might confuse our customers. Is there a way to do that with Tycho?

Pentha answered 6/8, 2012 at 14:0 Comment(0)
P
13

I got this answer on the tycho-users list:

In your eclipse-repository project, assuming that you have a .product file, you can place another file in the same directory called .p2.inf

For the contents of your p2.inf file you can put a p2 touchpoint to remove the file:

instructions.configure=org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/eclipsec.exe);

Pentha answered 7/8, 2012 at 15:4 Comment(0)
B
2

I don't know how to solve with tycho directly, but you can achieve this with the maven-antrun-plugin. There's a little trick to get the deletion of the eclipsec.exe on the timely position. You have to put the delete step between materialize and the archive goal of the p2-director-plugin. I put the delete step on the phase pre-integration-test and moved the archive step to the phase integration-test.

<plugin>
      <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>delete-eclipsec.exe</id>
            <phase>pre-integration-test</phase>
            <configuration>
              <target>
                <delete file="${project.build.directory}/products/<<your.product.id>>/win32/win32/x86/eclipsec.exe"/>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <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>
            <phase>integration-test</phase>
            <goals>
              <goal>archive-products</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

The result: No eclipsec.exe in the product.zip.
Hope that helps.

Bazar answered 7/8, 2012 at 7:34 Comment(1)
Good idea! Of course, the build now needs to call "mvn integration-test" instead of "mvn package". Though I need to do that anyway, since plugin-tests are bound to the integration-test phase as well. But I ended up using a p2.inf file as suggested on the mailing list. Too bad I can't accept both answers!Overexcite

© 2022 - 2024 — McMap. All rights reserved.