如何在Windows中使用CMD执行摇篮的命令? [英] How to execute a command in windows cmd using Gradle?

查看:164
本文介绍了如何在Windows中使用CMD执行摇篮的命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用摇篮才能执行此命令。

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"'
}

但这种失败,错误。\\建立\\ build.exe,该系统找不到指定的文件。我需要运行与工作目录作为outer_build程序。

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 ?

推荐答案

好吧,我得到了这个问题。看起来像窗口,我们必须这样写

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"'
}

这篇关于如何在Windows中使用CMD执行摇篮的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