简体   繁体   English

MyGet和Cake,生成版本号

[英]MyGet and Cake, generate version number

I'm using a custom cake build script w/ MyGet. 我正在使用带MyGet的自定义蛋糕构建脚本。 I had previously used a line like so on AppVeyor 我以前在AppVeyor上使用了这样的一行

var version = AppVeyor.IsRunningOnAppVeyor ? AppVeyor.Environment.Build.Version : "0.0.1";

to get a version number from the build CI platform. 从构建CI平台获取版本号。 However on MyGet I have a MyGet.IsRunningOnMyGet but I don't seem to have a build version number or environment object in MyGet . 但是在MyGet上我有一个MyGet.IsRunningOnMyGet,但我似乎没有MyGet中的构建版本号或环境对象。 Any suggestions on how I should be getting the build number so I can pass it to the 'pack' command further down in the cake script? 有关如何获取内部版本号的任何建议,以便我可以将其传递给蛋糕脚本中的“pack”命令?

Doesn't look like the IMyGetProvider supports that yet, that said it's available as an environment variable 看起来IMyGetProvider看起来并不支持,它表示它可以作为环境变量使用 MyGet版本环境

So you should be able to do 所以你应该能做到

var version = EnvironmentVariable("PackageVersion"); 

See MyGet documentation for Available environment Variables . 有关可用环境变量,请参阅MyGet文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM