2

As anyone who has worked with a development team using a repo can attest to, using the Force.com IDE can be a bit challenging. My team and I have turned off Build Automatically and I originally was using Build All when I was ready to push changes to the server. Unfortunately, this pushes all changed files which is a problem. For different reasons all of the developers are working out of the same sandbox. We also have a unique setup where we are only pulling in subsets of the metadata based on our current project (there are currently multiple custom applications that are in this org). Here is the scenario (we are using git):

  • A file gets changed by a different developer (could by any metadata as we put all metadata into our repo for each project (i.e., profiles, layouts, classes, pages, etc)
  • I don't want that file to be pulled into my local IDE until that developer commits that change. We are trying to get proper change tracking working with our commit history, so I can't just Refresh from Server or anything like that.
  • That developer finishes the change and commits it then pushes it to the remote repo.
  • I pull down the latest changes, and run a simple Refresh to simply update the files in my IDE.

Here is where the problem comes in. Now that I have updated my IDE, if I use Ctrl+S to Save and Ctrl+B to Build All, all of the changes I just got from the repo will be flagged as changed so the Ctrl+B will automatically attempt to push those changes. This results in the IDE throwing all kinds of errors telling me that my files are conflicting with changes on the remote server.

So, my question is:

Is there a very easy way to only "build" the file I want to save? I know I can right+click the file > Force.com > Save to Server, but I want to replicate that functionality with a simple key combination. Any ideas?

4

2 Answers 2

4

Ugh, sounds like a nightmare. The save/build/refresh process gets pretty sucky pretty fast when dealing with group development.

Josh's pointer to the macro seems like the point solution you're looking for.

Have you considered a different workflow though? I would probably do this in one of two ways.

  • create a script (probably bound to an Eclipse shortcut key) which diffs your local project filesystem against what is committed in source control. Based on changed files, creates a package.xml and uses the Force.com migration tool (Ant) to deploy just those files to the target environment. This would be basically a "build all" for just the files you've worked on since the last commit and would be as fast as the Eclipse build process (it's doing the exact same thing under the covers, except it would only be deploying your locally changed files.)

  • get developers into their own sandboxes (I know there can be reasons for not doing this, like you need a full copy sandbox, or the outlandish fees customers have to pay per sandbox, but for true parallel development this is my preferred setup). This takes away the build all issue. Then add a commit hook to your source control repo which deploys all new commits to an integration sandbox, and reports any deployment issues as build failures blamed on the committer.

None of these situations are ideal, so I'd say your best bet is just the macro tool if your overall process is working for you. Seems like it would create bigger issues than having to click a couple times to save to server :)

1

I attempted to leverage Eclipe's macro plugin PracticallyMacro to do one key deployment but it did not record right clicks.

Before the feature is added I came up with a solution using 'TyperTask' keyboard macro but TyperTask as builder could work too:

  • 'TyperTask' can automate tasks based on typed characters - epic.
    • the trick is to accommodate the context menu 'Save to server' location changes between different files types.
    • it includes a browser page refresh but you must update the WINDOW text: {Control}{Alt}S={controldown}s{controlup}{shiftdown}{F10}{shiftup}.s{Delay=200}{altdown}y{altup}{Delay=2000}{altdown}y{altup}{Delay=12000}WINDOW: News Detail{f5}WINDOW: Force.com -

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .