Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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>




Back to the top