mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 13:14:29 +08:00
feat(javac): Add java_javac_sourcepath variable
This variable can set multiple source code paths, the source code path is a relative path (relative to the project root directory)
This commit is contained in:
@@ -6,6 +6,7 @@ let s:classpath_sep = has('unix') ? ':' : ';'
|
|||||||
call ale#Set('java_javac_executable', 'javac')
|
call ale#Set('java_javac_executable', 'javac')
|
||||||
call ale#Set('java_javac_options', '')
|
call ale#Set('java_javac_options', '')
|
||||||
call ale#Set('java_javac_classpath', '')
|
call ale#Set('java_javac_classpath', '')
|
||||||
|
call ale#Set('java_javac_sourcepath', [])
|
||||||
|
|
||||||
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
|
function! ale_linters#java#javac#RunWithImportPaths(buffer) abort
|
||||||
let l:command = ''
|
let l:command = ''
|
||||||
@@ -79,6 +80,16 @@ function! ale_linters#java#javac#GetCommand(buffer, import_paths, meta) abort
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let l:sourcepath_item = ale#Var(a:buffer, 'java_javac_sourcepath')
|
||||||
|
if !empty(l:sourcepath_item)
|
||||||
|
for l:sourcepath in l:sourcepath_item
|
||||||
|
let l:sp_path = ale#path#FindNearestDirectory(a:buffer, l:sourcepath)
|
||||||
|
if !empty(l:sp_path)
|
||||||
|
call add(l:sp_dirs, l:sp_path)
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
|
||||||
if !empty(l:sp_dirs)
|
if !empty(l:sp_dirs)
|
||||||
let l:sp_option = '-sourcepath '
|
let l:sp_option = '-sourcepath '
|
||||||
\ . ale#Escape(join(l:sp_dirs, s:classpath_sep))
|
\ . ale#Escape(join(l:sp_dirs, s:classpath_sep))
|
||||||
|
|||||||
@@ -67,6 +67,21 @@ g:ale_java_javac_options *g:ale_java_javac_options*
|
|||||||
|
|
||||||
This variable can be set to pass additional options to javac.
|
This variable can be set to pass additional options to javac.
|
||||||
|
|
||||||
|
g:ale_java_javac_sourcepath *g:ale_java_javac_sourcepath*
|
||||||
|
*b:ale_java_javac_sourcepath*
|
||||||
|
Type: |List|
|
||||||
|
Default: `[]`
|
||||||
|
|
||||||
|
This variable can set multiple source code paths, the source code path is a
|
||||||
|
relative path (relative to the project root directory).
|
||||||
|
|
||||||
|
Example:
|
||||||
|
>
|
||||||
|
let g:ale_java_javac_sourcepath = [
|
||||||
|
\ 'build/generated/source/querydsl/main',
|
||||||
|
\ 'target/generated-sources/source/querydsl/main'
|
||||||
|
\ ]
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
google-java-format *ale-java-google-java-format*
|
google-java-format *ale-java-google-java-format*
|
||||||
|
|||||||
Reference in New Issue
Block a user