Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop .NET Framework and target .NET 8 on all platforms #1418

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 8.0.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.201
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore
Expand All @@ -37,9 +37,9 @@ jobs:
shell: bash
run: |
mkdir -p artifacts/bin
mv out/windows/Installer.Windows/bin/Release/net472/win-x86 artifacts/bin/
cp out/windows/Installer.Windows/bin/Release/net472/win-x86.sym/* artifacts/bin/win-x86/
mv out/windows/Installer.Windows/bin/Release/net472/gcm*.exe artifacts/
mv out/windows/Installer.Windows/bin/Release/net8.0/win-x86 artifacts/bin/
cp out/windows/Installer.Windows/bin/Release/net8.0/win-x86.sym/* artifacts/bin/win-x86/
mv out/windows/Installer.Windows/bin/Release/net8.0/gcm*.exe artifacts/

- name: Upload artifacts
uses: actions/upload-artifact@v3
Expand All @@ -61,7 +61,7 @@ jobs:
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.201
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.201
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Build
run: |
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Build
run: |
Expand Down Expand Up @@ -192,15 +192,15 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Build with signed payload
run: |
dotnet build $env:GITHUB_WORKSPACE\src\windows\Installer.Windows `
/p:PayloadPath=$env:GITHUB_WORKSPACE\payload /p:NoLayout=true `
--configuration=WindowsRelease
mkdir installers
Move-Item -Path .\out\windows\Installer.Windows\bin\Release\net472\*.exe `
Move-Item -Path .\out\windows\Installer.Windows\bin\Release\net8.0\*.exe `
-Destination $env:GITHUB_WORKSPACE\installers

- name: Sign installers with Azure Code Signing
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Build
run: dotnet build --configuration=LinuxRelease
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Build .NET tool
run: |
Expand Down Expand Up @@ -410,7 +410,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Package tool
run: |
Expand Down Expand Up @@ -523,7 +523,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Download artifacts
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -593,7 +593,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Download artifacts
uses: actions/download-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net7.0/git-credential-manager.dll",
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net8.0/git-credential-manager.dll",
"args": ["get"],
"cwd": "${workspaceFolder}/out/shared/Git-Credential-Manager",
"console": "integratedTerminal",
Expand All @@ -22,7 +22,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net7.0/git-credential-manager.dll",
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net8.0/git-credential-manager.dll",
"args": ["store"],
"cwd": "${workspaceFolder}/out/shared/Git-Credential-Manager",
"console": "integratedTerminal",
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"type": "shell",
"group": "test",
"args": [
"~/.nuget/packages/reportgenerator/*/*/net7.0/ReportGenerator.dll",
"~/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll",
"-reports:${workspaceFolder}/**/TestResults/**/coverage.cobertura.xml",
"-targetdir:${workspaceFolder}/out/code-coverage"
],
Expand All @@ -71,7 +71,7 @@
"type": "shell",
"group": "test",
"args": [
"${env:USERROFILE}/.nuget/packages/reportgenerator/*/*/net7.0/ReportGenerator.dll",
"${env:USERROFILE}/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll",
"-reports:${workspaceFolder}/**/TestResults/**/coverage.cobertura.xml",
"-targetdir:${workspaceFolder}/out/code-coverage"
],
Expand Down
6 changes: 0 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,4 @@
<GenerateWindowsAppManifest Condition="'$(GenerateWindowsAppManifest)' == '' AND '$(OSPlatform)' == 'windows' AND '$(_IsExeProject)' == 'true'">true</GenerateWindowsAppManifest>
</PropertyGroup>

<ItemGroup Condition = "'$(TargetFramework)' == 'net472'">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to be getting rid of this!

<PackageReference Include="System.Text.Json">
<Version>7.0.2</Version>
</PackageReference>
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,9 @@
</ItemGroup>
</Target>

<PropertyGroup>
<!-- Ignore platform API compatibilty checks in test projects -->
<NoWarn Condition="'$(IsTestProject)'=='true'">$(NoWarn);CA1416</NoWarn>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion build/GCM.MSBuild.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

Expand Down
8 changes: 4 additions & 4 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ To build from the command line, run:
dotnet build -c WindowsDebug
```

You can find a copy of the installer .exe file in `out\windows\Installer.Windows\bin\Debug\net472`.
You can find a copy of the installer .exe file in `out\windows\Installer.Windows\bin\Debug\net8.0`.

The flat binaries can also be found in `out\windows\Payload.Windows\bin\Debug\net472\win-x86`.
The flat binaries can also be found in `out\windows\Payload.Windows\bin\Debug\net8.0\win-x86`.

### Linux

Expand Down Expand Up @@ -209,13 +209,13 @@ HTML reports can be generated using ReportGenerator, this should be installed
during the build process, from the command line:

```shell
dotnet ~/.nuget/packages/reportgenerator/*/*/net7.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
dotnet ~/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
```

or

```shell
dotnet {$env:USERPROFILE}/.nuget/packages/reportgenerator/*/*/net7.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
dotnet {$env:USERPROFILE}/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
```

Or via VSCode Terminal/Run Task:
Expand Down
2 changes: 1 addition & 1 deletion src/linux/Packaging.Linux/Packaging.Linux.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/linux/Packaging.Linux/install-from-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ case "$distribution" in
# Install dotnet packages and dependencies if needed.
if [ -z "$(verify_existing_dotnet_installation)" ]; then
# First try to use native feeds (Ubuntu 22.04 and later).
if ! apt_install dotnet7; then
if ! apt_install dotnet8; then
# If the native feeds fail, we fall back to
# packages.microsoft.com. We begin by adding the dotnet package
# repository/signing key.
Expand Down
2 changes: 1 addition & 1 deletion src/linux/Packaging.Linux/layout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ GCM_SRC="$SRC/shared/Git-Credential-Manager"
PROJ_OUT="$OUT/linux/Packaging.Linux"

# Build parameters
FRAMEWORK=net7.0
FRAMEWORK=net8.0
RUNTIME=linux-x64

# Perform pre-execution checks
Expand Down
2 changes: 1 addition & 1 deletion src/osx/Installer.Mac/Installer.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/osx/Installer.Mac/layout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ GCM_SRC="$SRC/shared/Git-Credential-Manager"
GCM_UI_SRC="$SRC/shared/Git-Credential-Manager.UI.Avalonia"

# Build parameters
FRAMEWORK=net7.0
FRAMEWORK=net8.0

# Parse script arguments
for i in "$@"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<LangVersion>latest</LangVersion>
Expand Down
7 changes: 1 addition & 6 deletions src/shared/Atlassian.Bitbucket/Atlassian.Bitbucket.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net7.0;net472</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>Atlassian.Bitbucket</AssemblyName>
<RootNamespace>Atlassian.Bitbucket</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand All @@ -13,10 +12,6 @@
<ProjectReference Include="..\Core\Core.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<Reference Include="System.Net.Http" />
</ItemGroup>

<ItemGroup>
<AvaloniaResource Include="UI\Assets\atlassian-logo.png" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/Core.Tests/Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<LangVersion>latest</LangVersion>
Expand Down
4 changes: 0 additions & 4 deletions src/shared/Core/Authentication/AuthenticationBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ protected internal virtual async Task<IDictionary<string, string>> InvokeHelperA
// Write the standard input to the process if we have any to write
if (standardInput is not null)
{
#if NETFRAMEWORK
await standardInput.BaseStream.CopyToAsync(process.StandardInput.BaseStream);
#else
await standardInput.BaseStream.CopyToAsync(process.StandardInput.BaseStream, ct);
#endif
process.StandardInput.Close();
}

Expand Down
Loading