Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster dev » [buckminster-dev] Using Buckminster preference in ant actor?
[buckminster-dev] Using Buckminster preference in ant actor? [message #30344] Tue, 20 January 2009 19:12 Go to next message
Eclipse UserFriend
Originally posted by: Mark.Addleman.ca.com

This is a multi-part message in MIME format.

------_=_NextPart_001_01C97B33.183CCA17
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I have created a new preference in Buckminster that stores the OSGi
version and build ID that I want set across all plugins and features
that I'm building. I have written two Buckminster headless Java
extensions to support this. One goes through the workspace and updates
all manifest.mf, feature.xml, and *.product files to set the version.
The other performs a SVN tag operation. Both of these extensions are
able to read the Buckminster preference without a problem.

=20

The last bit of our build system is to package the artifacts. Right
now, the packaging is a simple zip file. I'd like the zip file name to
contain the same version information defined by the preference value.
Of course, Ant appears to be the right tool for doing the packaging, but
I don't' know how to pass the preference value to the ant script. Here
is the relevant snippet from my cspex file:

=20

<actions>

<public name=3D"package" actor=3D"ant">

<actorProperties>

<property key=3D"buildFile" =
value=3D"build.xml"/>

</actorProperties>

<properties>

<property key=3D"build.id"
value=3D"${buckminster.preference:buildid}" />

</properties>

<prerequisites>

<attribute name=3D"feature.exports"/>

</prerequisites>

</public>

</actions>

=20


------_=_NextPart_001_01C97B33.183CCA17
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>I have created a new preference in Buckminster that =
stores
the OSGi version and build ID that I want set across all plugins and =
features
that I&#8217;m building.&nbsp; I have written two Buckminster headless =
Java extensions
to support this.&nbsp; One goes through the workspace and updates all =
manifest.mf,
feature.xml, and *.product files to set the version.&nbsp; The other =
performs a
SVN tag operation.&nbsp; Both of these extensions are able to read the
Buckminster preference without a problem.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>The last bit of our build system is to package the =
artifacts.&nbsp;
Right now, the packaging is a simple zip file.&nbsp; I&#8217;d like the =
zip
file name to contain the same version information defined by the =
preference
value.&nbsp; Of course, Ant appears to be the right tool for doing the
packaging, but I don&#8217;t&#8217; know how to pass the preference =
value to
the ant script.&nbsp; Here is the relevant snippet from my cspex =
file:<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier New";color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;actions&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;public</span><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:black'> =
</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>name=3D</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:green'>&quot;package&quot;</span><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:black'> =
</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>actor=3D</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:green'>&quot;ant&quot;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;actorProperties&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& n=
bsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;property</span><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:black'> =
</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>key=3D</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:green'>&quot;buildFile&quot;</span><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:black'> =
</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>value=3D</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:green'>&quot;build.xml&quot;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>/&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;/actorProperties&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;properties&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& n=
bsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;property</span><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:black'> =
</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>key=3D</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:green'>&quot;build.id&quot;</span><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:black'> =
</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>value=3D</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:green'>&quot;${buckminster.preference:buildid}&quot; </span><sp=
an
style=3D'font-size:10.0pt;font-family:"Courier New";color:black'> =
</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>/&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;/properties&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;prerequisites&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& n=
bsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;attribute</span><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:black'> =
</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>name=3D</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:green'>&quot;feature.exports&quot;</span ><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>/&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;/prerequisites&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal style=3D'text-autospace:none'><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:black'> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; </span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New";color:navy'>&lt;/public&gt;</span><span
style=3D'font-size:10.0pt;font-family:"Courier =
New"'><o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:10.0pt;font-family:"Courier New";
color:black'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span =
style=3D'font-size:10.0pt;
font-family:"Courier =
New";color:navy'>&lt;/actions&gt;<o:p></o:p></span ></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>

------_=_NextPart_001_01C97B33.183CCA17--
Re: [buckminster-dev] Using Buckminster preference in ant actor? [message #30382 is a reply to message #30344] Wed, 21 January 2009 00:30 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
Hi Mark,
Why do you use a preference to store a build id? To me preferences are
ideal for settings that remain static over time and I would instead use
a system property for a build id since it changes with each build. That
would also make it available to both the CSPEC actions and the Ant scripts.

We could of course add some kind of ant task that could be used to
obtain values from the preference store but that's more work. The syntax
you suggest using ${buckminster.preference:xxx} is not feasible since
that would require us to copy the entire preference store to that name
space just in case someone would access it.

Would it be possible for you to switch to using a property? The
properties will contain values defined under "Preferences" ->
"Run/Debug" -> "String Substitution" if you prefer to set them from
within the IDE and store then in a workspace template.

Regards,
Thomas Hallgren


Addleman, Mark J wrote:
> I have created a new preference in Buckminster that stores the OSGi
> version and build ID that I want set across all plugins and features
> that I’m building. I have written two Buckminster headless Java
> extensions to support this. One goes through the workspace and updates
> all manifest.mf, feature.xml, and *.product files to set the version.
> The other performs a SVN tag operation. Both of these extensions are
> able to read the Buckminster preference without a problem.
>
>
>
> The last bit of our build system is to package the artifacts. Right
> now, the packaging is a simple zip file. I’d like the zip file name to
> contain the same version information defined by the preference value.
> Of course, Ant appears to be the right tool for doing the packaging, but
> I don’t’ know how to pass the preference value to the ant script. Here
> is the relevant snippet from my cspex file:
>
>
>
> <actions>
>
> <public name="package" actor="ant">
>
> <actorProperties>
>
> <property key="buildFile" value="build.xml"/>
>
> </actorProperties>
>
> <properties>
>
> <property key="build.id"
> value="${buckminster.preference:buildid}" />
>
> </properties>
>
> <prerequisites>
>
> <attribute name="feature.exports"/>
>
> </prerequisites>
>
> </public>
>
> </actions>
>
>
>
RE: [buckminster-dev] Using Buckminster preference in ant actor? [message #30417 is a reply to message #30344] Wed, 21 January 2009 19:50 Go to previous message
Eclipse UserFriend
Originally posted by: Mark.Addleman.ca.com

I can use a system property. I started with preferences just as a way
to get a bit deeper in Buckminster programming but I can see now that
they are inappropriate for my use case.

-----Original Message-----
From: buckminster-dev-bounces@eclipse.org
[mailto:buckminster-dev-bounces@eclipse.org] On Behalf Of Thomas
Hallgren
Sent: Tuesday, January 20, 2009 4:30 PM
To: Buckminster developer discussions
Subject: Re: [buckminster-dev] Using Buckminster preference in ant
actor?

Hi Mark,
Why do you use a preference to store a build id? To me preferences are
ideal for settings that remain static over time and I would instead use
a system property for a build id since it changes with each build. That
would also make it available to both the CSPEC actions and the Ant
scripts.

We could of course add some kind of ant task that could be used to
obtain values from the preference store but that's more work. The syntax

you suggest using ${buckminster.preference:xxx} is not feasible since
that would require us to copy the entire preference store to that name
space just in case someone would access it.

Would it be possible for you to switch to using a property? The
properties will contain values defined under "Preferences" ->
"Run/Debug" -> "String Substitution" if you prefer to set them from
within the IDE and store then in a workspace template.

Regards,
Thomas Hallgren


Addleman, Mark J wrote:
> I have created a new preference in Buckminster that stores the OSGi
> version and build ID that I want set across all plugins and features
> that I'm building. I have written two Buckminster headless Java
> extensions to support this. One goes through the workspace and
updates
> all manifest.mf, feature.xml, and *.product files to set the version.

> The other performs a SVN tag operation. Both of these extensions are
> able to read the Buckminster preference without a problem.
>
>
>
> The last bit of our build system is to package the artifacts. Right
> now, the packaging is a simple zip file. I'd like the zip file name
to
> contain the same version information defined by the preference value.

> Of course, Ant appears to be the right tool for doing the packaging,
but
> I don't' know how to pass the preference value to the ant script.
Here
> is the relevant snippet from my cspex file:
>
>
>
> <actions>
>
> <public name="package" actor="ant">
>
> <actorProperties>
>
> <property key="buildFile" value="build.xml"/>
>
> </actorProperties>
>
> <properties>
>
> <property key="build.id"
> value="${buckminster.preference:buildid}" />
>
> </properties>
>
> <prerequisites>
>
> <attribute name="feature.exports"/>
>
> </prerequisites>
>
> </public>
>
> </actions>
>
>
>

_______________________________________________
buckminster-dev mailing list
buckminster-dev@eclipse.org
https://dev.eclipse.org/mailman/listinfo/buckminster-dev
Previous Topic:RE: [buckminster-dev] Project can't be build until its prerequisite isbuild
Next Topic:SVN i18n considering a new release ?
Goto Forum:
  


Current Time: Tue Mar 19 08:54:09 GMT 2024

Powered by FUDForum. Page generated in 0.02835 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top