Accessing the timestamp after PDE build

2019-08-10 12:11发布

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

2条回答
相关推荐>>
2楼-- · 2019-08-10 12:53

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

查看更多
时光不老,我们不散
3楼-- · 2019-08-10 12:58

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

查看更多
登录 后发表回答