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

feature/net8 #150

Merged
merged 7 commits into from
Nov 15, 2023
Merged
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
9 changes: 7 additions & 2 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ stages:
- job: build
steps:

- task: UseDotNet@2
- task: UseDotNet@2 # needed for ESRP sign
displayName: 'Use .NET 6'
inputs:
version: 6.x

- task: UseDotNet@2
displayName: 'Use .NET 8'
inputs:
version: 8.x

- task: PoliCheck@2
displayName: 'Run PoliCheck "/src"'
inputs:
Expand Down Expand Up @@ -75,7 +80,7 @@ stages:
inputs:
command: test
projects: '$(Build.SourcesDirectory)\Microsoft.Kiota.Abstractions.sln'
arguments: '--configuration $(BuildConfiguration) --no-build --framework net6.0'
arguments: '--configuration $(BuildConfiguration) --no-build --framework net8.0'

# CredScan
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3
Expand Down
16 changes: 0 additions & 16 deletions .devcontainer/Dockerfile

This file was deleted.

73 changes: 0 additions & 73 deletions .devcontainer/devcontainer.json

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ name: Build and Test
on:
workflow_dispatch:
push:
branches: [ 'main', 'dev', 'feature/*' ]
branches: ["main", "dev", "feature/*"]
pull_request:
branches: [ 'main', 'dev' ]
branches: ["main", "dev"]

jobs:
build-and-test:
runs-on: windows-latest # Temporary switch to windows till https://github.com/microsoft/vstest/issues/4549 is released in dotnet version after 7.0.400
runs-on: ubuntu-latest
env:
solutionName: Microsoft.Kiota.Abstractions.sln
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3.0.3
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.x
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
Expand Down
28 changes: 13 additions & 15 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
push:
branches:
- main
paths-ignore: ['.vscode/**']
paths-ignore: [".vscode/**"]
pull_request:
types: [opened, synchronize, reopened]
paths-ignore: ['.vscode/**']
paths-ignore: [".vscode/**"]

env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Check whether unity activation requests should be done
id: checksecret_job
run: |
echo "is_SONAR_TOKEN_set=${{ env.SONAR_TOKEN != '' }}" >> $GITHUB_OUTPUT
echo "is_SONAR_TOKEN_set=${{ env.SONAR_TOKEN != '' }}" >> $GITHUB_OUTPUT
build:
needs: [checksecret]
if: needs.checksecret.outputs.is_SONAR_TOKEN_set == 'true'
Expand All @@ -32,19 +32,17 @@ jobs:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
distribution: "adopt"
java-version: 17
- name: Setup .NET 5 # At the moment the scanner requires dotnet 5 https://www.nuget.org/packages/dotnet-sonarscanner
uses: actions/setup-dotnet@v3
with:
dotnet-version: 5.0.x
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
with: # At the moment the scanner requires dotnet 5 https://www.nuget.org/packages/dotnet-sonarscanner
dotnet-version: |
5.x
8.x
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
Expand All @@ -66,13 +64,13 @@ jobs:
dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
CollectCoverage: true
CoverletOutputFormat: 'opencover' # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682
CoverletOutputFormat: "opencover" # https://github.com/microsoft/vstest/issues/4014#issuecomment-1307913682
shell: pwsh
run: |
./.sonar/scanner/dotnet-sonarscanner begin /k:"microsoft_kiota-abstractions-dotnet" /o:"microsoft" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="Microsoft.Kiota.Abstractions.Tests/coverage.net6.0.opencover.xml"
./.sonar/scanner/dotnet-sonarscanner begin /k:"microsoft_kiota-abstractions-dotnet" /o:"microsoft" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="Microsoft.Kiota.Abstractions.Tests/coverage.net8.0.opencover.xml"
dotnet workload restore
dotnet build
dotnet test Microsoft.Kiota.Abstractions.sln --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
50 changes: 25 additions & 25 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/Microsoft.Kiota.Abstractions.Tests/bin/Debug/net6.0/Microsoft.Kiota.Abstractions.Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/Microsoft.Kiota.Abstractions.Tests",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/Microsoft.Kiota.Abstractions.Tests/bin/Debug/net8.0/Microsoft.Kiota.Abstractions.Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/Microsoft.Kiota.Abstractions.Tests",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.7.2] - 2023-11-14

### Added

- Added support for dotnet 8.

## [1.7.1] - 2023-11-13

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<TargetFrameworks>net462;net6.0</TargetFrameworks>
<TargetFrameworks>net462;net8.0</TargetFrameworks>
andrueastman marked this conversation as resolved.
Show resolved Hide resolved
<LangVersion>latest</LangVersion>
<OutputType>Library</OutputType>
<IsTestProject>true</IsTestProject>
Expand All @@ -14,7 +14,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<!-- We need Microsoft.TestPlatform.ObjectModel for net framework execution in linux environments https://github.com/microsoft/vstest/issues/2469-->
<!-- We need Microsoft.TestPlatform.ObjectModel for net framework execution in linux
environments https://github.com/microsoft/vstest/issues/2469-->
<PackageReference Include="Microsoft.TestPlatform.ObjectModel" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.6.1" />
Expand All @@ -32,4 +33,4 @@
<ProjectReference Include="..\src\Microsoft.Kiota.Abstractions.csproj" />
</ItemGroup>

</Project>
</Project>
11 changes: 4 additions & 7 deletions src/Microsoft.Kiota.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageProjectUrl>https://aka.ms/kiota/docs</PackageProjectUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<Deterministic>true</Deterministic>
<VersionPrefix>1.7.1</VersionPrefix>
<VersionPrefix>1.7.2</VersionPrefix>
<VersionSuffix></VersionSuffix>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<SignAssembly>false</SignAssembly>
Expand All @@ -23,7 +23,6 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<IsTrimmable>true</IsTrimmable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- Enable this line once we go live to prevent breaking changes -->
<!-- <PackageValidationBaselineVersion>1.0.0</PackageValidationBaselineVersion> -->
Expand All @@ -34,16 +33,14 @@
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<NoWarn>$(NoWarn);NU5048;NETSDK1138</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFrameworkVersion)' == 'net5.0'">
<IsTrimmable>true</IsTrimmable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="[6.0,8.0)" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="[6.0,9.0)" />
<PackageReference Include="Std.UriTemplate" Version="0.0.46" />
</ItemGroup>

Expand Down