blob: c3f93aa48ff86e438cd25219f2a414bc8c9752fc [file] [log] [blame]
Ken Gilmerd709bf12011-10-13 05:01:42 +00001<?xml version="1.0"?>
Ken Gilmer884ff112011-10-27 07:38:31 +00002<project name="org.apache.felix.httplite" default="jar">
Ken Gilmer1bd5a2e2011-10-27 07:28:18 +00003 <property name="src.dir" location="${basedir}/src" />
Ken Gilmerd709bf12011-10-13 05:01:42 +00004 <property name="project.description" value="Lightweight HTTP Service for Apache Felix" />
Ken Gilmer1bd5a2e2011-10-27 07:28:18 +00005 <property name="project.version" value="0.1.0" />
Ken Gilmerd709bf12011-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 Gilmer884ff112011-10-27 07:38:31 +00009 <property name="dist.dir" location="${basedir}/target" />
Ken Gilmerd709bf12011-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 Gilmer1bd5a2e2011-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 Gilmerd709bf12011-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 Gilmer1bd5a2e2011-10-27 07:28:18 +000086 <classpath path="${external.dir}/osgi.core.jar" />
Ken Gilmerd709bf12011-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 Gilmer1bd5a2e2011-10-27 07:28:18 +000091 <classpath path="${external.dir}/osgi.core.jar" />
Ken Gilmerd709bf12011-10-13 05:01:42 +000092 </javac>
93 </target>
94
Ken Gilmer1bd5a2e2011-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 Gilmer884ff112011-10-27 07:38:31 +000097 <mkdir dir="${build.dir}/META-INF-ALL" />
98 <mkdir dir="${dist.dir}" />
Ken Gilmerd709bf12011-10-13 05:01:42 +000099
Ken Gilmer1bd5a2e2011-10-27 07:28:18 +0000100 <manifest file="${build.dir}/META-INF-ALL/MANIFEST.MF">
Ken Gilmerd709bf12011-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 Gilmer1bd5a2e2011-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 Gilmer884ff112011-10-27 07:38:31 +0000107 <attribute name="Bundle-Version" value="${project.version}.${DSTAMP}${TSTAMP}" />
Ken Gilmerd709bf12011-10-13 05:01:42 +0000108 </manifest>
109
Ken Gilmer1bd5a2e2011-10-27 07:28:18 +0000110 <manifest file="${build.dir}/META-INF-MIN/MANIFEST.MF">
Ken Gilmerd709bf12011-10-13 05:01:42 +0000111 <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 Gilmer1bd5a2e2011-10-27 07:28:18 +0000115 <attribute name="Bundle-Name" value="${project.description} (Minimum bundle)"/>
116 <attribute name="Bundle-SymbolicName" value="${ant.project.name}"/>
Ken Gilmer884ff112011-10-27 07:38:31 +0000117 <attribute name="Bundle-Version" value="${project.version}.${DSTAMP}${TSTAMP}" />
Ken Gilmerd709bf12011-10-13 05:01:42 +0000118 </manifest>
119
Ken Gilmer1864aea2011-10-27 07:42:22 +0000120 <jar destfile="${dist.dir}/${ant.project.name}-debug-all-${project.version}.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF">
Ken Gilmerd709bf12011-10-13 05:01:42 +0000121 <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 Gilmer1864aea2011-10-27 07:42:22 +0000126 <jar destfile="${dist.dir}/${ant.project.name}-all-${project.version}.jar" manifest="${build.dir}/META-INF-ALL/MANIFEST.MF">
Ken Gilmerd709bf12011-10-13 05:01:42 +0000127 <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 Gilmer1864aea2011-10-27 07:42:22 +0000132 <jar destfile="${dist.dir}/${ant.project.name}-min-${project.version}.jar" manifest="${build.dir}/META-INF-MIN/MANIFEST.MF">
Ken Gilmer1bd5a2e2011-10-27 07:28:18 +0000133 <fileset dir="${build.dir}" includes="org/apache/felix/httplite/**/*.class" />
Ken Gilmerd709bf12011-10-13 05:01:42 +0000134 <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>