TFS构建不复制Cordova项目输出 [英] TFS build does not copy Cordova project output

查看:98
本文介绍了TFS构建不复制Cordova项目输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio Tools在Visual Studio 2013 Update 4中开发用于Apache Cordova CTP 3.1的Visual Studio Tools开发的Cordova项目。我已经为该项目创建了TFS构建定义(我正在使用TFS 2013)该项目。我得到正确的输出,但是此输出未复制到指定的放置位置或其他任何位置。

I am working on a Cordova project developed with Visual Studio Tools for Apache Cordova CTP 3.1 in Visual Studio 2013 Update 4. I have created a TFS build definition (I'm using TFS 2013) for the project that is able to build the project. I get the correct output, but this output is not copied to the specified dropped location or anywhere else.

我尝试了很多事情,但没有任何效果。我认为这必须与 .jsproj 未定义和 OutputType OutputPath 进行任何配置。

I have tried a lot of things and nothing worked. I believe it must be related to the fact that the .jsproj does not define and OutputType or an OutputPath for any configuration.

构建默认值暂存位置的构建定义中, 将构建输出复制到以下放置文件夹。我得到的只是日志。

In the build definition for Staging location in Build defaults I have selected Copy build output to the following drop folder. All I get there is the logs.

请参见下图。 src 文件夹包含源,并且在构建后包含Cordova构建的输出( bin bld )。但是,我希望将 bin\Android\Release 中的内容复制到上层 bin 文件夹中(如图所示),最终将其复制到放置位置。

See the image below. the src folder contains the sources and after the build the output of the Cordova build (bin and bld). However, I'd expect the content from bin\Android\Release to be copied to the upper level bin folder (as seen in the picture) and eventually on the drop location. This does not happen.

我们将提供任何帮助。

推荐答案

您可以使用PowerShell

You can use a PowerShell script to get this to work.

$packages = gci $Env:TF_BUILD_SOURCESDIRECTORY -recurse -include $("bin") | ?{ $_.PSIsContainer } | foreach { gci -Path $_.FullName -Recurse -include $("*.apk", "*.ipa", "*.plist", "*.xap") }
foreach ($file in $packages) {
    Copy $file $Env:TF_BUILD_BINARIESDIRECTORY
}
gci $Env:TF_BUILD_SOURCESDIRECTORY -recurse -include $("AppPackages") | ?{ $_.PSIsContainer } | Copy -Destination $Env:TF_BUILD_BINARIESDIRECTORY –Recurse -Force 

将其放入解决方案根目录下的解决方案文件夹中

Put this in a solution folder in the solution root so that it doesn't get added to the app package and check this in with your solution.

然后在您的TFS构建定义中添加一个构建后脚本指向此脚本。

Then in your TFS build definition add a "Post-build script" that points to this script.

这篇关于TFS构建不复制Cordova项目输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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