etc/ - [Optional] This directory contains anything that isn't java source but still needs
to be on the classpath. This can include subdirectories, and can be excluded.
lib/ - [Optional] any third party jars your extension needs
- src/ - [REQUIRED] your extension's source
+ src/ - [Optional] your extension's source
tests/ - [Optional] Your extension's JUnit test case source.
web/ - [Optional] Any web pages, images, JSPs, etc. that should be included with the war
build.properties - [REQUIRED] build properties for your extension
<!-- Compile the source -->
<antcall target="compile-ext" />
+ <!-- Copy over non-source files -->
+ <antcall target="copy-etc" />
+
<!-- Generate the java docs if we're supposed to -->
<antcall target="gen-ext-docs" />
<antcall target="test-ext" />
<!-- Package everything up -->
- <echo message="Packaging extension" />
<antcall target="package-ext" />
<!-- Put the libraries where the IdP and SP packaging can pick them up -->
<!-- Compiles the extension -->
<target name="compile-ext" depends="ext-build-init" description="Compiles an extension">
- <echo message="Compiling extension source" />
- <javac srcdir="${ext.src}" destdir="${ext.classes}" includes="**/*.java" debug="on" source="1.4">
- <!-- Shibboleth Classpath -->
- <classpath refid="build.path" />
-
- <!-- Extension libraries -->
- <classpath>
- <fileset dir="${ext.lib}">
- <include name="**/*.jar" />
- </fileset>
- </classpath>
- </javac>
+ <!-- Compile any source that might be out there -->
+ <if>
+ <available file="${ext.src}" />
+ <then>
+ <echo message="Compiling extension source" />
+ <javac srcdir="${ext.src}" destdir="${ext.classes}" includes="**/*.java" debug="on" source="1.4">
+ <!-- Shibboleth Classpath -->
+ <classpath refid="build.path" />
+
+ <!-- Extension libraries -->
+ <classpath>
+ <fileset dir="${ext.lib}">
+ <include name="**/*.jar" />
+ </fileset>
+ </classpath>
+ </javac>
+ </then>
+ </if>
+ </target>
+ <!-- Copies files from etc directory to dist directory to be bundled with extension jar -->
+ <target name="copy-etc" depends="ext-build-init" description="Copys non-source files to place where they will be added to jar">
<!-- Copy any extra stuff that needs to be on the classpath -->
<if>
<available file="${ext.etc}" />
<if>
<equals arg1="${gen.ext.docs}" arg2="true" />
<then>
- <echo message="Generating javadocs for extension ${ext.name}" />
- <javadoc sourcepath="${ext.src}" destdir="${ext.docs}" />
+ <if>
+ <available file="${ext.etc}" />
+ <then>
+ <echo message="Generating javadocs for extension ${ext.name}" />
+ <javadoc sourcepath="${ext.src}" destdir="${ext.docs}" />
+ </then>
+ </if>
</then>
</if>
</target>