Question

I'm an Eclipse RCP developer who is using the tycho-p2-director-plugin to build an application.

The good news is that the assembly is generated and can be run successfully. The bad news is that one of the artifacts that I expect to be generated (the .eclipseproduct file) is not being generated.

I have tried to figure out what the deal with this file is - not only that it does not generate through Tycho, but it also does not generate when I use the Eclipse product export wizard. Based upon the documentation I found here, I expect that it would be.

I'm basically wondering about two things at this point, because I can't find any good documentation on where that .eclipseproduct file is supposed to come from / at what point it is supposed to get generated.

If it is generated during the tycho maven lifecycle, then I would expect to find the file under my target folder - which it is not. I have not found a way to have tycho statically include configuration files (besides config.ini), otherwise I would have used that method to attach a static .eclipseproduct file to the root of my install directory.

If this is something that should be generated by an installer, what is the mechanism using p2 such that you can accomplish this? I've considered including the .eclipseproduct file in my main P2 IU, but I'm unclear on whether that file would actually be copied into the root directory and how exactly that would be accomplished.

As you can tell, I haven't been able to find very much direction as to how getting this file included with my build would be accomplished. Any pointers in the right direction would be helpful. I can also include my product configuration files if necessary.

Was it helpful?

Solution

This should be a comment as it's only a partial answer, but it's too long.

It seems that .eclipseproduct is a file generated at build time, and not created by p2 at provisioning time:

To find this I provisioned a copy of Eclipse 4.2 using p2 director (for instructions I used the Installing a Complete product section of this page, updating the repository to the 4.2 site instead of using the 3.6 ones, and changed from using Windows paths to ones more suited for my mac).

I noticed on the file listing that the .eclipseproduct file seemed to be an unzipped artifact instead of a generated one since the time stamp was different:

$ ls -lA
total 304
-rw-r--r--    1 myself  group      60 Sep 14 18:13 .eclipseproduct
drwxr-xr-x    3 myself  group     102 Nov  2 14:49 Eclipse.app
-rw-r--r--    1 myself  group  112366 Nov  2 14:49 artifacts.xml
...

This got me looking through the various caches in the ./p2 directory, and I found that there is an Installable Unit org.eclipse.platform_root which is a zip file containing licensing and the .eclipseproduct file...

:p2 $ zipinfo org.eclipse.equinox.p2.core/cache/binary/org.eclipse.platform_root_*
Archive:  org.eclipse.equinox.p2.core/cache/binary/org.eclipse.platform_root_4.2.1.v20120814-120134-9JF7BHVGFyMveli1uX6aTH0q-eAap6PAgOP5mO   38125   5
-rw----     2.0 fat        0 bl defN 14-Sep-12 18:13 readme/
-rw----     2.0 fat   104173 bl defN 14-Sep-12 18:13 readme/readme_eclipse.html
-rw----     2.0 fat     9051 bl defN 14-Sep-12 18:13 notice.html
-rw----     2.0 fat       60 bl defN 14-Sep-12 18:13 .eclipseproduct
-rw----     2.0 fat    16536 bl defN 14-Sep-12 18:13 epl-v10.html
5 files, 129820 bytes uncompressed, 37501 bytes compressed:  71.1%

I found the P2 IU information in the content.xml files found in the org.eclipse.equinox.p2.repository/cache/content*.jar files:

...
<unit id='org.eclipse.platform_root' version='4.2.1.v20120814-120134-9JF7BHVGFyMveli1uX6aTH0q-eAap6PAgOP5mO'>
  <provides size='1'>
    <provided namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.platform_root' version='4.2.1.v20120814-120134-9JF7BHVGFyMveli1uX6aTH0q-eAap6PAgOP5mO'/>
  </provides>
  <artifacts size='1'>
    <artifact classifier='binary' id='org.eclipse.platform_root' version='4.2.1.v20120814-120134-9JF7BHVGFyMveli1uX6aTH0q-eAap6PAgOP5mO'/>
  </artifacts>
  <touchpoint id='org.eclipse.equinox.p2.native' version='1.0.0'/>
  <touchpointData size='1'>
    <instructions size='2'>
      <instruction key='install'>
        unzip(source:@artifact, target:${installFolder});
      </instruction>
      <instruction key='uninstall'>
        cleanupzip(source:@artifact, target:${installFolder});
      </instruction>
    </instructions>
  </touchpointData>
</unit>
...

In short: when this IU is installed (as required by org.eclipse.platform.feature.group), p2 simply unzips the artifact with .eclipseproduct to the install folder. No transformations required. Therefore it must be generated before install time.

Edit: I also found it in the Eclipse Git Repositories but haven't figured out if this is the one that is turned into the IU mentioned above or not...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top