Java checker: fix path detection.

This commit is contained in:
LCD 47 2015-02-20 09:47:43 +02:00
parent 776d4175cd
commit cf4e18d3f7
2 changed files with 5 additions and 3 deletions

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START
endif
let g:_SYNTASTIC_VERSION = '3.6.0-28'
let g:_SYNTASTIC_VERSION = '3.6.0-29'
lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1

View File

@ -388,13 +388,15 @@ function! s:MavenOutputDirectory() " {{{2
if has_key(mvn_properties, 'project.properties.build.dir')
let output_dir = mvn_properties['project.properties.build.dir']
endif
if stridx(expand('%:p:h', 1), 'src.main.java') >= 0
let sep = syntastic#util#Slash()
if stridx(expand('%:p:h', 1), join(['src', 'main', 'java'], sep)) >= 0
let output_dir .= '/target/classes'
if has_key(mvn_properties, 'project.build.outputDirectory')
let output_dir = mvn_properties['project.build.outputDirectory']
endif
endif
if stridx(expand('%:p:h', 1), 'src.test.java') >= 0
if stridx(expand('%:p:h', 1), join(['src', 'test', 'java'], sep)) >= 0
let output_dir .= '/target/test-classes'
if has_key(mvn_properties, 'project.build.testOutputDirectory')
let output_dir = mvn_properties['project.build.testOutputDirectory']