tags:

views:

317

answers:

2

Using Eclipse, is there a way to automatically copy a file/project's directory to a different path once it's saved?

Effectively, when i save a file, it copies it from the workspace to the deploy directory

Workspace: "/code/my_app"
deploy to: "/application/plugins/my_app"

EDIT:

This is Mainly for Python and PHP projects

+1  A: 

You can do that with Apache Ant pretty easily. There's even an Ant View in eclipse to run the script from. See the copy task.

Here's a sample ant build.xml file:

<project name="whatever" default="copy">
    <target name="copy">
        <copy todir="someDir">
          <fileset dir="someOtherDir/" casesensitive="yes">
            <include name="**/*.java"/>
            <exclude name="**/*Test*"/>
          </fileset>
        </copy>
    </target>
</project>

You can also add more targets for deploying your application.

geowa4
I'm trying it right now, I guess I'm missing something ... So in external tools, i created an ANT Build, But i'm not sure where to put the copy code <copy todir="../new/dir"> <fileset dir="src_dir"/> </copy>
dassouki
i added sample build.xml content
geowa4
+1  A: 

Try “Ant Builder” :).

i have not tried this but this looks nearly what you want.