Skip to content

Commit 73e03d6

Browse files
Updated build and dependencies
1 parent 328cd80 commit 73e03d6

File tree

8 files changed

+63
-59
lines changed

8 files changed

+63
-59
lines changed

build.cake

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,36 @@ Task("Build")
3232
});
3333
});
3434

35-
Task("Test")
35+
Task("TestSetup")
36+
.Does(() => {
37+
CleanDirectory(artifacts + "/tests");
38+
CleanDirectory(artifacts + "/coverage");
39+
EnsureDirectoryExists(artifacts + "/tests");
40+
EnsureDirectoryExists(artifacts + "/coverage");
41+
});
42+
43+
Task("TestWithoutCoverage")
44+
.WithCriteria(IsRunningOnUnix)
45+
.IsDependentOn("TestSetup")
3646
.IsDependentOn("Build")
37-
.Does(() =>
47+
.DoesForEach(GetFiles("test/*/*.csproj"), (testProject) =>
3848
{
39-
EnsureDirectoryExists(artifacts + "/tests");
40-
EnsureDirectoryExists(artifacts + "/coverage");
41-
42-
foreach (var testProject in GetFiles("test/*/*.csproj")) {
43-
StartProcess("dotnet", new ProcessSettings() {
44-
WorkingDirectory = testProject.GetDirectory(),
49+
DotNetCoreTool(
50+
testProject.GetDirectory().FullPath,
51+
"xunit",
52+
new ProcessArgumentBuilder()
53+
.AppendSwitchQuoted("-xml", string.Format("{0}/tests/{1}.xml", artifacts, testProject.GetFilenameWithoutExtension()))
54+
.AppendSwitch("-configuration", configuration)
55+
.Append("-noshadow"),
56+
new DotNetCoreToolSettings() {
4557
EnvironmentVariables = GitVersionEnvironmentVariables,
46-
Arguments = new ProcessArgumentBuilder()
47-
.Append("xunit")
48-
.Append("-noshadow")
49-
.AppendSwitch("-configuration", configuration)
50-
.AppendSwitchQuotedSecret("-xml", string.Format("{0}/tests/{1}.xml", artifacts, testProject.GetFilenameWithoutExtension()))
51-
.AppendSwitchQuotedSecret("-html", string.Format("{0}/tests/{1}.html", artifacts, testProject.GetFilenameWithoutExtension()))
52-
});
53-
}
58+
});
5459
});
5560

56-
Task("Coverage")
57-
//.IsDependentOn("Build")
58-
.Does(() => {
59-
CleanDirectory(artifacts + "/coverage");
60-
EnsureDirectoryExists(artifacts + "/coverage");
61-
})
61+
Task("TestWithCoverage")
62+
.WithCriteria(IsRunningOnWindows)
63+
.IsDependentOn("TestSetup")
64+
.IsDependentOn("Build")
6265
.DoesForEach(GetFiles("test/*/*.csproj"), (testProject) =>
6366
{
6467
DotCoverCover(tool => {
@@ -109,6 +112,10 @@ Task("Coverage")
109112
System.IO.File.WriteAllText(artifacts + "/coverage/coverage.xml", withBom.Replace(_byteOrderMarkUtf8, ""));
110113
});
111114

115+
Task("Test")
116+
.IsDependentOn("TestWithCoverage")
117+
.IsDependentOn("TestWithoutCoverage");
118+
112119
Task("Pack")
113120
.IsDependentOn("Build")
114121
.Does(() => EnsureDirectoryExists(artifacts + "/nuget"))
@@ -134,7 +141,6 @@ Task("Default")
134141
.IsDependentOn("Clean")
135142
.IsDependentOn("Build")
136143
.IsDependentOn("Test")
137-
.IsDependentOn("Coverage")
138144
.IsDependentOn("Pack");
139145

140146
RunTarget(target);

src/Directory.Build.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
<PropertyGroup>
3+
<AssetTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.6' ">$(AssetTargetFallback);dotnet5.4;portable-net45+win8</AssetTargetFallback>
4+
<PackageVersion Condition="'$(GitVersion_NuGetVersion)' != ''">$(GitVersion_NuGetVersion)</PackageVersion>
5+
<AssemblyVersion Condition="'$(GitVersion_AssemblySemVer)' != ''">$(GitVersion_AssemblySemVer)</AssemblyVersion>
6+
<FileVersion Condition="'$(GitVersion_AssemblySemVer)' != ''">$(GitVersion_AssemblySemVer)</FileVersion>
7+
<InformationalVersion Condition="'$(GitVersion_InformationalVersion)' != ''">$(GitVersion_InformationalVersion)</InformationalVersion>
8+
</PropertyGroup>
9+
</Project>

src/JsonRpc/JsonRpc.csproj

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@
22
<PropertyGroup>
33
<TargetFrameworks>net46;netstandard1.6</TargetFrameworks>
44
<PlatformTarget>AnyCPU</PlatformTarget>
5-
<!-- Needed for Microsoft.Composition -->
6-
<AssetTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.6' ">$(AssetTargetFallback);dotnet5.4;portable-net45+win8</AssetTargetFallback>
7-
<PackageVersion Condition="'$(GitVersion_NuGetVersion)' != ''">$(GitVersion_NuGetVersion)</PackageVersion>
8-
<AssemblyVersion Condition="'$(GitVersion_AssemblySemVer)' != ''">$(GitVersion_AssemblySemVer)</AssemblyVersion>
9-
<FileVersion Condition="'$(GitVersion_AssemblySemVer)' != ''">$(GitVersion_AssemblySemVer)</FileVersion>
10-
<InformationalVersion Condition="'$(GitVersion_InformationalVersion)' != ''">$(GitVersion_InformationalVersion)</InformationalVersion>
115
</PropertyGroup>
126
<ItemGroup>
13-
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
14-
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
7+
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
8+
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
159
</ItemGroup>
1610
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
1711
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />

src/Lsp/Lsp.csproj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
<PropertyGroup>
33
<TargetFrameworks>net46;netstandard1.6</TargetFrameworks>
44
<PlatformTarget>AnyCPU</PlatformTarget>
5-
<!-- Needed for Microsoft.Composition -->
6-
<AssetTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.6' ">$(AssetTargetFallback);dotnet5.4;portable-net45+win8</AssetTargetFallback>
75
</PropertyGroup>
86
<ItemGroup>
9-
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
10-
<PackageReference Include="System.ValueTuple" Version="4.3.0" />
7+
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
8+
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
119
<ProjectReference Include="..\JsonRpc\JsonRpc.csproj" />
1210
</ItemGroup>
1311
</Project>

test/JsonRpc.Tests/HandlerResolverTests.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Reflection;
33
using System.Threading;
44
using System.Threading.Tasks;
@@ -43,12 +43,11 @@ public void Should_Contain_AllDefinedMethods(Type requestHandler, string key)
4343
[InlineData(typeof(IRequestResponseHandler), "requestresponse", typeof(Request))]
4444
[InlineData(typeof(INotificationDataHandler), "notificationdata", null)]
4545
[InlineData(typeof(IInlineNotificationHandler), "notification", null)]
46-
[InlineData(typeof(IInlineNotificationHandler), "notification", null)]
4746
public void Should_Have_CorrectParams(Type requestHandler, string key, Type expected)
4847
{
4948
var handler = new HandlerCollection();
5049
handler.Add((IJsonRpcHandler)Substitute.For(new Type[] { requestHandler }, new object[0]));
5150
handler.Get(key).Params.Should().Equals(expected);
5251
}
5352
}
54-
}
53+
}

