1 <project name="Shibboleth Identity Provider" basedir="." default="package">
4 <format property="build-date" pattern="ddMMyyyy'T'kkmmss" timezone="GMT" />
7 <!-- User based property file that overrides any property below -->
8 <property file="${user.name}-build.properties" />
10 <!-- Project based property file -->
\r
11 <property file="build.properties" />
13 <!-- Installation specific property file -->
14 <property file="install.properties" />
\r
16 <!-- Load ant-contrib tasks -->
\r
17 <taskdef resource="net/sf/antcontrib/antlib.xml" />
19 <!-- Load Checkstyle tasks -->
20 <taskdef resource="checkstyletask.properties" />
\r
22 <!-- Classpath for building core classes-->
\r
23 <path id="build-path">
\r
24 <fileset dir="${build-lib.dir}" includes="**/*.jar" />
\r
25 <fileset dir="${lib.dir}" includes="**/*.jar" />
\r
28 <!-- Classpath for testing classes-->
\r
29 <path id="test-path">
\r
30 <path refid="build-path" />
\r
31 <pathelement location="${core-classes.dir}" />
\r
32 <pathelement location="${core-src.dir}" />
\r
33 <pathelement location="${test-classes.dir}" />
34 <pathelement location="${test-classes.dir}/data" />
35 <pathelement location="${test-classes.dir}/log4j.xml" />
\r
36 <pathelement location="${test-src.dir}" />
\r
37 <pathelement location="${classpathres.dir}" />
\r
40 <!-- Prepare directory structure for build -->
\r
41 <target name="build-init">
\r
42 <mkdir dir="${build.dir}" />
\r
45 <!-- Compile core (non-test) classes -->
\r
46 <target name="compile-core" depends="build-init, clean-compile">
\r
47 <mkdir dir="${core-classes.dir}" />
\r
49 <javac srcdir="${core-src.dir}" destdir="${core-classes.dir}" includes="**/*.java" debug="on" source="1.5">
\r
50 <classpath refid="build-path" />
\r
55 <!-- Compile unit test classes -->
\r
56 <target name="compile-test" depends="compile-core">
\r
57 <mkdir dir="${test-classes.dir}" />
\r
59 <javac srcdir="${test-src.dir}" destdir="${test-classes.dir}" includes="**/*.java" debug="on" source="1.5">
\r
60 <classpath refid="test-path" />
\r
65 <!-- Compile and run unit tests -->
\r
66 <target name="test" depends="compile-core, compile-test" description="Runs the unit tests for the project.">
\r
67 <mkdir dir="${test-results.dir}" />
\r
69 <echo message="Excuting unit tests using endorsed directory ${java.endorsed.dirs}" />
\r
70 <junit printsummary="off"
\r
74 haltonfailure="false"
\r
76 errorproperty="testFailed">
\r
77 <jvmarg value="-Djava.endorsed.dirs=${java.endorsed.dirs}" />
\r
78 <classpath refid="test-path" />
\r
79 <formatter type="xml" />
\r
80 <batchtest todir="${test-results.dir}">
\r
81 <fileset dir="${test-classes.dir}">
\r
82 <include name="**/*Test.class" />
\r
86 <junitreport todir="${test-results.dir}">
\r
87 <fileset dir="${test-results.dir}">
\r
88 <include name="TEST-*.xml" />
\r
90 <report format="frames" todir="${test-report.dir}" />
\r
93 <echo message="Test report available at ${test-report.dir}/index.html" />
94 <fail if="testFailed" message="Test failure; see ${test-report.dir}/index.html for more information." />
\r
97 <!-- Javadoc core (non-test) classes -->
\r
98 <target name="javadoc" description="Creates the JavaDoc documentatin for the project.">
\r
99 <mkdir dir="${javadoc.dir}" />
\r
100 <javadoc packagenames="org.opensaml.*"
\r
101 sourcepath="${core-src.dir}"
\r
102 destdir="${javadoc.dir}"
\r
105 windowtitle="${ant.project.name} ${version} Java API"
\r
106 doctitle="${ant.project.name} ${version} Java API"
\r
107 bottom="${copyright}"
\r
108 overview="${core-src.dir}/overview.html">
\r
109 <classpath refid="build-path" />
\r
113 <!-- Removes previously compiled files -->
\r
114 <target name="clean-compile">
\r
115 <delete dir="${build.dir}" />
116 <delete dir="${dist.dir}" />
\r
119 <!-- Removes all build generated content -->
\r
120 <target name="clean" depends="clean-compile" description="Removes any artifact produced by the build process.">
\r
121 <delete dir="${javadoc.dir}" />
122 <delete dir="${reports.dir}" />
\r
123 <delete dir="${dist.dir}" />
\r
126 <!-- Create JAR file -->
\r
127 <target name="package" depends="compile-core" description="Creates the project library jar file.">
\r
128 <mkdir dir="${dist.dir}" />
\r
131 <equals arg1="${jdk.target}" arg2="1.4" />
\r
133 <java classname="com.rc.retroweaver.Weaver">
\r
134 <arg value="-source" />
\r
135 <arg value="${core-classes.dir}" />
\r
137 <fileset dir="${thirdpaty-lib.dir}">
\r
138 <include name="**/*.jar" />
\r
143 <echo message="**************************************************************" />
\r
144 <echo message=" Remember, you must include the retroweaver-rt jar" />
\r
145 <echo message=" file, located in the thirdparty-lib directory, along with the" />
\r
146 <echo message=" ${jar.name} on your" />
\r
147 <echo message=" classpath in order to use this with JDK 1.4" />
\r
148 <echo message="**************************************************************" />
\r
153 <jar destfile="${dist.dir}/${jar.name}" whenempty="fail">
154 <fileset dir="${classpathres.dir}" />
155 <zipfileset dir="${metainf.dir}" prefix="META-INF/"/>
156 <zipfileset dir="${core-classes.dir}" />
159 <copy todir="${webinf-temp.dir}">
160 <fileset dir="${webinf.dir}" />
161 <filterset begintoken="$" endtoken="$">
162 <filter token="IDP_HOME" value="${idp.home}" />
163 <filter token="IDP_VERSION" value="${version}" />
167 <jar destfile="${dist.dir}/${war.name}" whenempty="fail">
168 <zipfileset dir="${classpathres.dir}" prefix="WEB-INF/classes/" />
169 <zipfileset dir="${webinf-temp.dir}" prefix="WEB-INF/" />
170 <zipfileset dir="${webpages.dir}" prefix="" />
171 <zipfileset dir="${lib.dir}" prefix="WEB-INF/lib/" />
172 <zipfileset file="${dist.dir}/${jar.name}" prefix="WEB-INF/lib/" />
\r
177 <target name="install" depends="package" description="Installs the identity provider software.">
178 <mkdir dir="${idp.home}" />
179 <mkdir dir="${idp.home}/lib" />
180 <mkdir dir="${idp.home}/conf" />
181 <mkdir dir="${idp.home}/logs" />
182 <mkdir dir="${idp.home}/bin" />
183 <mkdir dir="${idp.home}/war" />
184 <mkdir dir="${idp.home}/temp/metadata" />
186 <copy todir="${idp.home}/lib" preservelastmodified="true">
187 <fileset dir="${lib.dir}" />
188 <fileset file="${dist.dir}/${jar.name}" />
191 <copy todir="${idp.home}/conf" preservelastmodified="true">
192 <fileset dir="${conf.dir}" />
193 <filterset begintoken="$" endtoken="$">
194 <filter token="IDP_HOME" value="${idp.home}" />
195 <filter token="IDP_VERSION" value="${version}" />
199 <copy todir="${idp.home}/bin" preservelastmodified="true">
200 <fileset dir="${tools.dir}" />
201 <filterset begintoken="$" endtoken="$">
202 <filter token="IDP_HOME" value="${idp.home}" />
203 <filter token="IDP_VERSION" value="${version}" />
207 <copy todir="${idp.home}/war" file="${dist.dir}/${war.name}" preservelastmodified="true" />
211 <!-- **************************************************************** -->
\r
213 <!-- *** Developer Tasks *** -->
\r
215 <!-- **************************************************************** -->
\r
217 <!-- Checks code against style guidelines -->
218 <target name="checkstyle" description="Developer task: Produces coding standard compliance report.">
219 <mkdir dir="${reports.dir}" />
221 <checkstyle config="${basedir}/checkstyle.xml" failOnViolation="false" classpathref="build-path">
222 <fileset dir="src" includes="**/*.java" />
223 <formatter type="plain" toFile="${reports.dir}/checkstyle-report.txt" />