Ken Gilmer | d709bf1 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 2 | <project name="org.apache.felix.http.lightweight" default="jar"> |
| 3 | <property name="src.dir" location="src/" /> |
| 4 | <property name="project.description" value="Lightweight HTTP Service for Apache Felix" /> |
| 5 | <property name="external.dir" location="external" /> |
| 6 | <property name="doc.dir" location="${basedir}/docs" /> |
| 7 | <property name="build.dir" location="${basedir}/classes" /> |
| 8 | |
| 9 | <property name="wget.bin" location="/usr/bin/wget" /> |
| 10 | <property name="svn.bin" location="/usr/bin/svn" /> |
| 11 | <property name="git.bin" location="/usr/bin/git" /> |
| 12 | <property name="rm.bin" location="/bin/rm" /> |
| 13 | |
| 14 | <property name="framework.fqpn" value="org.apache.felix.framework" /> |
| 15 | <property name="compendium.fqpn" value="org.osgi.compendium" /> |
| 16 | |
| 17 | <tstamp> |
| 18 | <format property="TS_NOW" pattern="yyyy-MM-dd HH:mm:ss" /> |
| 19 | </tstamp> |
| 20 | |
| 21 | <target name="clean-external" unless="${skip.fetch}"> |
| 22 | <delete dir="${external.dir}" /> |
| 23 | </target> |
| 24 | |
| 25 | <target name="clean" depends="clean-external" description="remove intermediate files"> |
| 26 | <delete dir="${build.dir}" /> |
| 27 | <delete dir="${build.dir}-debug" /> |
| 28 | <delete dir="${doc.dir}" /> |
| 29 | <delete dir="org/apache" /> |
| 30 | <delete dir="org/osgi" /> |
| 31 | <delete dir="bin" /> |
| 32 | <delete file="${ant.project.name}-min.jar" /> |
| 33 | <delete file="${ant.project.name}-all.jar" /> |
| 34 | </target> |
| 35 | |
| 36 | <target name="fetch" depends="clean" unless="${skip.fetch}"> |
| 37 | <mkdir dir="${external.dir}" /> |
| 38 | <exec executable="${wget.bin}" dir="${external.dir}"> |
| 39 | <arg value="http://www.meisei-u.ac.jp/mirror/apache/dist//felix/org.apache.felix.framework-3.2.2.jar" /> |
| 40 | </exec> |
| 41 | |
| 42 | <exec executable="${svn.bin}"> |
| 43 | <arg value="export" /> |
| 44 | <arg value="http://svn.apache.org/repos/asf/felix/releases/org.osgi.compendium-1.4.0" /> |
| 45 | <arg value="${external.dir}/org.osgi.compendium" /> |
| 46 | </exec> |
| 47 | |
| 48 | <exec executable="${svn.bin}"> |
| 49 | <arg value="export" /> |
| 50 | <arg value="http://svn.apache.org/repos/asf/tomcat/archive/servletapi/branches/other/servlet2.4-jsp2.0-tc5.x/ASF/jsr154" /> |
| 51 | <arg value="${external.dir}/servletapi" /> |
| 52 | </exec> |
| 53 | </target> |
| 54 | |
| 55 | <target name="stage-dependencies" depends="fetch"> |
| 56 | <copy toDir="${src.dir}"> |
| 57 | <fileset dir="${external.dir}/org.osgi.compendium/src" includes="main/java/org/osgi/service/http/**/*.java" /> |
| 58 | </copy> |
| 59 | |
| 60 | <copy toDir="${src.dir}"> |
| 61 | <fileset dir="${external.dir}/servletapi/src" /> |
| 62 | </copy> |
| 63 | <copy toDir="${src.dir}/share/javax/servlet/http"> |
| 64 | <fileset dir="${external.dir}/servletapi/examples/WEB-INF/classes" includes="*.properties" /> |
| 65 | </copy> |
| 66 | <copy toDir="${src.dir}/share/javax/servlet/resources"> |
| 67 | <fileset dir="${src.dir}/share/dtd" /> |
| 68 | </copy> |
| 69 | |
| 70 | <delete dir="${src.dir}/etc" /> |
| 71 | <delete dir="examples" /> |
| 72 | </target> |
| 73 | |
| 74 | <target name="compile" depends="stage-dependencies" description="compile the Java source code to class files"> |
| 75 | <mkdir dir="${build.dir}" /> |
| 76 | <mkdir dir="${build.dir}-debug" /> |
| 77 | |
| 78 | <javac destdir="${build.dir}" source="1.4" target="1.4" encoding="utf-8" fork="true" includeantruntime="false" debug="false"> |
| 79 | <src path="${src.dir}/main/java" /> |
| 80 | <src path="${src.dir}/share" /> |
| 81 | <classpath path="${external.dir}/org.apache.felix.framework-3.2.2.jar" /> |
| 82 | </javac> |
| 83 | <javac destdir="${build.dir}-debug" source="1.4" target="1.4" encoding="utf-8" fork="true" includeantruntime="false" debug="true" debuglevel="lines,vars,source"> |
| 84 | <src path="${src.dir}/main/java" /> |
| 85 | <src path="${src.dir}/share" /> |
| 86 | <classpath path="${external.dir}/org.apache.felix.framework-3.2.2.jar" /> |
| 87 | </javac> |
| 88 | </target> |
| 89 | |
| 90 | <target name="jar" depends="compile" description="create a Jar file for the application"> |
| 91 | <mkdir dir="${build.dir}/META-INF" /> |
| 92 | <copy toDir="${build.dir}/META-INF-MIN"> |
| 93 | <fileset dir="META-INF" /> |
| 94 | </copy> |
| 95 | |
| 96 | <copy toDir="${build.dir}/META-INF-ALL"> |
| 97 | <fileset dir="META-INF" /> |
| 98 | </copy> |
| 99 | |
| 100 | <manifest file="${build.dir}/META-INF-ALL/MANIFEST.MF" mode="update"> |
| 101 | <attribute name="Import-Package" value="org.osgi.framework" /> |
| 102 | <attribute name="Export-Package" value='org.osgi.service.http;version="1.2.1", javax.servlet;version="2.4",javax.servlet.http;version="2.4",javax.servlet.resources;version="2.4"' /> |
| 103 | <attribute name="Built-By" value="${user.name}" /> |
| 104 | <attribute name="Built-Date" value="${TS_NOW}" /> |
| 105 | </manifest> |
| 106 | |
| 107 | <manifest file="${build.dir}/META-INF-MIN/MANIFEST.MF" mode="update"> |
| 108 | <attribute name="Import-Package" value="org.osgi.framework,org.osgi.service.http,javax.servlet,javax.servlet.http,javax.servlet.resources" /> |
| 109 | <attribute name="Export-Package" value="" /> |
| 110 | <attribute name="Built-By" value="${user.name}" /> |
| 111 | <attribute name="Built-Date" value="${TS_NOW}" /> |
| 112 | </manifest> |
| 113 | |
| 114 | <jar destfile="${ant.project.name}-debug-all.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF"> |
| 115 | <fileset dir="${build.dir}-debug" includes="**/*.class,**/*.properties,**/*.dtd,**/*.xsd" /> |
| 116 | <fileset dir="${src.dir}/share" includes="javax/servlet/**/*.properties,javax/servlet/**/*.dtd,javax/servlet/**/*.xsd" /> |
| 117 | <fileset dir="." includes="LICENSE-2.0.txt" /> |
| 118 | </jar> |
| 119 | |
| 120 | <jar destfile="${ant.project.name}-all.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF"> |
| 121 | <fileset dir="${build.dir}" includes="**/*.class,**/*.properties,**/*.dtd,**/*.xsd" /> |
| 122 | <fileset dir="${src.dir}/share" includes="javax/servlet/**/*.properties,javax/servlet/**/*.dtd,javax/servlet/**/*.xsd" /> |
| 123 | <fileset dir="." includes="LICENSE-2.0.txt" /> |
| 124 | </jar> |
| 125 | |
| 126 | <jar destfile="${ant.project.name}-min.jar" manifest="${build.dir}/META-INF-MIN/MANIFEST.MF"> |
| 127 | <fileset dir="${build.dir}" includes="org/apache/felix/http/lightweight/**/*.class" /> |
| 128 | <fileset dir="." includes="LICENSE-2.0.txt" /> |
| 129 | </jar> |
| 130 | </target> |
| 131 | |
| 132 | <target name="javadoc" depends="jar"> |
| 133 | <javadoc sourcepath="${src.dir}/main/java" defaultexcludes="no" destdir="${doc.dir}" version="true" use="true" windowtitle="${project.description}"> |
| 134 | <classpath path="${external.dir}/org.apache.felix.framework-3.2.2.jar" /> |
| 135 | <classpath path="${external.dir}/osgi.cmpn.jar" /> |
| 136 | </javadoc> |
| 137 | </target> |
| 138 | </project> |