2016-06-17 23 views
2

です。どのようにしてproject.execまたはExecタスクを実行すると、コマンドラインに関するすべての情報が表示されないのですか?Gradle Execタスクのパスワードは

コード

 project.exec { 
      workingDir = exeDir.absolutePath 
      executable = starter.absolutePath 
      args = commandLine.split().toList() 
      environment << envVars 
      project.logging.captureStandardOutput LogLevel.INFO 
      standardOutput = outputStream 
      errorOutput = outputStream 
     } 

出力

Starting process 'command 'regexIdentifier''. Working directory: 
/home/code/ Command: /home/code/bin/regexIdentifier server username 
password ... 
Successfully started process 'command '/home/code/bin/regexIdentifier'' 

私はGradleのExecのタスクを経由してパスワードでcmdを実行する必要があるとのGradleは、実行時にコマンドラインを表示しないようにしたいです

答えて

1

あなたがstandardOutputとERROROUTPUTをオーバーライドすることで、デフォルトで出力を印刷からGradleのExecのタスクを保つことができる。しかし、これはあなたが--infoフラグ付きで実行したときに現れてからコマンドを防ぐことはできません

standardOutput = new ByteArrayOutputStream() 
errorOutput = new ByteArrayOutputStream() 

をストリーミングします。

関連する問題