Showing posts with label rsync. Show all posts
Showing posts with label rsync. Show all posts

Thursday, November 22, 2012

Eclipse: edit locally and automatic rsync as part of the build

So I have this project that I love to edit, but need to build and deploy on a different target system (in my case OSX to Linux) I also love to edit in Eclipse, and use rsync as the fastest way to get stuff on the target machine. The remote systems explorer just did not cut it... however I ended up flipping between eclipse and terminal (rsync) to get things synced up.... Answer: add a builder launcher that invokes the rsync script as part of the autobuild... Here the simple rsync script that I placed in root of the maintenance-ui project (chmod it to 755)
rsync -avz --exclude '.svn' --exclude 'target' --delete *  myuserid@myhost.com:./projects/maintenance-ui
Here the launch file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/maintenance-ui/rsync.sh}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,auto,"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/maintenance-ui}"/>
</launchConfiguration>
Now you could and can use the remote systems explorer in Eclipse to run your remote build and you will never have to leave Eclipse and alt tabbing around.