我具有低於命令在一個.txt-file
:如何使用gradle中的文件執行多個參數的命令?
java -jar /path/to/something.jar --classpath="/path/to/something/other.jar" --url="something:@127.0.0.1:1234:TEST12" --driver=some.driver update
可以看出用不同的語法的多個參數(-
,--
,和/或具有和不具有""
)被使用。
我嘗試下面的代碼:
task test(type: Exec) {
workingDir '/path/to/working/dir'
String commandFromFile = new File('/path/to/file/with/command' + 'filewithcommand.txt').getText('UTF-8')
commandLine commandFromFile
}
在此代碼工作的Windows平臺,但是,unix
事實並非如此。