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