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

Update SDK and projects to target .NET 8 #16

Merged
merged 9 commits into from
Nov 16, 2024
9 changes: 7 additions & 2 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ steps:
inputs:
secureFile: 'DaxFormatter.snk'
- task: UseDotNet@2
displayName: '.NET setup'
displayName: 'Install .NET SDK'
inputs:
packageType: sdk
version: 6.0.x
useGlobalJson: true
- task: UseDotNet@2
displayName: 'Install .NET 6.0 runtime'
inputs:
packageType: runtime
version: '6.0.x'
- task: DotNetCoreCLI@2
displayName: '.NET restore'
inputs:
Expand Down
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "nuget"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
assignees:
- "albertospelta"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
assignees:
- "albertospelta"
31 changes: 15 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI
name: ci

on:
push:
branches:
Expand All @@ -7,8 +8,7 @@ on:
branches:
- master
workflow_dispatch:
env:
CONFIGURATION: 'Release'

jobs:
build-and-test:
name: build-and-test--${{ matrix.os-version }}
Expand All @@ -17,18 +17,17 @@ jobs:
matrix:
os-version: [windows-latest] #, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: .NET setup
uses: actions/setup-dotnet@v1
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: .NET info
run: dotnet --info
- name: .NET restore
dotnet-version: |
6.0.x
global-json-file: global.json
- name: restore
run: dotnet restore ./src
- name: .NET build
run: dotnet build ./src/Dax.Formatter.sln --configuration ${{ env.CONFIGURATION }} --no-restore
- name: .NET test
run: dotnet test ./src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj --configuration ${{ env.CONFIGURATION }} --no-build --verbosity normal
- name: .NET pack
run: dotnet pack ./src/Dax.Formatter/Dax.Formatter.csproj --configuration ${{ env.CONFIGURATION }} --no-build --no-restore --verbosity normal
- name: build
run: dotnet build ./src/Dax.Formatter.sln --configuration Release --no-restore
- name: test
run: dotnet test ./src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj --configuration Release --no-build --verbosity normal
- name: pack
run: dotnet pack ./src/Dax.Formatter/Dax.Formatter.csproj --configuration Release --no-build --no-restore --verbosity normal
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.100",
"version": "8.0.400",
"allowPrerelease": false,
"rollForward": "latestFeature"
}
Expand Down
2 changes: 1 addition & 1 deletion samples/getting-started/BasicFormatter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Dax.Formatter.Tests/Dax.Formatter.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<TargetFrameworks>net472;net6.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion src/Dax.Formatter.Tests/Security/SecurityHelpersTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class SecurityHelpersTests
[InlineData("abcdefghiABCDEFGHI??=", "1bca6736f96f84e35fa921938f45ba981a6e3f6aa02bcf46763009d3614cf89d")]
[InlineData("", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855")]
[InlineData(null, null)]
public void SecurityHelpers_ToHashSHA256_ComputeCorrectResult(string value, string expected)
public void SecurityHelpers_ToHashSHA256_ComputeCorrectResult(string? value, string? expected)
{
var actual = value.ToHashSHA256();
Assert.Equal(expected, actual);
Expand Down
23 changes: 12 additions & 11 deletions src/Dax.Formatter/Dax.Formatter.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<NeutralLanguage>en-US</NeutralLanguage>
Expand All @@ -25,14 +25,16 @@
<PackageIcon>package-icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIconUrl>https://raw.githubusercontent.com/sql-bi/DaxFormatter/master/src/package-icon.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/sql-bi/DaxFormatter</PackageProjectUrl>
<RepositoryUrl>https://github.com/sql-bi/DaxFormatter</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryBranch>master</RepositoryBranch>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Deterministic>true</Deterministic>
<DebugType>embedded</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>

Expand All @@ -43,12 +45,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="6.0.0" />
<PackageReference Include="System.Text.Json" Version="6.0.3" />
<PackageReference Include="System.Text.Json" Version="6.0.11" Condition="'$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'netstandard2.0'" />
<PackageReference Include="System.Text.Json" Version="8.0.5" Condition="'$(TargetFramework)' == 'net8.0'" />
</ItemGroup>

<PropertyGroup>
Expand All @@ -61,5 +59,8 @@
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<AssemblyTitle>Dax.Formatter .NET 6.0</AssemblyTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0'">
<AssemblyTitle>Dax.Formatter .NET 8.0</AssemblyTitle>
</PropertyGroup>

</Project>