Mercurial > public > develkit
annotate osgi-ant-bundlor.xml @ 39:a2f3a6a2ec2d
CM-125: allow OSGI profile to be specified
author | smith@nwoca.org |
---|---|
date | Thu, 19 May 2011 17:16:49 -0400 |
parents | ec63736cd2a3 |
children | 5f8d6291cc66 |
rev | line source |
---|---|
20
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
1 <?xml version="1.0" encoding="UTF-8"?> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
2 <project name="osgi-project-tasks" default="" basedir="." |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
3 xmlns:ssdtosgi="http://www.ssdt-ohio.org/ant/osgi" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
4 xmlns:ivy="antlib:fr.jayasoft.ivy.ant" |
36
82a5d5a000fe
CM-125: Auto connect osgi dependency to build process
smith@nwoca.org
parents:
35
diff
changeset
|
5 xmlns:bundlor="antlib:com.springsource.bundlor.ant" |
82a5d5a000fe
CM-125: Auto connect osgi dependency to build process
smith@nwoca.org
parents:
35
diff
changeset
|
6 xmlns:ssdtant="antlib:org.ssdt_ohio.tools.ant"> |
20
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
7 |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
8 <description>Ant tasks to assist building OSGi bundles.</description> |
36
82a5d5a000fe
CM-125: Auto connect osgi dependency to build process
smith@nwoca.org
parents:
35
diff
changeset
|
9 |
82a5d5a000fe
CM-125: Auto connect osgi dependency to build process
smith@nwoca.org
parents:
35
diff
changeset
|
10 <ssdtant:add-dependency target="-post-jar" depends="-osgi-jar"/> |
82a5d5a000fe
CM-125: Auto connect osgi dependency to build process
smith@nwoca.org
parents:
35
diff
changeset
|
11 |
38 | 12 <target name="-osgi-jar" depends="-init-osgi,ivy-info" unless="osgi.jar.disabled"> |
36
82a5d5a000fe
CM-125: Auto connect osgi dependency to build process
smith@nwoca.org
parents:
35
diff
changeset
|
13 <ssdtosgi:jar jar="${dist.jar}"/> |
82a5d5a000fe
CM-125: Auto connect osgi dependency to build process
smith@nwoca.org
parents:
35
diff
changeset
|
14 </target> |
82a5d5a000fe
CM-125: Auto connect osgi dependency to build process
smith@nwoca.org
parents:
35
diff
changeset
|
15 |
20
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
16 <target name="-init-osgi"> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
17 <ivy:settings file="ivysettings.xml"/> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
18 <ivy:cachepath resolveId="bundlor.classpath" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
19 pathid="bundlor.classpath" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
20 organisation="com.springsource.bundlor" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
21 module="com.springsource.bundlor.ant" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
22 revision="1.0.0.RELEASE" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
23 inline="true" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
24 type="jar" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
25 log="download-only"/> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
26 <taskdef resource="com/springsource/bundlor/ant/antlib.xml" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
27 uri="antlib:com.springsource.bundlor.ant" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
28 classpathref="bundlor.classpath"/> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
29 |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
30 <macrodef name="jar" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
31 description="OSGi-ifies jar file" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
32 uri="http://www.ssdt-ohio.org/ant/osgi"> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
33 <attribute name="jar" description="input jar"/> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
34 <attribute name="symbolicName" description="Bundle Symbolic Name" default="${ivy.organisation}.${ivy.module}"/> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
35 <attribute name="name" description="Bundle Name" default="${application.title}"/> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
36 <attribute name="version" description="Bundle Version" default="${ivy.revision}"/> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
37 <attribute name="template" description="Bundle Template" default="${basedir}/template.mf"/> |
39 | 38 <attribute name="profile" description="OSGI Profile" default=""/> |
20
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
39 <sequential> |
36
82a5d5a000fe
CM-125: Auto connect osgi dependency to build process
smith@nwoca.org
parents:
35
diff
changeset
|
40 <echo message="OSGI-ifying @{jar} as @{symbolicName};@{version}" level="info"/> |
37
ba7ae19e40a0
CM-125: output file to assist in creating OSGI template.
smith@nwoca.org
parents:
36
diff
changeset
|
41 <echoproperties destfile="${build.dir}/ivydeps.txt"> |
ba7ae19e40a0
CM-125: output file to assist in creating OSGI template.
smith@nwoca.org
parents:
36
diff
changeset
|
42 <propertyset> |
ba7ae19e40a0
CM-125: output file to assist in creating OSGI template.
smith@nwoca.org
parents:
36
diff
changeset
|
43 <propertyref prefix="ivydeps"/> |
ba7ae19e40a0
CM-125: output file to assist in creating OSGI template.
smith@nwoca.org
parents:
36
diff
changeset
|
44 <mapper type="glob" from="ivydeps.*" to="*"/> |
ba7ae19e40a0
CM-125: output file to assist in creating OSGI template.
smith@nwoca.org
parents:
36
diff
changeset
|
45 </propertyset> |
ba7ae19e40a0
CM-125: output file to assist in creating OSGI template.
smith@nwoca.org
parents:
36
diff
changeset
|
46 </echoproperties> |
20
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
47 <bundlor:bundlor |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
48 inputPath="${basedir}/@{jar}" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
49 outputPath="${basedir}/@{jar}" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
50 bundleVersion="@{version}" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
51 bundleSymbolicName="@{symbolicName}" |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
52 failOnWarnings="true" |
39 | 53 manifestTemplatePath="@{template}" |
54 osgiProfilePath="@{profile}"> | |
21
a114600dc3d4
CM-125: Fix reference to bundle name attribute
smith@nwoca.org
parents:
20
diff
changeset
|
55 <property name="bundle.name" value="@{name}"/> |
20
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
56 <propertyset> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
57 <propertyref prefix="ivy"/> |
35
7df554d8c4c1
CM-125: correct error in bundlor property mapping
smith@nwoca.org
parents:
21
diff
changeset
|
58 <mapper type="glob" from="ivydeps.*" to="*"/> |
37
ba7ae19e40a0
CM-125: output file to assist in creating OSGI template.
smith@nwoca.org
parents:
36
diff
changeset
|
59 </propertyset> |
20
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
60 </bundlor:bundlor> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
61 </sequential> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
62 </macrodef> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
63 |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
64 </target> |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
65 |
fe20e4ed4be2
CM-125: Ant script to assist creating OSGI jars.
smith@nwoca.org
parents:
diff
changeset
|
66 </project> |