blob: 898ebed505b7b7966926fd5b47f78b1ee73372a9 [file] [log] [blame]
Ken Gilmer2c29a972011-10-13 05:01:42 +00001<?xml version="1.0"?>
Ken Gilmer94a73322011-10-27 07:38:31 +00002<project name="org.apache.felix.httplite" default="jar">
Ken Gilmer1c4856a2011-10-27 07:28:18 +00003 <property name="src.dir" location="${basedir}/src" />
Ken Gilmer2c29a972011-10-13 05:01:42 +00004 <property name="project.description" value="Lightweight HTTP Service for Apache Felix" />
Ken Gilmerfd56de32011-10-27 08:18:13 +00005 <property name="project.version" value="0.1.1" />
Ken Gilmer2c29a972011-10-13 05:01:42 +00006 <property name="external.dir" location="external" />
7 <property name="doc.dir" location="${basedir}/docs" />
8 <property name="build.dir" location="${basedir}/classes" />
Ken Gilmer94a73322011-10-27 07:38:31 +00009 <property name="dist.dir" location="${basedir}/target" />
Ken Gilmer2c29a972011-10-13 05:01:42 +000010
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 Gilmer1c4856a2011-10-27 07:28:18 +000040 <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 Gilmer2c29a972011-10-13 05:01:42 +000045 </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 Gilmer1c4856a2011-10-27 07:28:18 +000086 <classpath path="${external.dir}/osgi.core.jar" />
Ken Gilmer2c29a972011-10-13 05:01:42 +000087 </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 Gilmer1c4856a2011-10-27 07:28:18 +000091 <classpath path="${external.dir}/osgi.core.jar" />
Ken Gilmer2c29a972011-10-13 05:01:42 +000092 </javac>
93 </target>
94
Ken Gilmer1c4856a2011-10-27 07:28:18 +000095 <target name="jar" depends="compile" description="create a Jar file for the application">
96 <mkdir dir="${build.dir}/META-INF-MIN" />
Ken Gilmer94a73322011-10-27 07:38:31 +000097 <mkdir dir="${build.dir}/META-INF-ALL" />
98 <mkdir dir="${dist.dir}" />
Ken Gilmer2c29a972011-10-13 05:01:42 +000099
Ken Gilmer1c4856a2011-10-27 07:28:18 +0000100 <manifest file="${build.dir}/META-INF-ALL/MANIFEST.MF">
Ken Gilmer2c29a972011-10-13 05:01:42 +0000101 <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 Gilmer1c4856a2011-10-27 07:28:18 +0000105 <attribute name="Bundle-Name" value="${project.description} (Complete bundle)"/>
106 <attribute name="Bundle-SymbolicName" value="${ant.project.name}"/>
Ken Gilmer94a73322011-10-27 07:38:31 +0000107 <attribute name="Bundle-Version" value="${project.version}.${DSTAMP}${TSTAMP}" />
Ken Gilmerf4f03292011-10-27 07:49:34 +0000108 <attribute name="Bundle-Activator" value="org.apache.felix.httplite.osgi.Activator" />
109 <attribute name="Bundle-Vendor" value="The Apache Software Foundation" />
Ken Gilmer2c29a972011-10-13 05:01:42 +0000110 </manifest>
111
Ken Gilmer1c4856a2011-10-27 07:28:18 +0000112 <manifest file="${build.dir}/META-INF-MIN/MANIFEST.MF">
Ken Gilmer2c29a972011-10-13 05:01:42 +0000113 <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 Gilmer1c4856a2011-10-27 07:28:18 +0000117 <attribute name="Bundle-Name" value="${project.description} (Minimum bundle)"/>
118 <attribute name="Bundle-SymbolicName" value="${ant.project.name}"/>
Ken Gilmer94a73322011-10-27 07:38:31 +0000119 <attribute name="Bundle-Version" value="${project.version}.${DSTAMP}${TSTAMP}" />
Ken Gilmerf4f03292011-10-27 07:49:34 +0000120 <attribute name="Bundle-Activator" value="org.apache.felix.httplite.osgi.Activator" />
121 <attribute name="Bundle-Vendor" value="The Apache Software Foundation" />
Ken Gilmer2c29a972011-10-13 05:01:42 +0000122 </manifest>
123
Ken Gilmerfd56de32011-10-27 08:18:13 +0000124 <jar destfile="${dist.dir}/${ant.project.name}.debug.all-${project.version}.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF">
Ken Gilmer2c29a972011-10-13 05:01:42 +0000125 <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 Gilmerfd56de32011-10-27 08:18:13 +0000130 <jar destfile="${dist.dir}/${ant.project.name}.all-${project.version}.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF">
Ken Gilmer2c29a972011-10-13 05:01:42 +0000131 <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 Gilmerfd56de32011-10-27 08:18:13 +0000136 <jar destfile="${dist.dir}/${ant.project.name}.min-${project.version}.jar" manifest="${build.dir}/META-INF-MIN/MANIFEST.MF">
Ken Gilmer1c4856a2011-10-27 07:28:18 +0000137 <fileset dir="${build.dir}" includes="org/apache/felix/httplite/**/*.class" />
Ken Gilmer2c29a972011-10-13 05:01:42 +0000138 <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>