config/.vim/eclim/doc/vim/java/ant/execute.txt

95 lines
2.6 KiB
Plaintext
Raw Normal View History

*vim-java-ant-execute*
Ant Execution
*************
For those that use Vim as an editor and ant as a build tool, is is
common to set your Vim 'makeprg' option to execute ant so that you may
navigate compilation errors via Vim's quickfix functionality.
Eclim utilizes this same paradigm to provide users with ant execution
functionality from any file without any of the setup required by Vim.
*:Ant*
Eclim provides the following command:
:Ant [<target> ...]
which performs the following steps:
- Saves any previous 'makeprg' and 'errorformat' option settings so
that you can define your own settings for the :make command.
- Sets 'makeprg' to execute ant with the -find option so that it will
search for your build.xml file in the current directory or in a
parent directory.
- Sets 'errorformat' to recognize the following errors:
- javac errors.
- javadoc errors.
- jasper jsp compilattion errors.
- junit errors / failures.
- cactus errors / failures.
- Executes :make.
- Restores your previous 'makeprg' and 'errorformat' option settings.
Additionally, if g:EclimMakeLCD (|g-eclimmakelcd|) is enabled (which
it is by default), then the execution of ant will be performed from
the current buffer's local directory, ensuring that ant's build file
discovery method is performed from the buffer's working directory and
not your own.
Note: :Ant also supports use of '!' (:Ant!) just like :make does, which
tells Vim not to jump to the first error if one exists.
The :Ant command also has the added benefit of command completion.
>
:Ant com<Tab>
:Ant compile
<
Warning: If your ant file has a lot of imports, then the command completion
may be slow as Eclipse parses all the imports when creating the ant
model. You will notice the same slow behavior when using Eclipse
directly to perform ant code completion.
Configuration
=============
Vim Variables
*g:EclimAntCompilerAdditionalErrorFormat*
- g:EclimAntCompilerAdditionalErrorFormat (Default: '') - Since there
are many more ant tasks beyond javac, javadoc, etc., eclim provides
this variable as a means to add error format information for any
additional ant tasks that you may be using.
Example: Adding support for xslt
>
let g:EclimAntCompilerAdditionalErrorFormat =
\ '\%A%.%#[xslt]\ Loading\ stylesheet\ %f,' .
\ '\%Z%.%#[xslt]\ %.%#:%l:%c:\ %m,'
<
Note: The xslt task is a bit flaky when it comes to reporting the file
name on errors, so the above format will catch successful runs as
well. If anyone has a better solution, please submit it.
vim:ft=eclimhelp