| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html lang="en"> |
| <head> |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2009. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <meta http-equiv="Content-Style-Type" content="text/css"> |
| <link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type="text/css"> |
| <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js" type="text/javascript"> </script> |
| <title>Creating Ant buildfiles</title> |
| </head> |
| <body> |
| <h1>Creating Ant buildfiles</h1> |
| |
| <p> Ant buildfiles are just text files, so the most straightforward |
| way to create an Ant buildfile in Eclipse is:</p> |
| <ol> |
| <li><b>File > New > File</b>.</li> |
| <li>Enter a name for the file.</li> |
| <li>Click <b>Finish</b>.</li> |
| </ol> |
| <p> |
| By default the <a href="../reference/ref-anteditor.htm">Ant editor</a> only has an association with <code>build.xml</code> named files. |
| As the user you can designate the Ant editor to be considered for all xml |
| files. |
| </p> |
| <ol> |
| <li>File associations can be set using the <a class="command-link" href='javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.ui.preferencePages.FileEditors)")'> |
| <img src="PLUGINS_ROOT/org.eclipse.help/command_link.png" alt="Opens the File Associations preference page"><b> Window > Preferences > General > Editors >File Associations</b></a></li> |
| <li>Add an association between <code>*.xml</code> and the <a href="../reference/ref-anteditor.htm">Ant editor</a>.</li> |
| </ol> |
| |
| <p>Now, as long as the file has a .xml extension, Eclipse will consider it to be a |
| possible Ant buildfile, and will enable Ant-related actions when it is selected. |
| Until a file has Ant buildfile content, you will need to open it using <b>Open With > <a href="../reference/ref-anteditor.htm">Ant Editor</a></b>.</p> |
| <p>An example is the use of <a href="qs-92_project_builders.htm">project builders</a>, where an Ant buildfile is created |
| for an Eclipse plug-in that contains predefined targets that are useful for deploying the plug-in.</p> |
| <p> |
| <img border="0" src="../images/ngrelt.png" alt="Related tasks" ><br> |
| <a href="qs-83_edit.htm">Editing Ant buildfiles</a><br> |
| <a href="qs-84_run_ant.htm">Running Ant buildfiles</a><br> |
| <a href="qs-85_ant_configs.htm">Saving & Reusing Ant options</a><br> |
| <a href="qs-84_run_ant.htm">Running Ant buildfiles</a><br> |
| <a href="qs-93_project_builder.htm">Creating a project builder Ant buildfile</a><br> |
| <a href="qs-92_project_builders.htm">Ant buildfiles as project builders</a><br> |
| <a href="qs-94_run_pj.htm">Executing project builders</a><br> |
| <a href="qs-95_external_tools.htm">External tools</a><br> |
| <a href="qs-96_non_ant_pjs.htm">Non-Ant project builders</a><br> |
| <a href="qs-97_standalone_ets.htm">Stand-alone external tools</a> |
| </p> |
| </body> |
| </html> |