test/JsonRpc.Tests/JsonRpc.Tests.csproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
<ProjectReference Include="..\..\src\JsonRpc\JsonRpc.csproj" />
1111
</ItemGroup>
1212
<ItemGroup>
13-
<PackageReference Include="FluentAssertions" Version="4.19.2" />
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
15-
<PackageReference Include="NSubstitute" Version="2.0.2" />
16-
<PackageReference Include="xunit" Version="2.3.0-beta1-build3642" />
17-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta1-build1309" />
18-
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta1-build3642" />
19-
<PackageReference Include="Microsoft.CodeCoverage" Version="1.0.3" />
13+
<PackageReference Include="FluentAssertions" Version="4.19.4" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
15+
<PackageReference Include="NSubstitute" Version="2.0.3" />
16+
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
17+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
18+
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta5-build3769" />
2019
</ItemGroup>
2120
</Project>

test/JsonRpc.Tests/ProcessSchedulerTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Linq;
33
using System.Threading;
44
using System.Threading.Tasks;
@@ -37,8 +37,8 @@ public void ShouldScheduleCompletedTask(RequestProcessType type)
3737
}
3838
}
3939

40-
[Theory, ClassData(typeof(AllRequestProcessTypes))]
41-
public void ShouldScheduleAwaitableTask(RequestProcessType type)
40+
[Fact]
41+
public void ShouldScheduleAwaitableTask()
4242
{
4343
using (IScheduler s = new ProcessScheduler())
4444
{
@@ -52,8 +52,8 @@ public void ShouldScheduleAwaitableTask(RequestProcessType type)
5252
}
5353
}
5454

55-
[Theory, ClassData(typeof(AllRequestProcessTypes))]
56-
public void ShouldScheduleConstructedTask(RequestProcessType type)
55+
[Fact]
56+
public void ShouldScheduleConstructedTask()
5757
{
5858
using (IScheduler s = new ProcessScheduler())
5959
{
@@ -77,7 +77,7 @@ public void ShouldScheduleSerialInOrder()
7777
var running = 0;
7878
var peek = 0;
7979

80-
Func<Task> HandlePeek = async () => {
80+
Func<Task> HandlePeek = async () => {
8181
var p = Interlocked.Increment(ref running);
8282
lock (this) peek = Math.Max(peek, p);
8383
await Task.Delay(SLEEPTIME_MS); // give a different HandlePeek task a chance to run
@@ -161,4 +161,4 @@ public void ShouldScheduleMixed()
161161
}
162162
}
163163
}
164-
}
164+
}

test/Lsp.Tests/Lsp.Tests.csproj

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414
<ProjectReference Include="..\..\src\Lsp\Lsp.csproj" />
1515
</ItemGroup>
1616
<ItemGroup>
17-
<PackageReference Include="FluentAssertions" Version="4.19.2" />
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
19-
<PackageReference Include="NSubstitute" Version="2.0.2" />
20-
<PackageReference Include="xunit" Version="2.3.0-beta1-build3642" />
21-
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta1-build1309" />
22-
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta1-build3642" />
23-
<PackageReference Include="Microsoft.CodeCoverage" Version="1.0.3" />
17+
<PackageReference Include="FluentAssertions" Version="4.19.4" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
19+
<PackageReference Include="NSubstitute" Version="2.0.3" />
20+
<PackageReference Include="xunit" Version="2.3.0-beta5-build3769" />
21+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta5-build3769" />
22+
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.0-beta5-build3769" />
2423
</ItemGroup>
2524
</Project>

0 commit comments

Comments
 (0)