【问题标题】:Running Cygwin commands from batch file从批处理文件运行 Cygwin 命令
【发布时间】:2011-10-24 20:26:26
【问题描述】:

我的项目是一个 AndroidNDK 项目,需要一些构建命令才能从 Cygwin(或 Unix 环境)运行。有没有办法使用 TeamCity 做到这一点?

我尝试使用命令行构建步骤并传入一个批处理文件,该文件首先启动 cygwin,然后执行我需要的构建命令。但是这不起作用,它所做的只是启动 cygwin,但我的 unix 命令在此之后没有被执行。

【问题讨论】:

    标签: android cygwin android-ndk


    【解决方案1】:

    你是如何从 cygwin 启动和运行命令的?

    您必须执行bash -c "command you want to run"(假设 bash.exe 在路径上)。只需调用 bash 然后发出命令就会启动 bash。

    【讨论】:

    • 我试过这个,但这给了我 ndk-build 脚本的一些错误,即'line 40: dirname: command not found ERROR: Cannot find 'make' program。请安装 Cygwin make 包或定义 GNUMAKE 变量以指向它。我想从 Cygwin 运行的命令是 $NDK_ROOT/ndk-build。如果我尝试 bash --login -i MyBashScript,其中 MyBashScript 包含 $NDK_ROOT/ndk-build,我会走得更远一点,但是我会得到 Could not find application project directory ! Please define the NDK_PROJECT_PATH... 否则,如果我手动启动 Cygwin 并运行 ndk-build,一切正常。
    • 我最终使用了一个 bash 脚本并从批处理文件中调用我的命令。出于某种原因,我必须使用bash --login -i,然后是我的 bash 脚本名称。感谢您的帮助!
    【解决方案2】:

    我用过 cygwinonce。我尝试做你想做的类似事情。我想用默认命令启动 cygwin。 bash --login -i myBashScript.exe 仅当我们将 myBashScript.exe 粘贴到 bin 文件夹中时。

    【讨论】:

    • 这似乎不是答案。
    猜你喜欢
    • 1970-01-01
    • 2013-10-02
    • 2022-01-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-22
    相关资源
    最近更新 更多