Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Buckminster » Call action after action completes
Call action after action completes [message #542444] Thu, 24 June 2010 21:03 Go to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
Hello,

After I call create.product action I need to remove some files from a plugin that was build. I was thinking of creating an action that calls ant script to do this, but not sure where to call this action after create.product finishes. Action I want to call is remove.j2ee. Here is my cspex file:
<?xml version="1.0" encoding="UTF-8"?>
<cspecExtension xmlns:com="http://www.eclipse.org/buckminster/Common-1.0"
	xmlns="http://www.eclipse.org/buckminster/CSpec-1.0">
	<actions>
		<!-- actions that removes j2ee.jar from common -->
		<public name="remove.j2ee" actor="ant">
			<actorProperties>
				<property key="cleanUp" value="build/cleanUp.xml" />
				<property key="targets" value="removeJ2ee" />
			</actorProperties>
		</public>
		<public name="create.product" actor="ant">
			<actorProperties>
				<property key="buildFile" value="build/product.ant" />
				<property key="targets" value="create.product" />
				<property key="removej2ee" value="remove.j2ee" />
			</actorProperties>
			<properties>
				<property key="profile" value="iitProfile" />
				<property key="iu" value="iit.product" />
			</properties>
			<prerequisites alias="repository">
				<attribute name="site.p2" />
			</prerequisites>
			<products alias="destination" base="${buckminster.output}">
				<path path="integrationtools.${target.os}.${target.arch}/" />
			</products>
		</public>
		<public name="create.product.zip" actor="ant">
			<actorProperties>
				<property key="buildFileId" value="buckminster.pdetasks" />
				<property key="targets" value="create.zip" />
			</actorProperties>
			<prerequisites alias="action.requirements">
				<attribute name="create.product" />
			</prerequisites>
			<products alias="action.output" base="${buckminster.output}">
				<path
					path="integrationtools.${target.ws}.${target.os}.${target.arch}.zip" />
			</products>
		</public>
	</actions>
</cspecExtension>

Also, is this the right approach or there is easier/better way to do this?

thanks,
Alex
Re: Call action after action completes [message #542457 is a reply to message #542444] Thu, 24 June 2010 22:10 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
I am on a small device right now and can't really make sense of the XML.
But the general approach is to call your command and have it require the
original.

Using a cspex it should be possible to rename the original as well -
thus making it possible to use the original name for your decorating
action and thus hiding the fact from other callers that extra logic was
inserted.

- henrik
Alex <camokatu@gmail.com> wrote:
> Hello,
>
> After I call create.product action I need to remove some files from a
> plugin that was build. I was thinking of creating an action that calls
> ant script to do this, but not sure where to call this action after
> create.product finishes. Action I want to call is remove.j2ee. Here is
> my cspex file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <cspecExtension
> xmlns:com="http://www.eclipse.org/buckminster/Common-1.0"
> xmlns="http://www.eclipse.org/buckminster/CSpec-1.0">
> <actions>
> <!-- actions that removes j2ee.jar from common -->
> <public name="remove.j2ee" actor="ant">
> <actorProperties>
> <property key="cleanUp" value="build/cleanUp.xml" />
> <property key="targets" value="removeJ2ee" />
> </actorProperties>
> </public>
> <public name="create.product" actor="ant">
> <actorProperties>
> <property key="buildFile" value="build/product.ant" />
> <property key="targets" value="create.product" />
> <property key="removej2ee" value="remove.j2ee" />
> </actorProperties>
> <properties>
> <property key="profile" value="iitProfile" />
> <property key="iu" value="iit.product" />
> </properties>
> <prerequisites alias="repository">
> <attribute name="site.p2" />
> </prerequisites>
> <products alias="destination" base="${buckminster.output}">
> <path path="integrationtools.${target.os}.${target.arch}/" />
> </products>
> </public>
> <public name="create.product.zip" actor="ant">
> <actorProperties>
> <property key="buildFileId" value="buckminster.pdetasks" />
> <property key="targets" value="create.zip" />
> </actorProperties>
> <prerequisites alias="action.requirements">
> <attribute name="create.product" />
> </prerequisites>
> <products alias="action.output" base="${buckminster.output}">
> <path
> path=" integrationtools.${target.ws}.${target.os}.${target.arch}.zi p "
> />
> </products>
> </public>
> </actions>
> </cspecExtension>
>
Also, is this the right approach or there is easier/better way to do
this?

thanks,
Alex



--
- henrik
Re: Call action after action completes [message #542672 is a reply to message #542457] Fri, 25 June 2010 15:19 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
Yes, that's the obvious solution, but is there way to "inject" some actions into other actions similar to what happens in <prerequisites> element, but after the action finishes?

thanks,
Alex
Re: Call action after action completes [message #542775 is a reply to message #542672] Sat, 26 June 2010 00:35 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik LindbergFriend
Messages: 2509
Registered: July 2009
Senior Member
Hi,

On 6/25/10 5:19 PM, Alex wrote:
> Yes, that's the obvious solution, but is there way to "inject" some
> actions into other actions similar to what happens in <prerequisites>
> element, but after the action finishes?

Not that I am aware of (sorry). Someone else may have some other clever
tricks up their sleeve...

In b3 it is possible to advise the build logic to inject behavior
before/after/around a builder (comparable to Buckminster action). This
is specified and implemented, but there is still a lot of work remaining
before building with b3.

A solution that may be easier to implement in Buckminster would be "on
completion of action x run action y with result of x as 'prerequisite'"

Contributions are welcome ;)

- henrik
Re: Call action after action completes [message #542782 is a reply to message #542775] Sat, 26 June 2010 02:54 Go to previous message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 561
Registered: November 2009
Senior Member
Thanks Henrik,
Quote:

Contributions are welcome Wink


I am just getting comfortable with buckminster, haven't dived too much in the code yet, but this is a good opportunity to do that.

thanks,
Alex

Previous Topic:Suppress build warnings
Next Topic:P2 site without macosx support with filters
Goto Forum:
  


Current Time: Tue Apr 16 18:43:38 GMT 2024

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

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

Back to the top