gradle 컴파일러가 있는vim dispatch 플러그인은 작동하지 않습니다

7665 단어 vim-dispatch

묘사

저는vimandroid 플러그인(hsanson/vimandroid)을 가지고 있습니다.gradle을 사용하여Nvim으로android 프로젝트를 구축합니다.플러그 인에는 다음과 같은 기능을 사용하여 프로젝트를 구성할 수 있습니다.
let &makeprg = "gradle --no-color assembleDebug"
let &shellpipe='2>'
silent! make
구성 오류가 발생하면 quickfix 창이 열리고 다음과 같은 오류가 표시됩니다. 문제가 있는 파일과 줄로 쉽게 이동할 수 있습니다.
prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:compileDebug
/home/hsanson/Projects/GeoLuis/geoalert-android/src/jp/co/suj/android/geoalert/LoginActivity.java:47: エラー: <identifier>がありません
  rivate final static String TAG = LoginActivity.class.getSimpleName();
        ^
エラー1個
:compileDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebug'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
현재, 나는vim dispatch를 사용하여 구축 과정을 비동기적으로 하려고 시도하는데, 이를 위해 다음과 같은 방법을 사용했다.
let &makeprg = "gradle --no-color assembleDebug"
let &shellpipe='2>'
silent! exe 'Make'
불행하게도, 일부 원인으로 인해quickfix 창의 내용이 모두 손상되었습니다. 보기에 다음과 같습니다.
| > Building > :compileDebugAidl^[[20D^[[0K^[[10D^[[0K:compileDebugAidl·
|| > Building^[[10D^[[0K^[[1A^[[18CUP-TO-DATE
|| > Building^[[10D^[[0K^[[1A^[[28C
|| > Building > :compileDebugRenderscript^[[28D^[[0K^[[10D^[[0K:compileDebugRenderscript·
|| > Building^[[10D^[[0K^[[1A^[[26CUP-TO-DATE
|| > Building^[[10D^[[0K^[[1A^[[36C
|| > Building > :generateDebugBuildConfig^[[28D^[[0K^[[10D^[[0K:generateDebugBuildConfig·
|| > Building^[[10D^[[0K^[[1A^[[26CUP-TO-DATE
|| > Building^[[10D^[[0K^[[1A^[[36C
|| > Building > :mergeDebugAssets^[[20D^[[0K^[[10D^[[0K:mergeDebugAssets·
|| > Building^[[10D^[[0K^[[1A^[[18CUP-TO-DATE
|| > Building^[[10D^[[0K^[[1A^[[28C
|| > Building > :mergeDebugResources^[[23D^[[0K^[[10D^[[0K:mergeDebugResources·
|| > Building^[[10D^[[0K^[[1A^[[21CUP-TO-DATE
|| > Building^[[10D^[[0K^[[1A^[[31C
|| > Building > :processDebugManifest^[[24D^[[0K^[[10D^[[0K:processDebugManifest·
|| > Building^[[10D^[[0K^[[1A^[[22CUP-TO-DATE
|| > Building^[[10D^[[0K^[[1A^[[32C
|| > Building > :processDebugResources^[[25D^[[0K^[[10D^[[0K:processDebugResources
|| > Building > :generateDebugSources^[[24D^[[0K^[[10D^[[0K:generateDebugSources
|| > Building > :compileDebug^[[26D^[[0K:compileDebug
> Building > :compileDebug^[[26D^[[0K/home/hsanson/Projects/GeoLuis/geoalert-android/src/jp/co/suj/android/geoalert/LoginActivity.java|47| error: <identifier> expected                                                                         
|| > Building > :compileDebug^[[26D^[[0K  rivate final static String TAG = LoginActivity.class.getSimpleName();
|| > Building > :compileDebug^[[26D^[[0K        ^   
|| > Building > :compileDebug^[[26D^[[0K1 error
|| > Building > :compileDebug^[[16D^[[0K^[[10D^[[0K:compileDebug·
|| > Building^[[10D^[[0K^[[1A^[[14CFAILED
|| > Building^[[10D^[[0K^[[1A^[[20C
|| > Building^[[10D^[[0K
|| > Building^[[10D^[[0KFAILURE:·
|| > Building^[[10D^[[0K^[[1A^[[9CBuild failed with an exception.
|| > Building^[[10D^[[0K^[[1A^[[40C
|| > Building^[[10D^[[0K
|| > Building^[[10D^[[0K* What went wrong:
|| > Building^[[10D^[[0KExecution failed for task ':compileDebug'.
|| > Building^[[10D^[[0K>·
|| > Building^[[10D^[[0
출력에 일부 전의코드가 있고 stderr와 stdout가 혼합되어 있기 때문에 문제가 있는 파일과 줄 번호를 일치시키기 어렵다.나는 여러 가지 다른 조개관을 시도했지만 성공하지 못했다.
vim dispatch를 통해 이 점을 어떻게 실현하는지 아십니까?vim dispatch에 stderr나 stdout을 생성된makeef 파일 대신 stderr나 stdout로 바꿀 수 있는 옵션을 추가할 수 있습니까?

토론 #1

어떤 프로세서를 사용하고 계십니까?다른 거 해봤어요?

토론 #2

헤더 프로세서를 사용해서 저의vimrc에 추가했습니다.
let g:dispatch_handlers = [ 'headless' ] 
내 vimrc와 화면 세션에 다음과 같은 내용을 포함하는 화면 프로세서도 있습니다.
let g:dispatch_handlers = [ 'screen' ] 
이 두 가지 상황에서 구축 과정은vim를 막았다.tmux를 사용해야만, 나는vim를 막지 않고 구축 과정을 보여주는 예쁜 창을 얻을 수 있다.
헤드 프로세서에 대한 그의 행동은 완전히:make이다.Vim에 배경이 있는 것 같습니다. 구축 과정이 진행 중입니다.완료 후,quickfix 창이 열린 상태에서vim를 회복합니다.
화면 처리 프로그램에vim에 배경이 없습니다.반대로 구축 과정은vim 편집기의 밑에 표시됩니다. (상태 줄?)완료되면 quickfix 창이 열립니다.
이 두 가지 상황에서,quickfix 창의 출력은 모두 손상되지 않았으며, 나는 오류 사이를 정확하게 전환할 수 있다.

토론 #셋

이므로 헤드나 스크린이 전경 구축을 지원하지 않습니다.그것들은 :Make!에만 적용된다.왜 다른지 모르겠지만 g:dispatch_handlers을 속이고 silent!을 꾸준히 사용하는 사이에 나는 놀라지 않았다.
tmux의 경우 이 어댑터는 사실상 'shellpipe'을 존중하지 않는 유일한 어댑터로 전체 tmux 창을 포획하는 것을 선택했다.만약 'shellpipe'2>&1과 유사하다면, 이를 단지 이렇게 하는 것으로 복원해야 할 것이다.dispatch#tmux#make()에는 두 가지 변경 사항이 필요합니다. 두 번째 파라미터를 dispatch#prepare_make()tmux pipe-pane 업무에 넣으면 작동할 수 있을 것입니다.
그나저나 이 파이프 창춤의 모든 원인은 색깔을 나타내기 위해서다.그들은 포획된 출력에서 sed에 의해 박리되었다.우리는 당연히 이 다른 전의코드를 삭제할 수 있지만, 나는 결과를 받아들일 수 있을지 확실하지 않다.

토론 #4

사실 당신이 언급한 변화에 따라 모든 것이 완벽합니다.다음은 제가 변경한 내용입니다.
diff --git a/autoload/dispatch/tmux.vim b/autoload/dispatch/tmux.vim
index 3298320..5a89dc8 100644
--- a/autoload/dispatch/tmux.vim
+++ b/autoload/dispatch/tmux.vim
@@ -33,7 +33,8 @@ endfunction

 function! dispatch#tmux#make(request) abort
   let session = get(g:, 'tmux_session', '')
-  let script = dispatch#isolate(dispatch#prepare_make(a:request, a:request.expanded))
+  " let script = dispatch#isolate(dispatch#prepare_make(a:request, a:request.expanded))
+  let script = dispatch#isolate(dispatch#prepare_make(a:request))

   let title = shellescape(get(a:request, 'compiler', 'make'))
   if get(a:request, 'background', 0)
@@ -54,7 +55,8 @@ function! dispatch#tmux#make(request) abort
     let filter .= ' -u'
   endif
   let filter .= " -e \"s/\r//g\" -e \"s/\e[[0-9;]*m//g\" > ".a:request.file
-  call system('tmux ' . cmd . '|tee ' . s:make_pane . '|xargs -I {} tmux pipe-pane -t {} '.shellescape(filter))
+  " call system('tmux ' . cmd . '|tee ' . s:make_pane . '|xargs -I {} tmux pipe-pane -t {} '.shellescape(filter))
+  call system('tmux ' . cmd . '|tee ' . s:make_pane )

   let pane = get(readfile(s:make_pane, '', 1), 0, '')
   return s:record(pane, a:request)

토론 #5

나는 문제가 실제로 복구될 때까지 기다렸지만, 나는 이것이 단지 나일 뿐이라고 생각한다.

토론 #6

내가 gradlew를 사용하는 경우 org.gradle.console=plaingradle.properties을 추가해야 한다
https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
테스트 결과를 열려면 클릭하십시오.
|** 이전에는
|:-------------------------:|
| |
|** 이후
|:-------------------------:|
| |

좋은 웹페이지 즐겨찾기