问题
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
回答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
回答2:
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
来源:https://stackoverflow.com/questions/22961293/accessing-the-timestamp-after-pde-build