Skip to content

Commit 8cf4d58

Browse files
authoredFeb 9, 2020
upgrade project tooling to .NET Core 3.1 (octokit#2089)
1 parent 911dd4a commit 8cf4d58

File tree

15 files changed

+52
-18
lines changed

15 files changed

+52
-18
lines changed
 

‎.config/dotnet-tools.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"sourcelink": {
6+
"version": "3.1.1",
7+
"commands": [
8+
"sourcelink"
9+
]
10+
}
11+
}
12+
}

‎.github/workflows/netcore.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup .NET Core
2323
uses: actions/setup-dotnet@v1.4.0
2424
with:
25-
dotnet-version: 2.1.803
25+
dotnet-version: 3.1.101
2626
- name: Build with dotnet
2727
run: ./build.sh --linksources=true --verbosity=verbose
2828
shell: bash

‎Directory.Build.targets

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
<PropertyGroup>
3+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
4+
<TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<EmbeddedFiles Include="$(GeneratedAssemblyInfoFile)"/>
8+
</ItemGroup>
9+
</Project>

‎Octokit.Tests.Conventions/Octokit.Tests.Conventions.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>Convention-based tests for Octokit</Description>
55
<AssemblyTitle>Octokit.Tests.Conventions</AssemblyTitle>
66
<Authors>GitHub</Authors>
7-
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
7+
<TargetFrameworks>netcoreapp3.1;net452</TargetFrameworks>
88
<NoWarn>$(NoWarn);CS4014;CS1998</NoWarn>
99
<AssemblyName>Octokit.Tests.Conventions</AssemblyName>
1010
<PackageId>Octokit.Tests.Conventions</PackageId>

‎Octokit.Tests.Integration/Octokit.Tests.Integration.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>Integration tests for Octokit</Description>
55
<AssemblyTitle>Octokit.Tests.Integration</AssemblyTitle>
66
<Authors>GitHub</Authors>
7-
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
7+
<TargetFrameworks>netcoreapp3.1;net452</TargetFrameworks>
88
<NoWarn>$(NoWarn);CS4014;CS1998</NoWarn>
99
<AssemblyName>Octokit.Tests.Integration</AssemblyName>
1010
<PackageId>Octokit.Tests.Integration</PackageId>
@@ -19,7 +19,7 @@
1919
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
2020
</PropertyGroup>
2121

22-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
22+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
2323
<DefineConstants>$(DefineConstants);GITHUBJWT_HELPER_AVAILABLE</DefineConstants>
2424
</PropertyGroup>
2525

@@ -45,7 +45,7 @@
4545
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
4646
</ItemGroup>
4747

48-
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
48+
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
4949
<PackageReference Include="GitHubJwt" Version="0.0.4" />
5050
</ItemGroup>
5151

‎Octokit.Tests/Octokit.Tests.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<Description>Tests for Octokit</Description>
55
<AssemblyTitle>Octokit.Tests</AssemblyTitle>
66
<Authors>GitHub</Authors>
7-
<TargetFrameworks>netcoreapp2.1;net452</TargetFrameworks>
7+
<TargetFrameworks>netcoreapp3.1;net452</TargetFrameworks>
88
<NoWarn>$(NoWarn);CS4014;CS1998</NoWarn>
99
<AssemblyName>Octokit.Tests</AssemblyName>
1010
<PackageId>Octokit.Tests</PackageId>
@@ -32,7 +32,7 @@
3232
<PackageReference Include="NSubstitute" Version="4.2.1" />
3333
</ItemGroup>
3434

35-
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
35+
<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
3636
<DefineConstants>$(DefineConstants);NO_SERIALIZABLE;HAS_TYPEINFO</DefineConstants>
3737
</PropertyGroup>
3838

‎Octokit/Octokit.csproj

-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353

5454
<ItemGroup>
5555
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
56-
<DotNetCliToolReference Include="dotnet-sourcelink-git" Version="2.8.3" />
57-
<DotNetCliToolReference Include="dotnet-sourcelink" Version="2.8.3" />
5856
</ItemGroup>
5957

6058
</Project>

‎appveyor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: Visual Studio 2017
1+
image: Visual Studio 2019
22

33
branches:
44
only:
@@ -16,4 +16,4 @@ test: off
1616

1717
artifacts:
1818
- path: 'packaging\octokit*.nupkg'
19-
name: OctokitPackages
19+
name: OctokitPackages

‎build.ps1

+7
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ $Arguments = @{
103103
dryrun=$WhatIf;
104104
}.GetEnumerator() | %{"--{0}=`"{1}`"" -f $_.key, $_.value };
105105

106+
Write-Host "Restoring global tools..."
107+
Invoke-Expression "dotnet tool restore"
108+
if($LASTEXITCODE -ne 0) {
109+
Pop-Location;
110+
exit $LASTEXITCODE;
111+
}
112+
106113
# Start Cake
107114
Push-Location
108115
Set-Location build

‎build.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
66
echo "new limit: `ulimit -n`"
77
fi
88

9+
echo "Restoring global tools"
10+
dotnet tool restore
11+
912
cd build
1013
echo "Preparing Cake.Frosting build runner..."
1114
dotnet restore
1215

1316
echo "Executing Cake.Frosting build runner..."
1417
echo "dotnet run -- $@"
15-
dotnet run -- "$@"
18+
dotnet run -- "$@"

‎build/.vscode/launch.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"request": "launch",
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
13-
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/Build.dll",
13+
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/Build.dll",
1414
"args": [],
1515
"cwd": "${workspaceFolder}",
1616
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
@@ -25,4 +25,4 @@
2525
"processId": "${command:pickProcess}"
2626
}
2727
,]
28-
}
28+
}

‎build/Build.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

‎build/Context.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public DotNetCoreTestSettings GetTestSettings()
4141

4242
if (!this.IsRunningOnWindows())
4343
{
44-
var testFramework = "netcoreapp2.1";
44+
var testFramework = "netcoreapp3.1";
4545

4646
this.Information($"Running tests against {testFramework} only as we're not on Windows.");
4747
settings.Framework = testFramework;

‎build/Tasks/CodeCoverage.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ public override void Run(Context context)
2121
context.Information("Executing Code Coverage for Project {0}...", project.Name);
2222

2323
var dotNetCoreCoverage = context.CodeCoverage
24-
.CombineWithFilePath(project.Name + "-netcoreapp2.1.xml");
24+
.CombineWithFilePath(project.Name + "-netcoreapp3.1.xml");
2525
coverageFiles.Add(dotNetCoreCoverage);
2626

2727
context.Coverlet(project, new CoverletToolSettings()
2828
{
2929
Configuration = context.Configuration,
30-
Framework = "netcoreapp2.1",
30+
Framework = "netcoreapp3.1",
3131
Output = dotNetCoreCoverage.FullPath
3232
});
3333

‎global.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "3.1.101"
4+
}
5+
}

0 commit comments

Comments
 (0)
Please sign in to comment.