Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster » Insert plugin full version in java source file
Insert plugin full version in java source file [message #557586] Wed, 08 September 2010 08:00
Ulrich Grave is currently offline 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.
Previous Topic:Building rcp apps for the mac
Next Topic:authentication cancelled error
Goto Forum:
  


Current Time: Tue Oct 21 18:31:02 GMT 2014

Powered by FUDForum. Page generated in 0.01839 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software