我最近跟着this great guide将颠覆版本整合到我的C++/c#visual studio项目中生成的exe/dll文件中。现在,我可以轻松地右键单击一个exe文件来查找哪个版本用于构建二进制文件(请参阅下图)。我喜欢这个功能。Flash/Flex:将subversion版本集成到exe/swf文件中?
在建立空气/独立应用程序时,这是否可以在flash/flex中执行相同的操作?我想标记exe文件和dll。
更新与解决方案:
虽然这里提供的基于ANT的解决方案并不像一个在SVN信息被燃烧成的.exe/.dll顺利文件(在我看来),它解决了我的问题,现在在我们的制作中实施。 我的设置基于凯文和frankhermes的答案,但使用SubMCRev.exe而不是svn.exe或jar文件。
在我们的实现中,我们在启动时将svn修订版转储到日志文件中。从下面SVN目标的输出是这样的:
Built with SVN Revision: 1.0.0.1181 (local modifications found)
SVN目标:
<target name="SVN Revision">
<exec executable="subWCRev.exe" outputproperty="revision">
<arg value="${basedir}\\.." />
<redirector>
<outputfilterchain>
<linecontainsregexp>
<regexp pattern='^([Last]|[Local])' />
</linecontainsregexp>
<tokenfilter>
<replaceregex pattern='[\D]+([\d]+)' replace="Built with SVN Revision: 1.0.0.\1" />
<replaceregex pattern='Local modifications found' replace=" (local modifications found)" />
</tokenfilter>
<striplinebreaks />
</outputfilterchain>
</redirector>
</exec>
</target>
编译目标:
<target name="compile" depends="init, SVN Revision">
<mxmlc file="..." output="...">
<define name="compile::REVISION" value="'${revision}'" />
....
</mxmlc>
</target>
这可能无法直接执行......但您可以使用AIR中默认集成的这种超酷自动触发功能http://gregsramblings.com/2008/08/16/adding-auto-update-features-to-your应用程序在3简单步骤/ – Neeraj 2011-04-15 11:27:50
Incase你觉得这是正确的事情。请让我把它作为答案并标记为正确。 – Neeraj 2011-04-15 11:28:11
谢谢你的回复Neeraj。虽然这确实是一个很好的功能,但它与我当前的配置不匹配,并且在我的设置中实现不会很容易。我感谢您的评论,稍后我会深入研究它,但它并不直接帮助我。如果你把它变成答案,我会给你一个投票:) – 2011-04-15 11:36:02