1

Am using ant to build my RCP application. The PDE headless build works well. However for some custom bundling of my artifacts, i need to access the timestamp that PDE uses while creating jars of my plugins and features.

Ex: com.test.app.1.0.0.201404091703.jar

I need to get the value 201404091703 from the PDE once the build is successful. Is this possible?

I tried with forceContextQualifier from the build.properties, but the problem with this is, everytime before the build starts i need to update this value manually (to some static value) and overriding of this global property (dynamically) using ANT is not possible.

Any suggestions is appreciated

Jack Clouseau
  • 81
  • 1
  • 11

2 Answers2

1

You can specify -DforceContextQualifier=xxx as an argument to the org.eclipse.equinox.launcher_xxx run in your build.xml.

Update:

So, for example:

<buildnumber file="build.number"/>

<tstamp>
  <format property="build.date" pattern="yyyyMMddHHmm" timezone="GMT"/>
</tstamp>

<property name="build.version" value="${build.date}-${build.number}"/>

<java fork="true" jar="${jar.launcher}">
  <arg value="-DforceContextQualifier=${build.version}"/>
  ...

Sets the qualifier for a build to YYYYMMDDHHMM-num

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • Hi, thanks for the reply. Yeah this is possible, but every time before the build starts, i need to manually specify the value, which i want to avoid. Is there a way to dynamically update the value for -DforceContextQualifier? As i mentioned in my post for custom bundling of the artifacts i should be able to access this value when the PDE build is finished. Could you help in specifying this value dynamically? – Jack Clouseau Apr 10 '14 at 02:56
  • Added example of constructing a value for the qualifier – greg-449 Apr 10 '14 at 06:46
0

The PDE headless build generates property files for each bundle with the current version numbers. In a custom callback (or else in your Ant build file) you can read such a property file and use the properties.

Search for the property generateVersionsLists in Eclipse Help. http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Ftasks%2Fpde_version_qualifiers.htm