Dear my friends,
I faced a problem when executing external program with Gradle. Hope you will help me to solve this. Thank you all
PS: I used Gradle for an embedded project (C language not a Java project)
I will describe my problem:
- My development environment is Ubuntu.
- I used an external program for Unit test (It is called Cantata), From Linux I will type a command â./cantppâ to invoke its GUI (eclipse based)
- After finishing working on GUI I will integrate last result to Gradle so that Gradle will invoke a command line to generate Test Report.
The command line like below:
$CANTATA_INSTALL_DIR/cantpp -application com.ipl.products.eclipse.cantpp.testscript.TestSummaryGenerator -noSplash -data Cantata/UnitTest project=Cantata/UnitTest/abcdef 1 (with this command like on shell the GUI will not be invoked by option â-noSplashâ, and I get the report successfully)
And Gradle code for that command line is:
def commandArray = new String[3]
commandArray[0] = System.getenv(âCANTATA_INSTALL_DIRâ) + "/cantpp"
commandArray[1] = "application"
commandArray[2] = "com.ipl.products.eclipse.cantpp.testscript.TestSummaryGenerator -noSplash -data Cantata/UnitTest project=Cantata/UnitTest/gDMPxy 1"
def process = new ProcessBuilder(commandArray)
.directory(new File(curPath))
.redirectErrorStream(true)
.start()
process.inputStream.eachLine {println it}
process.waitFor();
But unfortunately, when Gradle is running, the GUI is invoked so the command line is not executed like I expect.
So my question is âAre there any ways to execute the command line in Gradle which the GUI is not invoked?â
Thanks and Best regards
Tuan