Skip to content

Commit

Permalink
Add .NET 8.0 as Target Framework, migrate TOM (#54)
Browse files Browse the repository at this point in the history
* Update .NET SDK version in global.json to 8.0.400

* Add net8.0 as target frameworks

* Update project properties and CI build settings

* Migrate TOM from the legacy `.retail.amd64` to the newer multi-runtime packages

* Update test projects dependencies

* Refactor CI pipeline for .NET 8

* Add dependabot.yml
  • Loading branch information
albertospelta authored Nov 12, 2024
1 parent dd77b10 commit f696138
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 49 deletions.
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: 'DaxTemplate.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"
29 changes: 14 additions & 15 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:
- main
workflow_dispatch:
env:
CONFIGURATION: 'Release'

jobs:
build-and-test:
name: build-and-test--${{ matrix.os-version }}
Expand All @@ -18,17 +18,16 @@ jobs:
os-version: [windows-latest] #, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: .NET setup
uses: actions/setup-dotnet@v1
- 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.Template.sln --configuration ${{ env.CONFIGURATION }} --no-restore
- name: .NET test
run: dotnet test ./src/Dax.Template.Tests/Dax.Template.Tests.csproj --configuration ${{ env.CONFIGURATION }} --no-build --verbosity normal
- name: .NET pack
run: dotnet pack ./src/Dax.Template/Dax.Template.csproj --configuration ${{ env.CONFIGURATION }} --no-build --no-restore --verbosity normal
- name: build
run: dotnet build ./src/Dax.Template.sln --configuration Release --no-restore
- name: test
run: dotnet test ./src/Dax.Template.Tests/Dax.Template.Tests.csproj --configuration Release --no-build --verbosity normal
- name: pack
run: dotnet pack ./src/Dax.Template/Dax.Template.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
4 changes: 2 additions & 2 deletions src/Dax.Template.TestUI/Dax.Template.TestUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
13 changes: 6 additions & 7 deletions src/Dax.Template.Tests/Dax.Template.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<!--TargetFrameworks>net461;net6.0</TargetFrameworks-->
<LangVersion>latest</LangVersion>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
33 changes: 11 additions & 22 deletions src/Dax.Template/Dax.Template.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<!--TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks-->
<LangVersion>latest</LangVersion>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable>
<NeutralLanguage>en-US</NeutralLanguage>
<IsPackable>true</IsPackable>
Expand All @@ -26,42 +25,32 @@
<PackageIcon>package-icon.png</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIconUrl>https://raw.githubusercontent.com/sql-bi/DaxTemplate/main/src/package-icon.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/sql-bi/DaxTemplate</PackageProjectUrl>
<RepositoryUrl>https://github.com/sql-bi/DaxTemplate</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryBranch>main</RepositoryBranch>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugSymbols>true</DebugSymbols>
<DebugType>embedded</DebugType>
<IncludeSymbols>false</IncludeSymbols>
<Deterministic>true</Deterministic>
</PropertyGroup>

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

<ItemGroup>
<None Include="..\..\LICENSE.md" Pack="true" PackagePath="\" />
<None Include="..\..\README.md" Pack="true" PackagePath="\" />
<None Include="..\..\package-icon.png" Pack="true" PackagePath="\" />
</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="Microsoft.AnalysisServices.AdomdClient.NetCore.retail.amd64" Version="19.77.0" />
<PackageReference Include="Microsoft.AnalysisServices.NetCore.retail.amd64" Version="19.77.0" />
<PackageReference Include="Microsoft.AnalysisServices.AdomdClient" Version="19.86.6" />
<PackageReference Include="Microsoft.AnalysisServices" Version="19.86.6" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(AdditionalConstants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<AssemblyTitle>Dax.Template .NET Standard 2.0</AssemblyTitle>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0'">
<AssemblyTitle>Dax.Template .NET 6.0</AssemblyTitle>
</PropertyGroup>

</Project>

0 comments on commit f696138

Please sign in to comment.