Insert plugin full version in java source file [message #557586] |
Wed, 08 September 2010 08:00 |
Ulrich Grave Messages: 3 Registered: October 2009 |
Junior Member |
|
|
Hello
how can i replace a token in my java source file with the full plugin version.
I first create a buckminster.cspex in my plugin:
<?xml version="1.0" encoding="UTF-8"?>
<cspecExtension
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bc="http://www.eclipse.org/buckminster/Common-1.0"
xmlns="http://www.eclipse.org/buckminster/CSpec-1.0">
<artifacts>
<private name="raw.version.source">
<path path="src/runtime/util/Version.java"/>
</private>
</artifacts>
<actions>
<private name="insert.version" actor="ant">
<actorProperties>
<property key="buildFileId" value="buckminster.pdetasks"/>
<property key="targets" value="replaceToken"/>
</actorProperties>
<properties>
<property key="token" value="@runtime_version@"/>
<property key="value" value="TODO"/>
</properties>
<prerequisites>
<attribute alias="action.input" name="raw.version.source"/>
</prerequisites>
<products alias="action.output" base="${buckminster.output}/temp/">
<path path="src/runtime/util/Version.java" />
</products>
</private>
</actions>
<groups>
<private name="eclipse.build.source">
<attribute name="eclipse.build.source.old"/>
<attribute name="insert.version"/>
</private>
</groups>
<alterArtifacts>
<rename oldName="eclipse.build.source" newName="eclipse.build.source.old"/>
</alterArtifacts>
</cspecExtension>
The result is that the token @runtime_version@ is replaced with "TODO". But not in the final compiled class file in the plugin jar.
|
|
|
Powered by
FUDForum. Page generated in 0.02761 seconds