blob: e8cc813cc76e3940ae366fb27ef5c796f750c26f [file] [log] [blame]
Richard S. Hall6fe36b42009-07-13 13:25:46 +00001<?xml version="1.0"?>
2<!--
3 Licensed to the Apache Software Foundation (ASF) under one
4 or more contributor license agreements. See the NOTICE file
5 distributed with this work for additional information
6 regarding copyright ownership. The ASF licenses this file
7 to you under the Apache License, Version 2.0 (the
8 "License"); you may not use this file except in compliance
9 with the License. You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing,
14 software distributed under the License is distributed on an
15 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, either express or implied. See the License for the
17 specific language governing permissions and limitations
18 under the License.
19-->
20<project xmlns:ivy="antlib:org.apache.ivy.ant" name="bld-ivy" default="jar">
21
22 <!-- buildVersion is overridden by Hudson -->
23 <property name="buildVersion" value="0.8.0-dev" />
24 <property name="version" value="${buildVersion}" />
25
26 <property name="name" value="sigil-ivy-plugin" />
27 <property name="name.jar" value="${name}.jar" />
28 <property name="name-version.jar" value="${name}-${version}.jar" />
29
30 <property name="lib.dir" value="${basedir}/lib" />
31 <property name="target.dir" value="${basedir}/target" />
32 <property name="classes.dir" value="${basedir}/target/classes" />
33
34 <property name="java-src.dir" value="${basedir}/src" />
35
David Morgan Spenser Savaged4a4e0b2009-07-22 21:19:42 +000036 <property name="sigil-plugins.dir" location="../../build/repository/local/" />
37 <property name="bnd-plugins.dir" location="../../common/core/lib" />
Richard S. Hall6fe36b42009-07-13 13:25:46 +000038
39 <target name="init" depends="find-plugins">
40
41 <path id="run.classpath">
42 <pathelement location="${classes.dir}" />
43 <pathelement location="${bld-core.jar}" />
44 <pathelement location="${bld-obr.jar}" />
45 <pathelement location="${equinox-common.jar}" />
46 <pathelement location="${osgi-core.jar}" />
47 </path>
48
49 <path id="compile.classpath">
50 <path refid="run.classpath"/>
51 <fileset dir="${lib.dir}/compile">
52 <include name="*.jar" />
53 </fileset>
54 </path>
55
56 </target>
57
58 <target name="mkdirs">
59 <mkdir dir="${target.dir}" />
60 <mkdir dir="${classes.dir}" />
61 </target>
62
63 <target name="find-plugins" depends="mkdirs">
64 <property name="osgi-core.jar" value="${lib.dir}/runtime/osgi.core.jar"/>
65 <property name="equinox-common.jar" value="${lib.dir}/runtime/equinox.common.jar"/>
66
67 <fileset id="bld-core" dir="${sigil-plugins.dir}"
David Morgan Spenser Savaged4a4e0b2009-07-22 21:19:42 +000068 includes="felix.sigil.common.core/*/jars/org.apache.felix.sigil.common.core.jar" />
Richard S. Hall6fe36b42009-07-13 13:25:46 +000069 <property name="bld-core" refid="bld-core"/>
70 <property name="bld-core.jar" location="${sigil-plugins.dir}/${bld-core}"/>
71
72 <fileset id="bld-obr" dir="${sigil-plugins.dir}"
David Morgan Spenser Savaged4a4e0b2009-07-22 21:19:42 +000073 includes="felix.sigil.common.obr/*/jars/org.apache.felix.sigil.common.obr.jar" />
Richard S. Hall6fe36b42009-07-13 13:25:46 +000074 <property name="bld-obr" refid="bld-obr"/>
75 <property name="bld-obr.jar" location="${sigil-plugins.dir}/${bld-obr}"/>
76 </target>
77
78 <target name="clean">
79 <delete dir="${target.dir}" />
80 </target>
81
82 <target name="compile" depends="init">
83 <javac debug="true" debuglevel="source,lines,vars" source="1.5" target="1.5" fork="true" destdir="${classes.dir}" srcdir="${java-src.dir}">
84 <classpath refid="compile.classpath" />
85 </javac>
86 </target>
87
88 <target name="dist" depends="jar">
89 <zip destfile="${target.dir}/sigil-${version}.zip">
90 <zipfileset dir="example" prefix="sigil-${version}/example"
91 excludes="**/build/**, **/lib/**, **/ivy-cache/**, **/repository/**"/>
92 <zipfileset dir="target" prefix="sigil-${version}/lib"
93 includes="${name.jar}, bndlib.jar"/>
94 </zip>
95
96 <copy file="${target.dir}/${name.jar}" tofile="${target.dir}/${name-version.jar}"/>
97 </target>
98
99 <target name="jar" depends="compile, taskdefs">
100 <bnd
101 classpath="${toString:run.classpath}"
102 files="sigil-ivy-plugin.bnd"
103 output="${target.dir}/${name.jar}"
104 eclipse="false"
105 failok="false"
106 exceptions="true" />
107
108 <copy todir="${target.dir}">
109 <fileset dir="${bnd-plugins.dir}" includes="bndlib.jar"/>
110 </copy>
111 </target>
112
113 <target name="taskdefs">
114 <taskdef resource="aQute/bnd/ant/taskdef.properties"
115 classpath="${lib.dir}/ant/bnd-0.0.312.jar"/>
116 </target>
117
118</project>