<?xml version="1.0" encoding="UTF-8"?> <project name="samplewebapp" default="build" basedir="."> <!-- make environment variables available as properties --> <property environment="env"/> <!-- Compiler settings. --> <property name="javacFailOnError" value="true"/> <property name="javacDebugInfo" value="on"/> <property name="javacVerbose" value="false"/> <property name="logExtension" value=".log"/> <property name="compilerArg" value=""/> <property name="ant.build.javac.source" value="1.8"/> <property name="ant.build.javac.target" value="1.8"/> <!-- directory names for convenience --> <property name="DLC" value="${env.DLC}" /> <property name="OEM" value="${env.OEM}" /> <property name="build.src.dir" value="${basedir}/src" /> <property name="build.out.dir" value="${basedir}/build" /> <property name="build.class.dir" location="${build.out.dir}/classes" /> <property name="samplewebapp.webcontent.dir" value="${basedir}/WebContent"/> <property name="samplewebapp.jar" location="${build.out.dir}/samplewebapp.jar" /> <property name="samplewebapp.war" location="${build.out.dir}/samplewebapp.war"/> <property name="samplewebapp.src.zip" location="${build.out.dir}/samplewebapp.src.zip"/> <!-- classpath for building samplewebapp.jar --> <path id="compile.classpath"> <!-- include progress.jar --> <pathelement path="${DLC}/java/progress.jar" /> <pathelement path="${DLC}/java/messages.jar" /> <!-- include fathom.jar --> <pathelement path="${OEM}/jars/fathom.jar"/> <!-- java servlet specific stuff needed for most web pages --> <pathelement path="${OEM}/jars/servlet-api-*.jar" /> <!-- jackson JSON library for REST API--> <pathelement path="${OEM}/jars/jackson-core-*.jar" /> <pathelement path="${OEM}/jars/jackson-annotations-*.jar" /> <pathelement path="${OEM}/jars/jackson-databind-*.jar" /> <!-- shiro for security --> <pathelement path="${OEM}/jars/shiro-core-*.jar"/> <pathelement path="${OEM}/jars/shiro-web-*.jar" /> </path> <target name="build" depends="clean,compile,jar,war,zipsrc" description="Compile all classes and build jars for samplewebapp"> </target> <target name="compile" depends="generic.java.compile" description="Compile all classes for samplewebapp.jar." > </target> <target name="generic.java.compile" description="Compile all classes in ${build.class.dir} as javasrc ${ant.build.javac.source}"> <mkdir dir="${build.out.dir}" /> <mkdir dir="${build.class.dir}" /> <javac srcdir="${build.src.dir}" destdir="${build.class.dir}" includes="**/*.java" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" > <!-- <compilerarg value="-Xlint"/> --> <classpath refid="compile.classpath" /> </javac> </target> <tstamp> <format property="TODAY" pattern="yyyy-MM-dd HH:mm:ss" /> </tstamp> <target name="jar" description="create samplewebapp.jar"> <tstamp/> <jar destfile="${samplewebapp.jar}" manifest="${basedir}/META-INF/MANIFEST.MF" > <manifest> <attribute name="url" value="http://www.progress.com" /> <attribute name="Vendor" value="Progress Software" /> <attribute name="Bundle-Name" value="OpenEdge Management Sample Web Application" /> <attribute name="Built-Date" value="${TODAY}"/> </manifest> <fileset dir="${DLC}"> <include name="version" /> </fileset> <fileset dir="${build.class.dir}"> <include name="com/**/*.class" /> </fileset> <!-- make sure to include any config files --> <fileset dir="${build.src.dir}" > <include name="com/**/*.xsl" /> <include name="com/**/*.xml" /> <include name="com/**/*.txt" /> <include name="com/**/*.properties" /> </fileset> </jar> </target> <target name="clean" description="clean output for sample web application"> <delete dir="${build.class.dir}" /> <delete file="${samplewebapp.jar}" /> <delete file="${samplewebapp.war}" /> <delete file="${samplewebapp.src.zip}" /> </target> <target name="war" description="build samplewebapp .war file"> <war destFile="${samplewebapp.war}" webxml="${samplewebapp.webcontent.dir}/WEB-INF/web.xml"> <fileset dir="${samplewebapp.webcontent.dir}"> </fileset> <lib dir="${build.out.dir}"> <include name="samplewebapp.jar"/> </lib> </war> </target> <target name="zipsrc" description="create source samplewebapp.zip"> <zip destfile="${samplewebapp.src.zip}" basedir="${basedir}" excludes="build.xml"> </zip> </target> </project> |