Ken Gilmer | 2c29a97 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
Ken Gilmer | 94a7332 | 2011-10-27 07:38:31 +0000 | [diff] [blame] | 2 | <project name="org.apache.felix.httplite" default="jar"> |
Ken Gilmer | 1c4856a | 2011-10-27 07:28:18 +0000 | [diff] [blame] | 3 | <property name="src.dir" location="${basedir}/src" /> |
Ken Gilmer | 2c29a97 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 4 | <property name="project.description" value="Lightweight HTTP Service for Apache Felix" /> |
Ken Gilmer | fd56de3 | 2011-10-27 08:18:13 +0000 | [diff] [blame] | 5 | <property name="project.version" value="0.1.1" /> |
Ken Gilmer | 2c29a97 | 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 | 94a7332 | 2011-10-27 07:38:31 +0000 | [diff] [blame] | 9 | <property name="dist.dir" location="${basedir}/target" /> |
Ken Gilmer | 2c29a97 | 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 | 1c4856a | 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 | 2c29a97 | 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 | 1c4856a | 2011-10-27 07:28:18 +0000 | [diff] [blame] | 86 | <classpath path="${external.dir}/osgi.core.jar" /> |
Ken Gilmer | 2c29a97 | 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 | 1c4856a | 2011-10-27 07:28:18 +0000 | [diff] [blame] | 91 | <classpath path="${external.dir}/osgi.core.jar" /> |
Ken Gilmer | 2c29a97 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 92 | </javac> |
| 93 | </target> |
| 94 | |
Ken Gilmer | 1c4856a | 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 | 94a7332 | 2011-10-27 07:38:31 +0000 | [diff] [blame] | 97 | <mkdir dir="${build.dir}/META-INF-ALL" /> |
| 98 | <mkdir dir="${dist.dir}" /> |
Ken Gilmer | 2c29a97 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 99 | |
Ken Gilmer | 1c4856a | 2011-10-27 07:28:18 +0000 | [diff] [blame] | 100 | <manifest file="${build.dir}/META-INF-ALL/MANIFEST.MF"> |
Ken Gilmer | 2c29a97 | 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 | 1c4856a | 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 | 94a7332 | 2011-10-27 07:38:31 +0000 | [diff] [blame] | 107 | <attribute name="Bundle-Version" value="${project.version}.${DSTAMP}${TSTAMP}" /> |
Ken Gilmer | f4f0329 | 2011-10-27 07:49:34 +0000 | [diff] [blame] | 108 | <attribute name="Bundle-Activator" value="org.apache.felix.httplite.osgi.Activator" /> |
| 109 | <attribute name="Bundle-Vendor" value="The Apache Software Foundation" /> |
Ken Gilmer | 2c29a97 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 110 | </manifest> |
| 111 | |
Ken Gilmer | 1c4856a | 2011-10-27 07:28:18 +0000 | [diff] [blame] | 112 | <manifest file="${build.dir}/META-INF-MIN/MANIFEST.MF"> |
Ken Gilmer | 2c29a97 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 113 | <attribute name="Import-Package" value="org.osgi.framework,org.osgi.service.http,javax.servlet,javax.servlet.http,javax.servlet.resources" /> |
| 114 | <attribute name="Export-Package" value="" /> |
| 115 | <attribute name="Built-By" value="${user.name}" /> |
| 116 | <attribute name="Built-Date" value="${TS_NOW}" /> |
Ken Gilmer | 1c4856a | 2011-10-27 07:28:18 +0000 | [diff] [blame] | 117 | <attribute name="Bundle-Name" value="${project.description} (Minimum bundle)"/> |
| 118 | <attribute name="Bundle-SymbolicName" value="${ant.project.name}"/> |
Ken Gilmer | 94a7332 | 2011-10-27 07:38:31 +0000 | [diff] [blame] | 119 | <attribute name="Bundle-Version" value="${project.version}.${DSTAMP}${TSTAMP}" /> |
Ken Gilmer | f4f0329 | 2011-10-27 07:49:34 +0000 | [diff] [blame] | 120 | <attribute name="Bundle-Activator" value="org.apache.felix.httplite.osgi.Activator" /> |
| 121 | <attribute name="Bundle-Vendor" value="The Apache Software Foundation" /> |
Ken Gilmer | 2c29a97 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 122 | </manifest> |
| 123 | |
Ken Gilmer | fd56de3 | 2011-10-27 08:18:13 +0000 | [diff] [blame] | 124 | <jar destfile="${dist.dir}/${ant.project.name}.debug.all-${project.version}.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF"> |
Ken Gilmer | 2c29a97 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 125 | <fileset dir="${build.dir}-debug" includes="**/*.class,**/*.properties,**/*.dtd,**/*.xsd" /> |
| 126 | <fileset dir="${src.dir}/share" includes="javax/servlet/**/*.properties,javax/servlet/**/*.dtd,javax/servlet/**/*.xsd" /> |
| 127 | <fileset dir="." includes="LICENSE-2.0.txt" /> |
| 128 | </jar> |
| 129 | |
Ken Gilmer | fd56de3 | 2011-10-27 08:18:13 +0000 | [diff] [blame] | 130 | <jar destfile="${dist.dir}/${ant.project.name}.all-${project.version}.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF"> |
Ken Gilmer | 2c29a97 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 131 | <fileset dir="${build.dir}" includes="**/*.class,**/*.properties,**/*.dtd,**/*.xsd" /> |
| 132 | <fileset dir="${src.dir}/share" includes="javax/servlet/**/*.properties,javax/servlet/**/*.dtd,javax/servlet/**/*.xsd" /> |
| 133 | <fileset dir="." includes="LICENSE-2.0.txt" /> |
| 134 | </jar> |
| 135 | |
Ken Gilmer | fd56de3 | 2011-10-27 08:18:13 +0000 | [diff] [blame] | 136 | <jar destfile="${dist.dir}/${ant.project.name}.min-${project.version}.jar" manifest="${build.dir}/META-INF-MIN/MANIFEST.MF"> |
Ken Gilmer | 1c4856a | 2011-10-27 07:28:18 +0000 | [diff] [blame] | 137 | <fileset dir="${build.dir}" includes="org/apache/felix/httplite/**/*.class" /> |
Ken Gilmer | 2c29a97 | 2011-10-13 05:01:42 +0000 | [diff] [blame] | 138 | <fileset dir="." includes="LICENSE-2.0.txt" /> |
| 139 | </jar> |
| 140 | </target> |
| 141 | |
| 142 | <target name="javadoc" depends="jar"> |
| 143 | <javadoc sourcepath="${src.dir}/main/java" defaultexcludes="no" destdir="${doc.dir}" version="true" use="true" windowtitle="${project.description}"> |
| 144 | <classpath path="${external.dir}/org.apache.felix.framework-3.2.2.jar" /> |
| 145 | <classpath path="${external.dir}/osgi.cmpn.jar" /> |
| 146 | </javadoc> |
| 147 | </target> |
| 148 | </project> |