cakebuild

How to push Tag to Bitbucket Git Repository in Bamboo from Cake build task?

大憨熊 提交于 2019-12-07 14:04:30
I'm using next code to push Tag to Git repository #addin "Cake.Git" using LibGit2Sharp; var solutionFolder = "./"; var versionTag = "someTag"; Task("Default") .Does(() => { var remoteRepository = EnvironmentVariable("bamboo_planRepository_repositoryUrl"); var repositoryRevision = EnvironmentVariable("bamboo_planRepository_revision"); var absolutePath = MakeAbsolute(Directory(solutionFolder)); var repoName = "central"; //LibGit2Sharp add remote using (var repo = new Repository(absolutePath.FullPath)) { repo.Network.Remotes.Add(repoName, remoteRepository); } GitTag(solutionFolder, versionTag,

How to get passed and fail test case count in xunit using cake(c# make) script

久未见 提交于 2019-12-07 03:30:26
问题 I try to use the cake script for running the test cases written in Xunit using the cake script , I need to know the number of passed and failed test cases count. #tool "nuget:?package=xunit.runner.console" var testAssemblies = GetFiles("./src/**/bin/Release/*.Tests.dll"); XUnit2(testAssemblies); Reference : http://www.cakebuild.net/dsl/xunit-v2 Can anyone please suggest how to get the number of passed and failed test cases ? 回答1: You'll have to use XUnit2Aliases​.XUnit2(IEnumerable < FilePath

Targeting multiple frameworks with Cake script

醉酒当歌 提交于 2019-12-06 08:46:31
A co-worker recently added .NET Standard support to one of our projects using the new VS2017 .csproj format: This seems to have broken my script as I get the following error when using the Cake MSBuild alias ( http://cakebuild.net/api/Cake.Common.Tools.MSBuild/MSBuildAliases/C240F0FB ): error : Project 'C:\example\path\myproj.csproj' targets '.NETFramework,Version=v4.6.1'. It cannot be referenced by a project that targets '.NETStandard,Version=v1.6'. Does Cake support building against multiple frameworks using the new VS2017 project format? If so, is there a way I can do so with the

How to get passed and fail test case count in xunit using cake(c# make) script

霸气de小男生 提交于 2019-12-05 08:14:56
I try to use the cake script for running the test cases written in Xunit using the cake script , I need to know the number of passed and failed test cases count. #tool "nuget:?package=xunit.runner.console" var testAssemblies = GetFiles("./src/**/bin/Release/*.Tests.dll"); XUnit2(testAssemblies); Reference : http://www.cakebuild.net/dsl/xunit-v2 Can anyone please suggest how to get the number of passed and failed test cases ? You'll have to use XUnit2Aliases​.XUnit2(IEnumerable < FilePath >, ​XUnit2Settings) + XmlPeekAliases for reading the XUnit output. var testAssemblies = GetFiles("./src/**

Why does NuGetPack respond with “Cannot create a package that has no dependencies nor content”

帅比萌擦擦* 提交于 2019-12-03 16:02:36
I am trying to use the following Cake script: Task("Create-NuGet-Packages") .IsDependentOn("Build") .WithCriteria(() =>DirectoryExists(parameters.Paths.Directories.NugetNuspecDirectory)) .Does(() => { var nuspecFiles = GetFiles(parameters.Paths.Directories.NugetNuspecDirectory + "/**/*.nuspec"); EnsureDirectoryExists(parameters.Paths.Directories.NuGetPackages); foreach(var nuspecFile in nuspecFiles) { // TODO: Addin the release notes // ReleaseNotes = parameters.ReleaseNotes.Notes.ToArray(), // Create packages. NuGetPack(nuspecFile, new NuGetPackSettings { Version = parameters.Version

How do we authenticate against a secured NuGet server with Cake build?

ε祈祈猫儿з 提交于 2019-12-03 11:54:19
We are working on automating our builds using Cake Build and we use NuGet packages from nuget.org but we also have our own NuGet Feed server which has a username/password authentication to access. How do we utilize Cake Build with a custom NuGet feed server with authentication? devlead Cake utilizes the NuGet.exe for installing tools, addins and the NuGet aliases. Unless you have a source specified in the #tool / #addin directives or provided to the NuGet aliases, then NuGet.exe will look for nuget.config in current path and eventually end up at current users global settings ( %AppData%\NuGet

Passing string[] from batch file (which contains double quotes ") to powershell script

↘锁芯ラ 提交于 2019-12-01 08:35:41
问题 I have a powershell script which has a string[] parameter and try to pass value to this from batch file PowerShell Script [string[]]$ScriptArgs Batch File powershell -File Foobar.ps1 -ScriptArgs -versn="""1.0.0.0""",pattern="""FooBar.*""" (3 Quotes - For escaping/showing 1 quote) But no matter what I do Write-Host $ScriptArgs.Count prints 1 I want the variable to receive 2 elements [0] will be -versn="1.0.0.0" [1] will be -pattern="FooBar.*" In batch file, I even tried setting variables