Skip to content

Commit c213bbf

Browse files
author
JoshuaMiller
committed
package updates
1 parent 0d26673 commit c213bbf

6 files changed

Lines changed: 64 additions & 96 deletions

File tree

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using System.Threading;
2-
using System.Threading.Tasks;
3-
using Jenkins.NET.Publishing.Internal;
4-
using Photon.Framework.Agent;
1+
using Photon.Framework.Agent;
52
using Photon.Framework.Tasks;
3+
using Photon.MSBuild;
4+
using System.Threading;
5+
using System.Threading.Tasks;
66

77
namespace Jenkins.NET.Publishing
88
{
@@ -13,19 +13,27 @@ public class Build_Linux : IBuildTask
1313

1414
public async Task RunAsync(CancellationToken token)
1515
{
16-
await BuildSolution();
16+
await BuildSolution(token);
1717
}
1818

19-
private async Task BuildSolution()
19+
private async Task BuildSolution(CancellationToken token)
2020
{
21-
var msBuild = new MsBuild(Context) {
21+
var msbuild = new MSBuildCommand(Context) {
2222
Exe = "msbuild",
23-
Filename = "Jenkins.NET.sln",
24-
Configuration = "Release",
25-
Platform = "Any CPU",
23+
WorkingDirectory = Context.ContentDirectory,
24+
};
25+
26+
var buildArgs = new MSBuildArguments {
27+
ProjectFile = "Jenkins.NET.sln",
28+
Properties = {
29+
["Configuration"] = "Release",
30+
["Platform"] = "Any CPU",
31+
},
32+
Verbosity = MSBuildVerbosityLevel.Minimal,
33+
MaxCpuCount = 0,
2634
};
2735

28-
await msBuild.BuildAsync();
36+
await msbuild.RunAsync(buildArgs, token);
2937
}
3038
}
3139
}
Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using Jenkins.NET.Publishing.Internal;
2-
using Photon.Framework.Agent;
1+
using Photon.Framework.Agent;
32
using Photon.Framework.Tasks;
3+
using Photon.MSBuild;
44
using System.Threading;
55
using System.Threading.Tasks;
66

@@ -13,33 +13,35 @@ public class Build_Windows : IBuildTask
1313

1414
public async Task RunAsync(CancellationToken token)
1515
{
16-
await BuildSolution();
17-
await UnitTest();
16+
await BuildSolution(token);
17+
await UnitTest(token);
1818
}
1919

20-
private async Task BuildSolution()
20+
private async Task BuildSolution(CancellationToken token)
2121
{
22-
var msbuild_exe = Context.AgentVariables["global"]["msbuild_exe"];
22+
var msbuild = new MSBuildCommand(Context) {
23+
Exe = Context.AgentVariables["global"]["msbuild_exe"],
24+
WorkingDirectory = Context.ContentDirectory,
25+
};
2326

24-
var msBuild = new MsBuild(Context) {
25-
//Exe = ".\\bin\\msbuild.cmd",
26-
Exe = $"\"{msbuild_exe}\"",
27-
Filename = "Jenkins.NET.sln",
28-
Configuration = "Release",
29-
Platform = "Any CPU",
30-
Parallel = true,
27+
var buildArgs = new MSBuildArguments {
28+
ProjectFile = "Jenkins.NET.sln",
29+
Properties = {
30+
["Configuration"] = "Release",
31+
["Platform"] = "Any CPU",
32+
},
33+
Verbosity = MSBuildVerbosityLevel.Minimal,
34+
MaxCpuCount = 0,
3135
};
3236

33-
await msBuild.BuildAsync();
37+
await msbuild.RunAsync(buildArgs, token);
3438
}
3539

36-
private async Task UnitTest()
40+
private async Task UnitTest(CancellationToken token)
3741
{
3842
var nunit_exe = Context.AgentVariables["global"]["nunit_exe"];
3943

40-
await Context.RunCommandLineAsync($"\"{nunit_exe}\"",
41-
"\"Jenkins.NET.Tests\\bin\\Release\\Jenkins.NET.Tests.dll\"",
42-
"--where=\"cat == 'unit'\"");
44+
await Context.Process.RunAsync($"\"{nunit_exe}\" \"Jenkins.NET.Tests\\bin\\Release\\Jenkins.NET.Tests.dll\" --where=\"cat == 'unit'\"", token);
4345
}
4446
}
4547
}

Jenkins.NET.Publishing/Internal/MsBuild.cs

Lines changed: 0 additions & 49 deletions
This file was deleted.

Jenkins.NET.Publishing/Jenkins.NET.Publishing.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,14 @@
6969
<Reference Include="NuGet.Versioning, Version=4.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7070
<HintPath>..\packages\NuGet.Versioning.4.2.0\lib\net45\NuGet.Versioning.dll</HintPath>
7171
</Reference>
72-
<Reference Include="Photon.Framework, Version=0.0.46.0, Culture=neutral, processorArchitecture=MSIL">
73-
<HintPath>..\packages\Photon.Framework.0.0.46\lib\net46\Photon.Framework.dll</HintPath>
72+
<Reference Include="Photon.Framework, Version=0.0.69.0, Culture=neutral, processorArchitecture=MSIL">
73+
<HintPath>..\packages\Photon.Framework.0.0.69\lib\net46\Photon.Framework.dll</HintPath>
7474
</Reference>
75-
<Reference Include="Photon.NuGet, Version=0.0.9.0, Culture=neutral, processorArchitecture=MSIL">
76-
<HintPath>..\packages\Photon.NuGet.0.0.9\lib\net46\Photon.NuGet.dll</HintPath>
75+
<Reference Include="Photon.MSBuild, Version=0.0.4.0, Culture=neutral, processorArchitecture=MSIL">
76+
<HintPath>..\packages\Photon.MSBuild.0.0.4\lib\net46\Photon.MSBuild.dll</HintPath>
77+
</Reference>
78+
<Reference Include="Photon.NuGet, Version=0.0.12.0, Culture=neutral, processorArchitecture=MSIL">
79+
<HintPath>..\packages\Photon.NuGet.0.0.12\lib\net46\Photon.NuGet.dll</HintPath>
7780
</Reference>
7881
<Reference Include="System" />
7982
<Reference Include="System.Core" />
@@ -84,7 +87,6 @@
8487
<Compile Include="Build_Linux.cs" />
8588
<Compile Include="Publish_Windows.cs" />
8689
<Compile Include="Build_Windows.cs" />
87-
<Compile Include="Internal\MsBuild.cs" />
8890
<Compile Include="Properties\AssemblyInfo.cs" />
8991
</ItemGroup>
9092
<ItemGroup>

Jenkins.NET.Publishing/Publish_Windows.cs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
using Jenkins.NET.Publishing.Internal;
2-
using Photon.Framework.Agent;
1+
using Photon.Framework.Agent;
32
using Photon.Framework.Tasks;
43
using Photon.Framework.Tools;
4+
using Photon.MSBuild;
55
using Photon.NuGetPlugin;
66
using System.IO;
77
using System.Threading;
@@ -23,18 +23,22 @@ public async Task RunAsync(CancellationToken token)
2323

2424
private async Task BuildSolution(CancellationToken token)
2525
{
26-
var msbuild_exe = Context.AgentVariables["global"]["msbuild_exe"];
26+
var msbuild = new MSBuildCommand(Context) {
27+
Exe = Context.AgentVariables["global"]["msbuild_exe"],
28+
WorkingDirectory = Context.ContentDirectory,
29+
};
2730

28-
var msBuild = new MsBuild(Context) {
29-
//Exe = ".\\bin\\msbuild.cmd",
30-
Exe = $"\"{msbuild_exe}\"",
31-
Filename = "Jenkins.NET.sln",
32-
Configuration = "Release",
33-
Platform = "Any CPU",
34-
Parallel = true,
31+
var buildArgs = new MSBuildArguments {
32+
ProjectFile = "Jenkins.NET.sln",
33+
Properties = {
34+
["Configuration"] = "Release",
35+
["Platform"] = "Any CPU",
36+
},
37+
Verbosity = MSBuildVerbosityLevel.Minimal,
38+
MaxCpuCount = 0,
3539
};
3640

37-
await msBuild.BuildAsync();
41+
await msbuild.RunAsync(buildArgs, token);
3842
}
3943

4044
private async Task PublishPackage(CancellationToken token)

Jenkins.NET.Publishing/packages.config

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<package id="NuGet.Protocol.Core.v2" version="3.5.0" targetFramework="net46" />
1414
<package id="NuGet.Protocol.Core.v3" version="4.2.0" targetFramework="net46" />
1515
<package id="NuGet.Versioning" version="4.2.0" targetFramework="net46" />
16-
<package id="Photon.Framework" version="0.0.46" targetFramework="net46" />
17-
<package id="Photon.NuGet" version="0.0.9" targetFramework="net46" />
16+
<package id="Photon.Framework" version="0.0.69" targetFramework="net46" />
17+
<package id="Photon.MSBuild" version="0.0.4" targetFramework="net46" />
18+
<package id="Photon.NuGet" version="0.0.12" targetFramework="net46" />
1819
</packages>

0 commit comments

Comments
 (0)