Bug 511589 - Doc bundles should have indexes generated at build time

In o.e.dltk.sh.doc:
* Add index to toc extension point
* Use tycho-eclipserun-plugin to generate the index at build time

Change-Id: I61c5d68355ee32457b390c62f3c1b13e08aebf4a
Signed-off-by: Mat Booth <mat.booth@redhat.com>
diff --git a/.gitignore b/.gitignore
index fb60f67..f40522b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 bin/
 target/
+index/
diff --git a/plugins/org.eclipse.dltk.sh.doc/build.properties b/plugins/org.eclipse.dltk.sh.doc/build.properties
index d13d95c..e2971a5 100644
--- a/plugins/org.eclipse.dltk.sh.doc/build.properties
+++ b/plugins/org.eclipse.dltk.sh.doc/build.properties
@@ -1,6 +1,6 @@
 bin.includes = plugin.xml,\
                META-INF/,\
                userguide/,\
-               *.xml,\
-               build.properties,\
-               about.html
+               index/,\
+               about.html,\
+               build.xml
diff --git a/plugins/org.eclipse.dltk.sh.doc/build.xml b/plugins/org.eclipse.dltk.sh.doc/build.xml
new file mode 100644
index 0000000..52abed2
--- /dev/null
+++ b/plugins/org.eclipse.dltk.sh.doc/build.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="Build Help Indexes" default="build.index" basedir=".">
+	<target name="build.index" if="eclipse.running">
+		<help.buildHelpIndex manifest="plugin.xml" destination="." />
+	</target>
+</project>
diff --git a/plugins/org.eclipse.dltk.sh.doc/plugin.xml b/plugins/org.eclipse.dltk.sh.doc/plugin.xml
index 0103ff0..e2bf1aa 100644
--- a/plugins/org.eclipse.dltk.sh.doc/plugin.xml
+++ b/plugins/org.eclipse.dltk.sh.doc/plugin.xml
@@ -8,6 +8,9 @@
             file="userguide/Introduction-toc.xml"
             primary="true">
       </toc>
+      <index
+            path="index">
+      </index>
    </extension>
 
 </plugin>
diff --git a/plugins/org.eclipse.dltk.sh.doc/pom.xml b/plugins/org.eclipse.dltk.sh.doc/pom.xml
index 7aceed6..0a7f46f 100644
--- a/plugins/org.eclipse.dltk.sh.doc/pom.xml
+++ b/plugins/org.eclipse.dltk.sh.doc/pom.xml
@@ -11,18 +11,70 @@
        Red Hat Incorporated - initial implementation
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
 
-  <parent>
-    <groupId>org.eclipse.dltk.sh</groupId>
-    <artifactId>parent</artifactId>
-    <version>5.7.1-SNAPSHOT</version>
-    <relativePath>../..</relativePath>
-  </parent>
+	<parent>
+		<groupId>org.eclipse.dltk.sh</groupId>
+		<artifactId>parent</artifactId>
+		<version>5.7.1-SNAPSHOT</version>
+		<relativePath>../..</relativePath>
+	</parent>
 
-  <artifactId>org.eclipse.dltk.sh.doc</artifactId>
-  <packaging>eclipse-plugin</packaging>
+	<artifactId>org.eclipse.dltk.sh.doc</artifactId>
+	<packaging>eclipse-plugin</packaging>
 
-  <name>ShellEd Doc plugin</name>
+	<name>ShellEd Documentation Plug-in</name>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.eclipse.tycho.extras</groupId>
+				<artifactId>tycho-eclipserun-plugin</artifactId>
+				<version>${tycho-version}</version>
+				<executions>
+					<execution>
+						<id>build_indexes</id>
+						<phase>compile</phase>
+						<goals>
+							<goal>eclipse-run</goal>
+						</goals>
+						<configuration>
+							<repositories>
+								<repository>
+									<id>eclipse</id>
+									<layout>p2</layout>
+									<url>${eclipserun-repo}</url>
+								</repository>
+							</repositories>
+							<applicationsArgs>
+								<args>-consolelog</args>
+								<args>-application</args>
+								<args>org.eclipse.ant.core.antRunner</args>
+								<args>-data</args>
+								<args>${project.build.directory}/workspace</args>
+								<args>-quiet</args>
+								<args>-buildfile</args>
+								<args>build.xml</args>
+							</applicationsArgs>
+							<dependencies>
+								<dependency>
+									<artifactId>org.eclipse.ant.core</artifactId>
+									<type>eclipse-plugin</type>
+								</dependency>
+								<dependency>
+									<artifactId>org.apache.ant</artifactId>
+									<type>eclipse-plugin</type>
+								</dependency>
+								<dependency>
+									<artifactId>org.eclipse.help.base</artifactId>
+									<type>eclipse-plugin</type>
+								</dependency>
+							</dependencies>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
 </project>