| Buckminster code generation in IDE/Headless [message #689503] |
Mon, 27 June 2011 14:32  |
Missing name Missing name Messages: 10 Registered: April 2010 |
Junior Member |
|
|
Hi all, i am new to Buckminster and i played around with code generation but i can't find a solution. Let's say i have a component A which needs some "generated" java code from B. The generated code will be generated from an ant target in comp B.
I have found some help in the Buckybook (ant actor and generator definition in cspex) but it only works if i call the "generateCode" Target manually (right click on the plugin and invoke action). How can i handle the code generation automatically in IDE and headless? (materialize manually and all other steps have to be done automatically..)
Is there a simple Buckminster "Code generation" example somewhere?
thanks for your help!
|
|
|
| Re: Buckminster code generation in IDE/Headless [message #689517 is a reply to message #689503] |
Mon, 27 June 2011 14:53   |
Alex Kravets Messages: 340 Registered: November 2009 |
Senior Member |
|
|
You can create a "composite" action that depends on other action using prerequisites as here:
<public name="create.product" actor="ant">
<actorProperties>
<property key="buildFile" value="build/product.ant" />
<property key="targets" value="create.product" />
</actorProperties>
<prerequisites alias="repository">
<attribute name="site.p2" />
</prerequisites>
<products alias="destination" base="${buckminster.output}">
<path path="eclipse/" />
</products>
</public>
site.p2 action will be called before create.product is executed.
HTH,
Alex
[Updated on: Mon, 27 June 2011 14:54] Report message to a moderator
|
|
|
|
|
| Re: Buckminster code generation in IDE/Headless [message #690288 is a reply to message #690164] |
Wed, 29 June 2011 06:14  |
Missing name Missing name Messages: 10 Registered: April 2010 |
Junior Member |
|
|
this is an example of my cspex:
<?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">
<dependencies>
<dependency name="build-env-properties" componentType="unknown" />
</dependencies>
<generators>
</generators>
<artifacts>
</artifacts>
<actions>
<!-- The action to generate the missing class -->
<public name="run.generator" actor="ant">
<actorProperties>
<property key="buildFile" value="simpleGenerator.xml" />
<property key="targets" value="generate" />
</actorProperties>
<products alias="run.generator.output" base="gen"
upToDatePolicy="DEFAULT" />
</public>
<public name="eclipse.build_" actor="eclipse.build" always="true">
<prerequisites>
<!-- <attribute name="eclipse.build.requirements"/> -->
<attribute name="run.generator" />
<!-- <attribute name="eclipse.build.source" /> -->
</prerequisites>
<products base="bin/">
<path path="." />
</products>
</public>
</actions>
<groups>
</groups>
<alterDependencies>
</alterDependencies>
<alterArtifacts>
</alterArtifacts>
<alterActions>
</alterActions>
<alterGroups>
</alterGroups>
</cspecExtension>
Right click on the plugin -> invoke Action -> start eclipse.build_ works
But i don't want to click to generate the files. If i change the action to eclipse.build following exception occurs
Project refresh on xxxx failed: Attribute eclipse.build is defined more then once in component xxxx
if i move it to "alterActions" nothing happens...
|
|
|
Powered by
FUDForum. Page generated in 0.05422 seconds