Java Reference
In-Depth Information
If you're using IDEA on a Mac, you may have difficulty launching appli-
cations that are distributed in Apple's application bundle format (.app
files). To launch this type of application, launch the application with the
/usr/bin/open command. Enter /usr/bin/open in the command
field, and use the -a parameter to specify the path to the application
bundle. For example, to launch the OSX file merge tool, enter -a /De-
veloper/Applications/FileMerge.app in the Parameters field.
TIP
Specifying which program to run
Enter the name of the external executable in the Program field to specify which
program to run. If the executable isn't in your system's normal execution path,
enter the full path to the program. To pass arguments or parameters to the pro-
gram, enter them in the Parameters field just as you enter them on the command
line. If there are spaces in any of the arguments, surround the entire argument in
double quotes. In the Wo rk i ng d ire c t or y field, you can select the current working
directory within which the program is executed. If this field is left blank, IDEA 's
default project directory is used. You can use the browse buttons next to the Pro-
gram and Working directory fields to make a selection from your local file system.
Setting up external tools in IDEA is most useful when the tool is designed to
act on a file in your project. Otherwise, it's just a glorified shortcut. IDEA 's ability
to pass contextual information from your project, such as the currently selected
file, to the program makes this feature useful. To integrate with an application in
this way, the program must be able to accept arguments from the command line.
Fortunately, most of the types of applications you might want to integrate, such as
compilers and code builders, are designed to be called from the command line
and operate in this fashion. There's no limit to the types of applications you may
want to use through the external tool. If you use Ant, you may already be familiar
with launching external tools as part of your build process.
Using macros for arguments
To pass project-relevant arguments to your external program, you need to use
IDEA 's macro facility. Macros let you specify values that are resolved at runtime
based on the context under which your tool was called. You can use macros to
help define the program's parameters, its working directory, or even the program
executable. Table 13.3 lists the available macros.
Macros are surrounded by dollar signs in your external tool settings. So, the
macro for the project name is written $ ProjectName $ . In addition, macros are
case sensitive. You can type macros by hand, if you'd like, but it's easier to click
the Insert macro button to select one from the list provided.
 
 
 
 
 
Search WWH ::




Custom Search