使用 CSPROJ 和 AppVeyor {build} 的部分版本获取 2.0.x 样式内部版本号的语法是什么?
What is the syntax to use part of the version from CSPROJ and AppVeyor {build} to get a 2.0.x style build number?
是否可以让 AppVeyor 构建使用 csproj 文件中的构建号,但将 'patch' 版本替换为 {build}
变量?
例如:
CSPROJ: <Version>2.1.0</Version>
AppVeyor: ??? What goes here? Manually setting 2.1.{build} will work but then to rev to 2.2, we have to update appveyor AND csproj.
Output: 2.1.15 (assuming build number is 15)
内置的 AppVeyor 修补系统是否可能?
这应该有效。只需替换 $xmlPath
中的子文件夹和文件名
install:
- ps: |
$xmlPath = "$env:appveyor_build_folder\mysubfolder\myproject.csproj"
$xml = [xml](get-content $xmlPath)
$version = ($xml.Project.PropertyGroup | ? {$_.Version}).Version
$env:newversion = ($version.Substring(0, $version.LastIndexOf(".") + 1)) + $env:appveyor_build_number
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: $(newversion)
package_version: $(newversion)
assembly_version: $(newversion)
file_version: $(newversion)
informational_version: $(newversion)
是否可以让 AppVeyor 构建使用 csproj 文件中的构建号,但将 'patch' 版本替换为 {build}
变量?
例如:
CSPROJ: <Version>2.1.0</Version>
AppVeyor: ??? What goes here? Manually setting 2.1.{build} will work but then to rev to 2.2, we have to update appveyor AND csproj.
Output: 2.1.15 (assuming build number is 15)
内置的 AppVeyor 修补系统是否可能?
这应该有效。只需替换 $xmlPath
install:
- ps: |
$xmlPath = "$env:appveyor_build_folder\mysubfolder\myproject.csproj"
$xml = [xml](get-content $xmlPath)
$version = ($xml.Project.PropertyGroup | ? {$_.Version}).Version
$env:newversion = ($version.Substring(0, $version.LastIndexOf(".") + 1)) + $env:appveyor_build_number
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: $(newversion)
package_version: $(newversion)
assembly_version: $(newversion)
file_version: $(newversion)
informational_version: $(newversion)