Thursday, February 21, 2008

Build for Eclipse

This is in response to a comment on Mark Drew's blog by Tero. At Kroger we have an automated builder for our ColdFusion Projects. I'm making it available for everyone here I offer no official support but feel free to leave a comment if you have questions. Its fairly simple and works for us, installation Instructions:

Unzip the contents into your project in eclipse. You should have some thing like /[project]/_builder and /[project/.externalToolBuilders/. You'll also want to add the following XML block to your .project file



<buildSpec>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,full,incremental,</triggers>

<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/project_build.launch</value>

</dictionary>
</arguments>
</buildCommand>
</buildSpec>



Now let's get to educating you about what's actually going on. In eclipse you can attach 1 or more builders to a project. They can execute at different times in Eclipse. You can set these builders up by right clicking the project and selecting the properties. The above xml block is what eclipse would put in your .project file so it knows there is a builder attached to the project. Okay now how the ANT file works. Below is a bulleted list of exceptions you may want to know about/change.
  • This is setup specifically for JBoss but it is very easy to change.
  • Properties are not variables once they are defined they will not be over written. So the order of the property declarations is important
  • The ANT script does try to take advantage of an environment variable of JBOSS_HOME. If it is not defined it will use the definition of env.JBOSS_HOME in the .properties file.
  • Some additional pathing for JBoss may need to be modified
  • The default build task is Project and all projects in Kroger deploy to cfusion.war/projects/ you may want to change that behavior
Please feel free to modify and use to your hearts content I am always happy to try to answer questions as well.

No comments: