Skip to content

Commit 2c2c5fd

Browse files
committed
Merge branch 'release/0.3.2'
2 parents 518cb52 + 903a445 commit 2c2c5fd

12 files changed

Lines changed: 82 additions & 20 deletions

File tree

ReleaseNotes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@
4242
- Supports Cake 0.30.0
4343
- Retargeted to .NET Standard 2.0 (raise issues if you see new issues from this)
4444
- Thanks again to @flcdrg and @RaringCoder for contributions and testing!
45+
46+
# 0.3.2
47+
48+
- Supports Cake 0.34.1
49+
- Fixes errors writing summary report when run in Azure Pipelines container (#21)
50+
- Thanks again to @flcdrg for contributions!

azure-pipelines.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
trigger:
2+
- master
3+
- develop
4+
5+
variables:
6+
buildConfiguration: 'Release'
7+
cakeVersion: 0.34.1
8+
sdkVersion: '2.2.300'
9+
target: NuGet
10+
11+
pool:
12+
vmImage: 'windows-2019'
13+
steps:
14+
- task: UseDotNet@2
15+
displayName: 'Use .NET Core SDK'
16+
inputs:
17+
packageType: sdk
18+
version: $(sdkVersion)
19+
installationPath: $(Agent.ToolsDirectory)/dotnet
20+
- task: NuGetToolInstaller@1
21+
inputs:
22+
versionSpec: '>=5.x'
23+
- task: DotNetCoreCLI@2
24+
displayName: Install Cake tool
25+
inputs:
26+
command: custom
27+
custom: tool
28+
arguments: install -g Cake.Tool --version $(cakeVersion)
29+
- task: DotNetCoreCLI@2
30+
displayName: Run build
31+
inputs:
32+
command: custom
33+
custom: cake
34+
arguments: --settings_skipverification=true --target=$(target)
35+
- task: PublishPipelineArtifact@1
36+
displayName: Publish packages artifact
37+
inputs:
38+
path: dist/package
39+
artifact: package
40+
- task: PublishPipelineArtifact@1
41+
displayName: Publish build output
42+
inputs:
43+
path: dist/build
44+
artifact: publish

build.cake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Task("NuGet")
119119
Summary = "A simple Cake module to enhance running from a hosted CI environment.",
120120
ProjectUrl = new Uri("https://github.com/agc93/Cake.BuildSystems.Module"),
121121
IconUrl = new Uri("https://cakeresources.blob.core.windows.net/nuget/64/deployment-64.png"),
122-
LicenseUrl = new Uri("https://raw.githubusercontent.com/agc93/Cake.BuildSystems.Module/master/LICENSE"),
122+
License = new NuSpecLicense() { Type = "expression", Value = "MIT" },
123123
Copyright = "Alistair Chapman 2017",
124124
Tags = new[] { "cake", "build", "ci", "build" },
125125
OutputDirectory = artifacts + "/package",

src/Cake.Module.Shared/Cake.Module.Shared.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="Cake.Core" Version="0.30.0" />
18-
<PackageReference Include="Cake.Common" Version="0.30.0" />
17+
<PackageReference Include="Cake.Core" Version="0.34.1" />
18+
<PackageReference Include="Cake.Common" Version="0.34.1" />
1919
</ItemGroup>
2020
</Project>

src/Cake.MyGet.Module/Cake.MyGet.Module.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Cake.Core" Version="0.30.0" />
16-
<PackageReference Include="Cake.Common" Version="0.30.0" />
15+
<PackageReference Include="Cake.Core" Version="0.34.1" />
16+
<PackageReference Include="Cake.Common" Version="0.34.1" />
1717
</ItemGroup>
1818

1919
</Project>

src/Cake.TFBuild.Module/Cake.TFBuild.Module.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Cake.Core" Version="0.30.0" />
16-
<PackageReference Include="Cake.Common" Version="0.30.0" />
15+
<PackageReference Include="Cake.Core" Version="0.34.1" />
16+
<PackageReference Include="Cake.Common" Version="0.34.1" />
1717
</ItemGroup>
1818

1919
</Project>

src/Cake.TFBuild.Module/Extensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ public static void UpdateProgress(this ITFBuildProvider provider, Guid parent, i
1313
{
1414
provider.Commands.UpdateRecord(parent, new TFBuildRecordData {Progress = progress, Status = TFBuildTaskStatus.InProgress});
1515
}
16+
17+
internal static bool IsRunningOnPipelines(this Common.Build.BuildSystem b) => b.IsRunningOnAzurePipelines || b.IsRunningOnAzurePipelinesHosted;
1618
}
1719
}

src/Cake.TFBuild.Module/TFBuildEngine.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public TFBuildEngine(ICakeDataService dataService, ICakeLog log) : base(new Cake
3030
private void OnBuildTeardown(object sender, TeardownEventArgs e)
3131
{
3232
var b = e.TeardownContext.BuildSystem();
33-
if (b.IsRunningOnVSTS || b.IsRunningOnTFS)
33+
if (b.IsRunningOnPipelines())
3434
{
3535
b.TFBuild.Commands.UpdateRecord(_parentRecord, new TFBuildRecordData
3636
{
@@ -45,7 +45,7 @@ private void OnBuildTeardown(object sender, TeardownEventArgs e)
4545
private void OnTaskTeardown(object sender, TaskTeardownEventArgs e)
4646
{
4747
var b = e.TaskTeardownContext.BuildSystem();
48-
if (b.IsRunningOnVSTS || b.IsRunningOnTFS)
48+
if (b.IsRunningOnPipelines())
4949
{
5050
var currentTask = _engine.Tasks.First(t => t.Name == e.TaskTeardownContext.Task.Name);
5151
var currentIndex = _engine.Tasks.ToList().IndexOf(currentTask);
@@ -72,7 +72,7 @@ private void OnTaskTeardown(object sender, TaskTeardownEventArgs e)
7272
private void OnTaskSetup(object sender, TaskSetupEventArgs e)
7373
{
7474
var b = e.TaskSetupContext.BuildSystem();
75-
if (b.IsRunningOnVSTS || b.IsRunningOnTFS)
75+
if (b.IsRunningOnPipelines())
7676
{
7777
var currentTask =
7878
_engine.Tasks.First(t => t.Name == e.TaskSetupContext.Task.Name);
@@ -96,7 +96,7 @@ private int GetProgress(int currentTask, int count)
9696
private void BuildSetup(object sender, SetupEventArgs e)
9797
{
9898
var b = e.Context.BuildSystem();
99-
if (b.IsRunningOnTFS || b.IsRunningOnVSTS)
99+
if (b.IsRunningOnPipelines())
100100
{
101101
//e.Context.TFBuild().Commands.SetProgress(0, "Build Setup");
102102
e.Context.TFBuild().Commands.SetProgress(0, string.Empty);

src/Cake.TFBuild.Module/TFBuildReportPrinter.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,24 @@
88

99
namespace Cake.TFBuild.Module
1010
{
11+
/// <summary>
12+
/// The TF Build/Azure Pipelines report printer.
13+
/// </summary>
1114
public class TFBuildReportPrinter : CakeReportPrinterBase
1215
{
16+
/// <summary>
17+
/// Initializes a new instance of the <see cref="TFBuildReportPrinter"/> class.
18+
/// </summary>
19+
/// <param name="console">The console.</param>
20+
/// <param name="context">The context.</param>
1321
public TFBuildReportPrinter(IConsole console, ICakeContext context) : base(console, context)
1422
{
1523
}
1624

25+
/// <summary>
26+
/// Writes the specified report to a target.
27+
/// </summary>
28+
/// <param name="report">The report to write.</param>
1729
public override void Write(CakeReport report)
1830
{
1931
if (report == null)
@@ -24,7 +36,7 @@ public override void Write(CakeReport report)
2436
try
2537
{
2638

27-
if (_context.TFBuild().IsRunningOnTFS || _context.TFBuild().IsRunningOnVSTS) {
39+
if (_context.TFBuild().IsRunningOnAzurePipelines || _context.TFBuild().IsRunningOnAzurePipelinesHosted) {
2840
WriteToMarkdown(report);
2941
}
3042
WriteToConsole(report);
@@ -63,7 +75,7 @@ private void WriteToMarkdown(CakeReport report)
6375
}
6476
sb.AppendLine("");
6577
var b = _context.BuildSystem().TFBuild;
66-
FilePath agentWorkPath = b.Environment.Agent.WorkingDirectory + "/tasksummary.md";
78+
FilePath agentWorkPath = b.Environment.Build.ArtifactStagingDirectory + "/tasksummary.md";
6779
var absFilePath = agentWorkPath.MakeAbsolute(_context.Environment);
6880
var file = _context.FileSystem.GetFile(absFilePath);
6981
using (var writer = new StreamWriter(file.OpenWrite())) {
@@ -72,7 +84,5 @@ private void WriteToMarkdown(CakeReport report)
7284
//b.Commands.UploadTaskSummary(absFilePath);
7385
_console.WriteLine($"##vso[task.addattachment type=Distributedtask.Core.Summary;name=Cake Build Summary;]{absFilePath.MakeAbsolute(_context.Environment).FullPath}");
7486
}
75-
76-
7787
}
7888
}

src/Cake.TeamCity.Module/Cake.TeamCity.Module.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Cake.Core" Version="0.30.0" />
16-
<PackageReference Include="Cake.Common" Version="0.30.0" />
15+
<PackageReference Include="Cake.Core" Version="0.34.1" />
16+
<PackageReference Include="Cake.Common" Version="0.34.1" />
1717
</ItemGroup>
1818

1919
</Project>

0 commit comments

Comments
 (0)