]> git.madduck.net Git - etc/vim.git/blob - autoload/ale/java.vim

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Squashed '.vim/bundle/ale/' content from commit 22185c4c
[etc/vim.git] / autoload / ale / java.vim
1 " Author: Horacio Sanson https://github.com/hsanson
2 " Description: Functions for integrating with Java tools
3
4 " Find the nearest dir contining a gradle or pom file and assume it
5 " the root of a java app.
6 function! ale#java#FindProjectRoot(buffer) abort
7     let l:gradle_root = ale#gradle#FindProjectRoot(a:buffer)
8
9     if !empty(l:gradle_root)
10         return l:gradle_root
11     endif
12
13     let l:maven_pom_file = ale#path#FindNearestFile(a:buffer, 'pom.xml')
14
15     if !empty(l:maven_pom_file)
16         return fnamemodify(l:maven_pom_file, ':h')
17     endif
18
19     let l:ant_root = ale#ant#FindProjectRoot(a:buffer)
20
21     if !empty(l:ant_root)
22         return l:ant_root
23     endif
24
25     return ''
26 endfunction