jww*_*jww 10 visual-studio appveyor
我们分发一组Visual Studio 2010项目文件.用户需要升级以适应他们的口味.我们的.appveyor.yml文件包括以下图像(除了配置和平台):
Visual Studio 2017构建失败:
Build started
git clone -q --depth=3 --branch=master https://github.com/noloader/cryptopp.git C:\projects\cryptopp
git checkout -qf 3504f1da2591d8b84e356527ed41dc6209eafa06
msbuild "C:\projects\cryptopp\cryptest.sln" /verbosity:minimal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
Microsoft (R) Build Engine version 15.1.1012.6693
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution". [C:\projects\cryptopp\cryptlib.vcxproj]
Command exited with code 1
Run Code Online (Sandbox Code Playgroud)
感兴趣的文本是:
错误MSB8020:找不到Visual Studio 2010(Platform Toolset ='v100')的构建工具.要使用v100构建工具进行构建,请安装Visual Studio 2010构建工具.或者,您可以通过选择"项目"菜单或右键单击解决方案,然后选择"重新定位解决方案"来升级到当前的Visual Studio工具.
当我使用开发人员命令提示时,我运行VCUpgrade或使用GitBash并sed -i s'|Tools>v100|Tools>v120' *vcxproj*更改平台工具集.
当我尝试通过AppVeyor运行它时test_script:,它会导致另一个失败.例如,从1.0.131构建日志:
...
vcupgrade.exe -nologo -overwrite cryptlib.vcxproj
'vcupgrade.exe' is not recognized as an internal or external command,
operable program or batch file.
Command exited with code 1
Run Code Online (Sandbox Code Playgroud)
我的问题是,我们如何告诉Appveyor更改平台工具集?是否有步骤或配置选项运行VCUpgrade?或者我们还做其他事情?
这是在本地运行VCUpgrade时提供的帮助:
> vcupgrade
Microsoft (R) Visual C++ Project Convert Utility - Version 11.00.61030
Copyright (C) Microsoft Corporation. All rights reserved.
Usage: VCUpgrade [options] <project file>
Options:
-nologo Suppresses the copyright message
-nocolor Do not output error and warning messages in color
-overwrite Overwrite existing files
-PersistFramework Keep the Target Framework Version while upgrading. (-p)
Run Code Online (Sandbox Code Playgroud)
AppVeyor目前为VS 2013,2015和2017提供构建工作者映像.抱歉,暂时没有计划添加VS 2010和2012.
有趣的选择可能是自定义构建环境.它是"混合"解决方案,您拥有基础架构和映像,AppVeyor提供UI和编排.对于文档天青和Hyper-V的现已上市,为其他供应商的文档是它的方式.
请注意,自定义构建环境现在可供Premium计划客户使用.如果您想尝试,请发送电子邮件至appveyor.com团队.
根据使用的工具集,VCUpgrade可能不存在.例如,我有它用于VS2013,VS2015但不用于VS2017.相应的功能devenv /upgrade my.vcxproj虽然至少可以从VS2013获得,可能更早.您可以将它作为Appveyor中的额外构建步骤运行,如果不是您使用devenv不想触摸的自定义项目文件布局.
要么让你的项目文件有多个版本VS在您的项目文件$(DefaultPlatformToolset)取代V100,因为兼容奠定了在其他问题上的这个问题上,或手动替换V100.我不知道默认情况下appveyor是否已在路径中进行了sed,但您可以改为使用Powershell构建,PS具有类似sed的功能.您需要根据使用的构建工作器映像手动派生工具集.像这样的东西可以解决问题:
configuration:
- Debug
- Release
platform:
- x86
- x64
image:
- Visual Studio 2017
- Visual Studio 2015
- Visual Studio 2013
build_script:
- ps: >-
if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2013") {
$PlatformToolset = "v120"
} elseif ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") {
$PlatformToolset = "v140"
} else {
$PlatformToolset = "v141"
}
(Get-Content cryptlib.vcxproj) | %{$_ -replace "v100", $PlatformToolset} | Set-Content cryptlib.vcxproj
(Get-Content cryptest.vcxproj) | %{$_ -replace "v100", $PlatformToolset} | Set-Content cryptest.vcxproj
& msbuild cryptlib.vcxproj "/p:platform=$env:platform;configuration=$env:configuration"
& msbuild cryptest.vcxproj "/p:platform=$env:platform;configuration=$env:configuration"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
278 次 |
| 最近记录: |