Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » custom build steps / script
custom build steps / script [message #531721] Wed, 05 May 2010 22:02 Go to next message
No real name is currently offline No real nameFriend
Messages: 6
Registered: April 2010
Junior Member
I'm using the Flash Builder plug-in inside of Eclipse, but my question is really general...

When I build my executable (in this case an SWF file), I'd like to incorporate additional steps before and after the build to copy files from one folder to another, delete files, etc. This is similar to what I'd do with a build scripting language like python, perl, or DOS. Can I do something like this inside of the IDE? Do I need to write an Eclipse build script?

Thanks in advance,

Brian
Re: custom build steps / script [message #531989 is a reply to message #531721] Thu, 06 May 2010 17:25 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 2355
Registered: July 2009
Senior Member
On 5/5/10 6:02 PM, brian@ideaslive.com wrote:
> I'm using the Flash Builder plug-in inside of Eclipse, but my question
> is really general...
>
> When I build my executable (in this case an SWF file), I'd like to
> incorporate additional steps before and after the build to copy files
> from one folder to another, delete files, etc. This is similar to what
> I'd do with a build scripting language like python, perl, or DOS. Can I
> do something like this inside of the IDE? Do I need to write an Eclipse
> build script?
>
> Thanks in advance,

See if any of this information is helpful:
http://bewarethepenguin.blogspot.com/2008/08/customizing-bui lds-for-your-eclipse.html

Hope this helps,
Eric
Re: custom build steps / script [message #532006 is a reply to message #531989] Thu, 06 May 2010 18:06 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 6
Registered: April 2010
Junior Member
Thanks. This is what I was looking for. I'm using DOS batch files, but I should probably learn Ant.

I'm a bit confused by the "run the builder after a Clean" option. Really I just want to check for any new files before I build / run the application and copy them. Do I need to use "after a Clean" option?

-- Brian
Re: custom build steps / script [message #532202 is a reply to message #532006] Fri, 07 May 2010 13:55 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 2355
Registered: July 2009
Senior Member
On 5/6/10 2:06 PM, brian@ideaslive.com wrote:
> Thanks. This is what I was looking for. I'm using DOS batch files, but
> I should probably learn Ant.
>
> I'm a bit confused by the "run the builder after a Clean" option. Really
> I just want to check for any new files before I build / run the
> application and copy them. Do I need to use "after a Clean" option?

A "clean" on the project happens when you explicitly invoke it (via the
Project > Clean... menu) or sometimes when you change certain project
settings (such as the build path). If you want your script to run when
that clean has completed, use the option. Keep in mind that a "clean"
operation deletes everything from the build output location and then
re-builds.

Hope this helps,
Eric
Re: custom build steps / script [message #532207 is a reply to message #531721] Fri, 07 May 2010 14:24 Go to previous messageGo to next message
No real name is currently offline No real nameFriend
Messages: 6
Registered: April 2010
Junior Member
Actually I want the build step to run every time I click the "Run" button. It copies potentially changed files from one folder to a "data" folder under bin-debug.

Do I need either Clean option? How do I get this build step to run every time I run the project even though I've changed no source files?

Thanks,

Brian
Re: custom build steps / script [message #532921 is a reply to message #532207] Tue, 11 May 2010 14:51 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 2355
Registered: July 2009
Senior Member
On 5/7/10 10:24 AM, brian@ideaslive.com wrote:
> Actually I want the build step to run every time I click the "Run"
> button. It copies potentially changed files from one folder to a "data"
> folder under bin-debug.
>
> Do I need either Clean option? How do I get this build step to run every
> time I run the project even though I've changed no source files?

If all you're doing is copying files, the default Java builder will do
that. When it encounters non-java files in a source folder, it simply
copies them to the build output location. If your data files are in a
different directory than your source code, you can just add that data
directory as a new Source Location to the project's build path. If you
want the data files to go to a different build location than the code,
just enable the "Allow output folders for source folders" checkbox on
the build path dialog and then you can specify a different location for
each source directory.
Using this, you might not need a custom build script at all since it
will automatically detect when the data files have changed and copy them
to the appropriate location.

Hope this helps,
Eric
Re: custom build steps / script [message #533251 is a reply to message #532921] Wed, 12 May 2010 17:53 Go to previous message
No real name is currently offline No real nameFriend
Messages: 6
Registered: April 2010
Junior Member
Good suggestion, but it didn't work for me. I'm using the Flex builder, so maybe that's the problem.

-- Brian

Eric Rizzo wrote on Tue, 11 May 2010 10:51
On 5/7/10 10:24 AM, brian@ideaslive.com wrote:
If all you're doing is copying files, the default Java builder will do
that. When it encounters non-java files in a source folder, it simply
copies them to the build output location. If your data files are in a
different directory than your source code, you can just add that data
directory as a new Source Location to the project's build path. If you
want the data files to go to a different build location than the code,
just enable the "Allow output folders for source folders" checkbox on
the build path dialog and then you can specify a different location for
each source directory.
Using this, you might not need a custom build script at all since it
will automatically detect when the data files have changed and copy them
to the appropriate location.

Hope this helps,
Eric

Previous Topic:Highlight changes in files under svn
Next Topic:Problem creating Android Project
Goto Forum:
  


Current Time: Thu Nov 20 23:08:08 GMT 2014

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

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