<?xml version="1.0" encoding="UTF-8"?>
<project name="BlancoAntTaskPlugin" default="build" basedir=".">
	<!-- blancoAnt(0.1.2)により自動生成されました。 (2007/12/23) -->
	<property name="version" value="0.6.1" />

	<property name="product" value="blanco.plugin.anttask" />
	<property name="project.zip" value="${product}_${version}-src.zip" />
	<property name="project.plugin30.zip" value="${product}_${version}-eclipse3.0.zip" />
	<property name="project.plugin31.jar" value="${product}_${version}-eclipse3.1.jar" />
	<property name="project.plugin.main.jar" value="blancoanttaskplugin.jar" />

	<property name="eclipse.dir" value="C:/Program Files/eclipse" />

	<taskdef name="blancoconstants" classname="blanco.constants.task.BlancoConstantsTask">
		<classpath>
			<fileset dir="lib" includes="*.jar" />
			<fileset dir="lib.ant" includes="*.jar" />
		</classpath>
	</taskdef>

	<taskdef name="blancoeclipseplugingen" classname="blanco.eclipseplugingen.task.BlancoEclipsePluginGenTask">
		<classpath>
			<fileset dir="lib" includes="*.jar" />
			<fileset dir="lib.ant" includes="*.jar" />
		</classpath>
	</taskdef>

	<target name="pack">
		<echo>packing project</echo>
		<delete file="${project.zip}" />
		<delete file="bin/blancoanttaskplugin.jar" />

		<delete dir="javadoc" />
		<delete dir="tmp" />

		<zip destfile="${project.zip}">
			<zipfileset dir="." prefix="blancoAntTaskPlugin" excludes="${project.plugin30.zip},${project.plugin31.jar},${project.zip},**/*.class" />
		</zip>
	</target>

	<target name="build-plugin">
		<echo>building plugin</echo>

		<echo>事前にコンパイルされていることが必要です</echo>
		<delete file="bin/${project.plugin.main.jar}" />
		<jar destfile="bin/${project.plugin.main.jar}">
			<zipfileset dir="bin" excludes="${project.plugin.jar},${project.plugin.main.jar}" />
			<!-- Javaソースコード(通常)の取り込み -->
			<zipfileset dir="src" includes="**/*" prefix="src" />
			<!-- Javaソースコード(自動生成)の取り込み (※sampleは除外) -->
			<zipfileset dir="blanco/main" includes="**/*.java" prefix="src" excludes="blanco/sample/**" />
			<!-- プロパティファイルの取り込み -->
			<zipfileset dir="blanco/main" includes="*.properties" />
		</jar>

		<!-- Eclipse 3.0用は ZIPファイルとしてアーカイブ -->
		<delete file="${project.plugin30.zip}" />
		<zip destfile="${project.plugin30.zip}">
			<zipfileset dir="icons" prefix="plugins/${product}_${version}/icons" />
			<zipfileset dir="lib" prefix="plugins/${product}_${version}/lib" includes="blanco*.jar,jxl*.jar" />
			<zipfileset dir="doc" prefix="plugins/${product}_${version}/doc" />
			<zipfileset dir="meta" prefix="plugins/${product}_${version}/meta" />
			<zipfileset file="bin/blancoanttaskplugin.jar" prefix="plugins/${product}_${version}/lib" />
			<zipfileset dir="bin" prefix="plugins/${product}_${version}/lib" includes="${project.plugin.jar}" />
			<zipfileset dir="." prefix="plugins/${product}_${version}" includes="plugin.xml" />
			<zipfileset dir="." prefix="plugins/${product}_${version}" includes="about.html" />
			<!-- META-INFフォルダを含めてみます -->
			<zipfileset dir="META-INF" prefix="plugins/${product}_${version}/META-INF" />
		</zip>

		<!-- Eclipse 3.1用は JARファイルとしてアーカイブ -->
		<delete file="${project.plugin31.jar}" />
		<jar destfile="${project.plugin31.jar}" manifest="META-INF/MANIFEST.MF">
			<manifest>
				<attribute name="Bundle-Version" value="${version}" />
			</manifest>
			<zipfileset dir="icons" prefix="icons" />
			<zipfileset dir="lib" prefix="lib" includes="blanco*.jar,jxl*.jar" />
			<zipfileset dir="doc" prefix="doc" />
			<zipfileset dir="meta" prefix="meta" />
			<zipfileset file="bin/blancoanttaskplugin.jar" prefix="lib" />
			<zipfileset dir="bin" prefix="lib" includes="${project.plugin.jar}" />
			<zipfileset dir="." includes="plugin.xml" />
			<zipfileset dir="." includes="about.html" />
		</jar>
	</target>

	<target name="compile">
		<delete dir="bin" />
		<mkdir dir="bin" />
		<javac srcdir="blanco/main/;src/" destdir="bin" debug="true" source="1.4" target="1.4" fork="true">
			<classpath>
				<!-- ワイルドカードで一括取り込み -->
				<fileset dir="lib" includes="*.jar" />
				<fileset dir="${eclipse.dir}/plugins" includes="org.eclipse.*.jar" />
				<pathelement path="${eclipse.dir}/plugins/org.junit_3.8.1/junit.jar" />
			</classpath>
			<include name="**/*.java" />
		</javac>
	</target>

	<target name="javadoc">
		<echo>JavaDocを生成します。</echo>
		<delete dir="javadoc" />
		<javadoc destdir="javadoc">
			<fileset dir="src" />
			<fileset dir="blanco/main" />
			<classpath>
				<fileset dir="lib" includes="*.jar" />
				<fileset dir="lib.ant" includes="*.jar" />
			</classpath>
		</javadoc>
	</target>

	<target name="meta">
		<blancoeclipseplugingen metadir="meta/program" />
		<blancoconstants metadir="meta/program" />
	</target>

	<target name="build" depends="meta,compile,build-plugin,pack">
	</target>

</project>