Wednesday, July 18, 2012

Pre-indexing documentation with tycho

Older Eclipses had this irritating feature of indexing help on first access. I think that many of you remember that :-). The issue has been fixed in Eclipse 3.1. Wait. Actually only the mechanism to do the indexing at build time was delivered, and all content providers should have used it.

The indexing at build time was usually achieved by two steps:
1. Declare an extension saying where your index will be created:
<extension point="">
   <index path="index">

2. Ensure that the index is actually built via customBuildCallbacks.xml
<project name="Build specific targets and properties" default="noDefault">
    <target name="">
        <help.buildHelpIndex manifest="plugin.xml" destination="."/>
The problem with the customBuildCallbacks is that it allows for to much creativity, which is nearly as desired in build systems as in accountancy :). Thus it should not be used. So, the question is, how to make it work with maven? I wish the answer was simple, but I have no other choice then present it in the most brutal form of xml:
            <!-- this is actually present in any 0.14+ version -->
                <!-- this is to fix some lucene 3.x compatibility issue -->
                <!-- actuall indexer call -->
		<appArgLine>-application org.eclipse.ant.core.antRunner -buildfile customBuildCallbacks.xml build.index</appArgLine>
                    <!-- list of bundles that we need -->
It should be read as: assemble an eclipse with org.apache.core,org.eclipse.ant.core, and all required dependencies, and then invoke the indexer. I hope this will be useful to someone during migration to tycho :-). Best regards Sources: Eclipse Help and Tycho wiki.


  1. There is a little typo - the antRunner target should be the same as the target name in the customBuildCallbacks.xml i.e. rather than build.index

    1. Thanks for the comment. This is intentional - although may be questioned. The point is to call as little from customBuildCallbacks as possible. In the original I had direct call to the indexer without the xml at all, but that would be to much hardcore...