Index: /release-kits/wirk3/ant-scripts/build.xml
===================================================================
--- /release-kits/wirk3/ant-scripts/build.xml	(revision 19980)
+++ /release-kits/wirk3/ant-scripts/build.xml	(revision 19981)
@@ -28,5 +28,4 @@
 	<import file="compile.xml"/>
 	<import file="create-distribution.xml"/>
-	<import file="create-components.xml"/>
 	<import file="create-installer.xml"/>
 	<import file="wrap.xml"/>
@@ -36,5 +35,5 @@
 		<antcall target="compile"/>
 		<antcall target="create-distribution"/>
-		<antcall target="create-components"/>
+		<ant dir="." antfile="${lirk3.home}/ant-scripts/create-components.xml" target="create-components"/>
 		<antcall target="create-installer"/>
 		<antcall target="wrap"/>
Index: /release-kits/wirk3/ant-scripts/create-components.xml
===================================================================
--- /release-kits/wirk3/ant-scripts/create-components.xml	(revision 19980)
+++ /release-kits/wirk3/ant-scripts/create-components.xml	(revision 19981)
@@ -2,7 +2,9 @@
 <project name="wirk3-create-components" default="create-components">
 
+       <import file="${basedir}/distributions/web/resources/xml/components.xml"/>
+       <import file="${rk.home}/greenstone3/ant-scripts/rk3-targets.xml"/>
+
 	<!-- create components from the distributions folder -->
 
-	<!-- 1st level -->
 	<target name="create-components">
 		<antcall target="prepare-components" />
@@ -10,158 +12,19 @@
 	</target>
 
-	<!-- 2nd level -->
 	<target name="prepare-components">
-		<antcall target="prepare-core-component" />
-		<antcall target="prepare-imagemagick-component" />
-		<antcall target="prepare-ghostscript-component" />
-		<antcall target="prepare-ant-component" />
-		<antcall target="prepare-tomcat-component" />
+		<antcall target="prepare-component"><param name="component" value="core"/></antcall>
+		<antcall target="prepare-component"><param name="component" value="ant"/></antcall>
+		<antcall target="prepare-component"><param name="component" value="tomcat"/></antcall>
+		<antcall target="prepare-component"><param name="component" value="imagemagick"/></antcall>
+		<antcall target="prepare-component"><param name="component" value="ghostscript"/></antcall>
+	</target>
 
-	</target>
-	
 	<target name="compress-components">
