Skip to content
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ jobs:
- name: Run Tool PowerShell
if: matrix.os == 'windows-latest'
shell: pwsh
run: ./src/dotnet-affected/bin/Debug/net9.0/dotnet-affected -p $Env:GITHUB_WORKSPACE --assume-changes dotnet-affected -v
run: ./src/dotnet-affected/bin/Debug/net10.0/dotnet-affected -p $Env:GITHUB_WORKSPACE --assume-changes dotnet-affected -v

- name: Run Tool Bash
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
shell: bash
run: ./src/dotnet-affected/bin/Debug/net9.0/dotnet-affected -p $GITHUB_WORKSPACE --assume-changes dotnet-affected -v
run: ./src/dotnet-affected/bin/Debug/net10.0/dotnet-affected -p $GITHUB_WORKSPACE --assume-changes dotnet-affected -v

- name: Pack
if: success() && matrix.os == 'ubuntu-latest'
Expand All @@ -82,4 +82,4 @@ jobs:
if: success() && matrix.os == 'ubuntu-latest'
with:
name: artifacts
path: src/dotnet-affected/bin/Debug/net9.0/
path: src/dotnet-affected/bin/Debug/net10.0/
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>

<LangVersion>9.0</LangVersion>

Expand Down
24 changes: 16 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,27 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.Build" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build" Version="17.11.48" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.11.48" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.11.48" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
<PackageVersion Include="System.CodeDom" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Include="Microsoft.Build" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.0" />
<PackageVersion Include="System.CodeDom" Version="9.0.0" />
<PackageVersion Include="Microsoft.Build" Version="17.12.50" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.12.50" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.50" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.11" />
<PackageVersion Include="System.CodeDom" Version="9.0.11" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageVersion Include="Microsoft.Build" Version="18.0.2" />
<PackageVersion Include="Microsoft.Build.Framework" Version="18.0.2" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="18.0.2" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="10.0.0" />
<PackageVersion Include="System.CodeDom" Version="10.0.0" />
</ItemGroup>

</Project>
8 changes: 6 additions & 2 deletions eng/install-sdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ Invoke-WebRequest -Uri $installScriptUrl -OutFile $installScript -MaximumRetryCo
$globalJsonFile = "$PSScriptRoot\..\global.json"
$dotnetInstallDir = "$PSScriptRoot\.dotnet"

. $installScript -InstallDir $dotnetInstallDir -JSonFile $globalJsonFile
. $installScript -InstallDir $dotnetInstallDir -Channel 8.0
# SDK from global.json
. $installScript -InstallDir $dotnetInstallDir -JSonFile $globalJsonFile

# Runtimes for tests
. $installScript -InstallDir $dotnetInstallDir -Channel 8.0
. $installScript -InstallDir $dotnetInstallDir -Channel 9.0
4 changes: 4 additions & 0 deletions eng/install-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ chmod +x "$install_script"
global_json_file="$(dirname "$0")/../global.json"
dotnet_install_dir="$(dirname "$0")/.dotnet"

# SDK from global.json
"$install_script" --install-dir "$dotnet_install_dir" --jsonfile "$global_json_file"

# Runtimes for tests
"$install_script" --install-dir "$dotnet_install_dir" --channel 8.0
"$install_script" --install-dir "$dotnet_install_dir" --channel 9.0
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.101",
"version": "10.0.100",
"allowPrerelease": true
}
}
12 changes: 6 additions & 6 deletions test/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>
<Import Project="../Directory.Packages.props" />
<ItemGroup>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0"/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1"/>
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.core" Version="2.9.2" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.core" Version="2.9.3" />
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.0.0-pre.49"/>
<PackageVersion Include="coverlet.collector" Version="6.0.2"/>
<PackageVersion Include="XunitXml.TestLogger" Version="4.1.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5"/>
<PackageVersion Include="coverlet.collector" Version="6.0.4"/>
<PackageVersion Include="XunitXml.TestLogger" Version="7.0.2" />
</ItemGroup>
</Project>
16 changes: 6 additions & 10 deletions test/DotnetAffected.Tasks.Tests/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,20 @@ public static class Utils

private static readonly Lazy<string> TargetFrameworkLocal = new (() =>
{
var targetFramework = typeof(Utils).Assembly
var targetFrameworkAttribute = typeof(Utils).Assembly
.GetCustomAttributes(typeof(System.Runtime.Versioning.TargetFrameworkAttribute), false)
.OfType<System.Runtime.Versioning.TargetFrameworkAttribute>()
.Single()
.FrameworkName;

var majorVersion = new Regex(".+,Version=v(\\d).(\\d)")
.Match(targetFramework)
.Groups.Values.Skip(1)
.Select(g => int.Parse(g.Value))
.First();
.Single();

var frameworkName = new System.Runtime.Versioning.FrameworkName(targetFrameworkAttribute.FrameworkName);
var majorVersion = frameworkName.Version.Major;

switch (majorVersion)
{
case >= 5:
return $"net{majorVersion}.0";
default:
throw new NotSupportedException($"Invalid TargetFramework: {targetFramework}");
throw new NotSupportedException($"Invalid TargetFramework: {frameworkName}");
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static ProjectRootElement CreateMsBuildProject(
// Directory.Build.Props / Directory.Packages.props
project.Sdk = "Microsoft.NET.Sdk";
// Required for net8.0 MSBuild Project Creation
project.AddProperty("TargetFrameworks", "net8.0;net9.0");
project.AddProperty("TargetFrameworks", "net8.0;net9.0;net10.0");
customizer?.Invoke(project);

project.Save();
Expand Down