在 PDE 构建后访问时间戳 [英] Accessing the timestamp after PDE build
问题描述
我正在使用 ant 构建我的 RCP 应用程序.PDE 无头构建运行良好.但是,对于我的工件的一些自定义捆绑,我需要访问 PDE 在创建我的插件和功能的 jar 时使用的时间戳.
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.
例如:com.test.app.1.0.0.201404091703.jar
Ex: com.test.app.1.0.0.201404091703.jar
一旦构建成功,我需要从 PDE 获取值 201404091703.这可能吗?
I need to get the value 201404091703 from the PDE once the build is successful. Is this possible?
我尝试使用 build.properties 中的 forceContextQualifier,但问题是,每次构建开始之前,我都需要手动更新此值(到某个静态值)并使用 ANT 覆盖此全局属性(动态)是不可能.
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.
感谢任何建议
推荐答案
您可以指定 -DforceContextQualifier=xxx
作为 org.eclipse.equinox.launcher_xxx
的参数在你的 build.xml 中运行.
You can specify -DforceContextQualifier=xxx
as an argument to the org.eclipse.equinox.launcher_xxx
run in your build.xml.
更新:
例如:
<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}"/>
...
将构建的限定符设置为 YYYYMMDDHHMM-num
Sets the qualifier for a build to YYYYMMDDHHMM-num
这篇关于在 PDE 构建后访问时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!