I am trying to execute this command using Gradle .
.\build\build.exe parse /p 246 /o ".\strings.xml.bcg" /novalidate /l 1033 /sr "@LbaRoot@\settings\default\lss\default.config" "..\app\src\main\res\values\strings.xml"
This works fine when I execute in command Line. I am trying to replicate the behaviour using Gradle
task runLSBuild(type:Exec) {
workingDir '../outer_build'
//on windows:
commandLine '.\\build\\build.exe','parse /p 246 /o ".\\strings.xml.bcg" /novalidate /l 1033 /sr "@LbaRoot@\\settings\\default\\lss\\default.config" "..\\app\\src\\main\\res\\values\\strings.xml"'
}
But this fails with error ".\build\build.exe", The system cannot find the file specified. I need to run the program with working directory as outer_build.
Any suggestions on where am I going wrong ?
Press ⌃⌃ (macOS), or Ctrl+Ctrl (Windows/Linux), type "gradle" followed by the gradle task name or names. We can, of course, run Gradle commands from the terminal window inside IntelliJ IDEA. Open this with ⌥F12 (macOS), or Alt+F12 (Windows/Linux).
Use the command ./gradlew test to run all tests.
We first read the arguments from a project property. Since this contains all the arguments as one string, we then use the split method to obtain an array of arguments. Next, we pass this array to the args property of our JavaExec task.
You can run the application by executing the run task (type: JavaExec). This will compile the main source set, and launch a new JVM with its classes (along with all runtime dependencies) as the classpath and using the specified main class.
Ok I got the issue . Looks like for windows, we have to write like this
task runLSBuild(type:Exec) {
workingDir '../outer_build'
//on windows:
commandLine "cmd","/c",'.\\build\\build.exe parse /p 246 /o ".\\strings.xml.bcg" /novalidate /l 1033 /sr "@LbaRoot@\\settings\\default\\lss\\default.config" "..\\app\\src\\main\\res\\values\\strings.xml"'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With