-		<antcall target="compress-core-component" />
-		<antcall target="compress-imagemagick-component" />
-		<antcall target="compress-ghostscript-component" />
-		<antcall target="compress-ant-component" />
-		<antcall target="compress-tomcat-component" />
-	</target>
-	
-	<!-- 3rd level -->
-	<target name="prepare-core-component">
-
-		<!-- delete old stuff to create new components -->
-		<delete dir="components/tmp/core" quiet="true"/>
-		<mkdir dir="components/tmp/core"/>
-				
-		<copy todir="components/tmp/core" overwrite="true">
-			<fileset dir="distributions/web">
-				<include name="**/*"/>
-
-				<!-- exclude ghostscript -->
-				<exclude name="gs2build/bin/windows/ghostscript/**/*"/>
-				<exclude name="gs2build/bin/windows/ghostscript"/>
-
-				<!-- exclude imagemagick -->
-				<exclude name="gs2build/bin/windows/imagemagick/**/*"/>
-				<exclude name="gs2build/bin/windows/imagemagick"/>
-
-				<!-- exclude sourcecode -->
-				<exclude name="src/**/*"/>
-				<exclude name="src"/>
-				<exclude name="gs2build/common-src/**/*"/>
-				<exclude name="gs2build/common-src"/>
-				<exclude name="gs2build/build-src/**/*"/>
-				<exclude name="gs2build/build-src"/>
-				<exclude name="gs2build/runtime-src/**/*"/>
-				<exclude name="gs2build/runtime-src"/>
-				
-				<!-- exclude ant -->
-				<exclude name="packages/ant/**/*"/>
-				<exclude name="packages/ant"/>
-
-				<!-- exclude tomcat -->
-				<exclude name="packages/tomcat/**/*"/>
-				<exclude name="packages/tomcat"/>
-
-			</fileset>
-		</copy>
-				
-		<zip destfile="components/core.comp" basedir="components/tmp/core" compress="false" />
-	</target>
-	
-	
-	<target name="compress-core-component">
-		<exec executable="${wirk3.home}/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 core.lzma core.comp"/></exec>
-	</target>
-	
-	
-	
-	<target name="prepare-imagemagick-component">
-		<delete dir="components/tmp/imagemagick" quiet="true"/>
-		<mkdir dir="components/tmp/imagemagick"/>
-		<copy todir="components/tmp/imagemagick" overwrite="true">
-			<fileset dir="distributions/web">
-				<include name="gs2build/bin/windows/imagemagick/**/*"/>
-			</fileset>
-		</copy>
-		
-		<zip destfile="components/imagemagick.comp" basedir="components/tmp/imagemagick" compress="false" />
-	</target>
-		
-	<target name="compress-imagemagick-component">
-		<exec executable="${wirk3.home}/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 imagemagick.lzma imagemagick.comp"/></exec>
-	</target>
-	
-	
-	
-	<target name="prepare-ghostscript-component">
-		<delete dir="components/tmp/ghostscript" quiet="true"/>
-		<mkdir dir="components/tmp/ghostscript"/>
-		<copy todir="components/tmp/ghostscript" overwrite="true">
-			<fileset dir="distributions/web">
-				<include name="gs2build/bin/windows/ghostscript/**/*"/>
-			</fileset>
-		</copy>
-		
-		<zip destfile="components/ghostscript.comp" basedir="components/tmp/ghostscript" compress="false" />
-	</target>
-		
-	<target name="compress-ghostscript-component">
-		<exec executable="${wirk3.home}/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 ghostscript.lzma ghostscript.comp"/></exec>
-	</target>
-	
-	<target name="prepare-sourcecode-component">
-		<delete dir="components/tmp/sourcecode" quiet="true"/>
-		<mkdir dir="components/tmp/sourcecode"/>
-		<copy todir="components/tmp/sourcecode" overwrite="true">
-			<fileset dir="distributions/web">
-				<include name="src/**/*"/>
-				<include name="gs2build/common-src/**/*"/>
-				<include name="gs2build/build-src/**/*"/>
-				<include name="gs2build/runtime-src/**/*"/>
-			</fileset>
-		</copy>
-
-		<mkdir dir="products"/>
-		<zip destfile="products/Greenstone-${version}-${os.suffix}-sourcecode-component.zip" basedir="components/tmp/sourcecode" compress="true"/>
-	</target>
-		
-	<target name="compress-sourcecode-component">
-		<exec executable="${wirk3.home}/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 sourcecode.lzma sourcecode.comp"/></exec>
-	</target>
-	
-	<target name="prepare-ant-component">
-		<delete dir="components/tmp/ant" quiet="true"/>
-		<mkdir dir="components/tmp/ant"/>
-
-		<copy todir="components/tmp/ant" overwrite="true">
-			<fileset dir="distributions/web">
-				<include name="packages/ant/**/*"/>
-			</fileset>
-		</copy>
-		
-		<zip destfile="components/ant.comp" basedir="components/tmp/ant" compress="false" />
-	</target>
-		
-	<target name="compress-ant-component">
-		<exec executable="${wirk3.home}/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 ant.lzma ant.comp"/></exec>
-	</target>
-		
-	<target name="prepare-tomcat-component">
-		<delete dir="components/tmp/tomcat" quiet="true"/>
-		<mkdir dir="components/tmp/tomcat"/>
-		<copy todir="components/tmp/tomcat" overwrite="true">
-			<fileset dir="distributions/web">
-				<include name="packages/tomcat/**/*"/>
-			</fileset>
-		</copy>
-		
-		<zip destfile="components/tomcat.comp" basedir="components/tmp/tomcat" compress="false" />
-	</target>
-		
-	<target name="compress-tomcat-component">
-		<exec executable="${wirk3.home}/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 tomcat.lzma tomcat.comp"/></exec>
-	</target>	
+                <antcall target="compress-component"><param name="component" value="core"/></antcall>
+                <antcall target="compress-component"><param name="component" value="ant"/></antcall>
+                <antcall target="compress-component"><param name="component" value="tomcat"/></antcall>
+                <antcall target="compress-component"><param name="component" value="imagemagick"/></antcall>
+                <antcall target="compress-component"><param name="component" value="ghostscript"/></antcall>
+  	</target>
 
 </project>
