views:

239

answers:

1

I am not sure if there's an answer for this already -- couldn't find one for this (hopefully common) setup:

I recently converted one of my ColdFusion projects to deploy via ANT.

I have a local ant script that instructs a remote server to check out the code, and run the application's specific build file, remotely on the server.

I have a few endpoints:

Live - production (on the production server) Staging - on the production server, different datasource, etc. dev - on the local box.

What I have run into it seems is a simple and common problem. I now need ANT to create any build, even locally. Fine, created a local endpoint and it configures for my box.

Issue? How do I get it to show up as a project (automatically if possible) in Eclipse/ColdFusion builder. What I envision is instead of checking out a branch via the subversion plugin in CFBuilder/Eclipse, I now use ANT to do that for me.

Since I use ColdFusion Builder (Eclipse + Adobe's plugin), I have all of eclipse's tools and plugins available to solve the problem of : how can I best call ANT from within Eclipse/ColdFusion Builder, to setup the local build as a project that I can develop and work on?

I think when I check the code back in from the local box, I'd have to be sure not to check in any files with local config paths, etc.

I hope this is a detailed and clear enough explanation, if not, please ask.

Thanks in advance!

+3  A: 

You won't be able to have it "automatically" show up in CFBuilder, but you can make it pretty easy.

Eclipse requires the ".project" file, which is a simple xml file that by default generally just contains the project name.

Once you check out your project from SVN, Do file -- new -- ColdFusion project and point it to the directory where you've checked out your code. This will create the .project in there. From there, you can commit that file to SVN.

Subsequent developers who check out the project from SVN can then do File -- Import -- Existing Project into workspace, and point it to their checked out location. Since it'll have the .project file in there (from when you committed it), that project will show up when they search for projects in that import wizard.

Now, that's how you'd do it if you already used ANT to check out the code. However, if you wanted a potentially even easier way, then you can just install either the Subversive or Subclipse plugin into CFBuilder, and then do

  1. file -- new -- checkout project from svn
  2. point to your svn url
  3. select the directory you want to check out
  4. choose a location where you want the code to live
  5. click through to completion
marc esher
Marc, this is awesome, sure to save me time, thanks! I originally used Subversion to checkout the code locally with subclipse, but it didn't set-up the app locally which ant does (with respect to data sources, paths (mac vs windows vs linux), etc..
Smooth Operator
sweet, glad it made sense. One other thing I was reminded of last night: you can also use ANT to write that .project file without needing to ever create it in the first place. One thing I do is keep common stuff like that in an ant file and then "import" that file in my main build files. So you could have a "writeEclipseProjectFile" target or macrodef that would write it out and use, say, the project name in the ANT file as the project name in the .project file
marc esher
That's a great tip... if you have any other suggestions I'd love to hear them. I know we all figure out a lot of the same stuff over time, I don't mind getting a few shortcuts that I may or may not discover on my own anyways..
Smooth Operator