Skip to content
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
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<DebugType>embedded</DebugType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -53,15 +54,14 @@
<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="$(MSBuildProjectName.EndsWith('Tests')) Or $(MSBuildProjectName.EndsWith('Specs'))">
<ItemGroup Condition="$(MSBuildProjectName.EndsWith('Specs'))">
<PackageReference Include="coverlet.msbuild" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="GitHubActionsTestLogger" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<!-- <PackageReference Include="TeamCity.VSTest.TestAdapter" />-->
<PackageReference Include="Verify.Xunit" />
<PackageReference Include="Verify.XunitV3" />
<PackageReference Include="Verify.DiffPlex" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.v3.mtp-v2" />
<PackageReference Include="xunit.runner.visualstudio" />
</ItemGroup>

Expand Down
43 changes: 21 additions & 22 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Azure.Identity" Version="1.17.1" />
<PackageVersion Include="Azure.Security.KeyVault.Certificates" Version="4.8.0" />
<PackageVersion Include="Azure.Security.KeyVault.Keys" Version="4.8.0" />
<PackageVersion Include="Azure.Security.KeyVault.Secrets" Version="4.8.0" />
<PackageVersion Include="Basic.Reference.Assemblies.NetStandard20" Version="1.7.9" />
<PackageVersion Include="Azure.Identity" Version="1.21.0" />
<PackageVersion Include="Azure.Security.KeyVault.Certificates" Version="4.9.0" />
<PackageVersion Include="Azure.Security.KeyVault.Keys" Version="4.10.0" />
<PackageVersion Include="Azure.Security.KeyVault.Secrets" Version="4.11.0" />
<PackageVersion Include="Basic.Reference.Assemblies.NetStandard20" Version="1.8.9" />
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="Glob" Version="1.1.9" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.71" />
<PackageVersion Include="Humanizer" Version="3.0.1" />
<PackageVersion Include="HtmlAgilityPack" Version="1.12.4" />
<PackageVersion Include="Humanizer" Version="3.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="10.0.0" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.7.115" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="NuGet.Packaging" Version="6.14.3" />
<PackageVersion Include="Octokit" Version="14.0.0" />
<PackageVersion Include="Serilog" Version="4.3.0" />
<PackageVersion Include="Serilog" Version="4.3.1" />
<PackageVersion Include="Serilog.Formatting.Compact" Version="3.0.0" />
<PackageVersion Include="Serilog.Formatting.Compact.Reader" Version="4.0.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.1.1" />
Expand All @@ -28,22 +28,21 @@
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Security.Cryptography.Xml" Version="10.0.6" />
<PackageVersion Include="System.Text.Json" Version="10.0.8" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="System.Text.Json" Version="10.0.9" />
<PackageVersion Include="YamlDotNet" Version="18.1.0" />
<PackageVersion Include="Spectre.Console" Version="0.49.1" />
</ItemGroup>
<!-- Testing -->
<ItemGroup>
<PackageVersion Include="coverlet.msbuild" Version="6.0.4" />
<PackageVersion Include="coverlet.msbuild" Version="10.0.1" />
<PackageVersion Include="FluentAssertions" Version="8.10.0" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.7.0" />
<PackageVersion Include="NetArchTest.Rules" Version="1.3.2" />
<!-- <PackageVersion Include="TeamCity.VSTest.TestAdapter" Version="1.0.41" />-->
<PackageVersion Include="Verify.Xunit" Version="31.7.1" />
<PackageVersion Include="Verify.DiffPlex" Version="3.1.2" />
<PackageVersion Include="Verify.XunitV3" Version="31.22.0" />
<PackageVersion Include="Verify.DiffPlex" Version="3.3.0" />
<PackageVersion Include="Verify.SourceGenerators" Version="2.5.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.v3.mtp-v2" Version="3.2.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
</ItemGroup>
<!-- Roslyn (Fallout.SourceGenerator + Fallout.Cli + Fallout.Migrate.Analyzers) -->
Expand All @@ -64,15 +63,15 @@
<PackageVersion Include="PolySharp" Version="1.15.0" />
<PackageVersion Include="System.Memory" Version="4.6.3" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
<PackageVersion Include="Scriban" Version="7.2.0" />
<PackageVersion Include="Scriban" Version="7.2.5" />
</ItemGroup>
<!-- MSBuild (Fallout.ProjectModel + Fallout.MSBuildTasks) -->
<ItemGroup>
<PackageVersion Include="Microsoft.Build.Locator" Version="1.7.8" />
<PackageVersion Include="Microsoft.Build" Version="18.0.2" />
<PackageVersion Include="Microsoft.Build.Framework" Version="18.0.2" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="18.0.2" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="18.0.2" />
<PackageVersion Include="Microsoft.Build" Version="18.7.1" />
<PackageVersion Include="Microsoft.Build.Framework" Version="18.7.1" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="18.7.1" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="18.7.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Update="Microsoft.Build" Version="17.14.28" />
Expand Down
2 changes: 1 addition & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.6" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.9" />
<!-- Nerdbank.GitVersioning lets us read ThisAssembly.AssemblyInformationalVersion in
Build.cs as the canonical version source. Replaces GitVersion.Tool (#81). Direct
dependency because _build.csproj turns off central package management. -->
Expand Down
11 changes: 7 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"sdk": {
"version": "10.0.100",
"rollForward": "latestMinor"
}
"sdk": {
"version": "10.0.100",
"rollForward": "latestMinor"
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
4 changes: 1 addition & 3 deletions src/Fallout.Build/Telemetry/Telemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ internal static partial class Telemetry
private const string VersionPropertyName = "FalloutTelemetryVersion";
private const string LegacyVersionPropertyName = "NukeTelemetryVersion";

private static readonly int? s_confirmedVersion;

static Telemetry()
{
var optoutParameter = ParameterService.GetParameter<string>(OptOutEnvironmentKey)
Expand Down Expand Up @@ -123,4 +121,4 @@ private static void WaitForEnter()
response = Console.ReadKey(intercept: true).Key;
} while (response != ConsoleKey.Enter);
}
}
}
1 change: 1 addition & 0 deletions src/Fallout.Cli/Commands/IFalloutCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal interface IFalloutCommand
/// The command name as typed after the <c>:</c> prefix (prefer dash form, e.g. <c>"add-package"</c>).\
/// Matched case-insensitively and with dashes ignored (so <c>:addpackage</c> also matches).\
/// Legacy commands may still use PascalCase names (e.g. <c>"GetNextDirectory"</c>).
/// </summary>
string Name { get; }

/// <summary>
Expand Down
18 changes: 9 additions & 9 deletions src/Fallout.Components/ITest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ IEnumerable<string> GetOutcomes(AbsolutePath file)

sealed Configure<DotNetTestSettings, Project> TestProjectSettingsBase => (_, v) => _
.SetProjectFile(v)
// https://github.com/Tyrrrz/GitHubActionsTestLogger
.When(GitHubActions.Instance is not null && v.HasPackageReference("GitHubActionsTestLogger"), _ => _
.AddLoggers("GitHubActions;report-warnings=false"))
// https://github.com/JetBrains/TeamCity.VSTest.TestAdapter
.When(TeamCity.Instance is not null && v.HasPackageReference("TeamCity.VSTest.TestAdapter"), _ => _
.AddLoggers("TeamCity")
// https://github.com/xunit/visualstudio.xunit/pull/108
.AddRunSetting("RunConfiguration.NoAutoReporters", bool.TrueString))
.AddLoggers($"trx;LogFileName={v.Name}.trx")
// // https://github.com/Tyrrrz/GitHubActionsTestLogger
// .When(GitHubActions.Instance is not null && v.HasPackageReference("GitHubActionsTestLogger"), _ => _
// .AddLoggers("GitHubActions;report-warnings=false"))
// // https://github.com/JetBrains/TeamCity.VSTest.TestAdapter
// .When(TeamCity.Instance is not null && v.HasPackageReference("TeamCity.VSTest.TestAdapter"), _ => _
// .AddLoggers("TeamCity")
// // https://github.com/xunit/visualstudio.xunit/pull/108
// .AddRunSetting("RunConfiguration.NoAutoReporters", bool.TrueString))
// .AddLoggers($"trx;LogFileName={v.Name}.trx")
.When(InvokedTargets.Contains((this as IReportCoverage)?.ReportCoverage) || IsServerBuild, _ => _
.SetCoverletOutput(TestResultDirectory / $"{v.Name}.xml"));

Expand Down
3 changes: 1 addition & 2 deletions src/Fallout.MSBuildTasks/CodeGenerationTask.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using System;
using System.Linq;
using Microsoft.Build.Framework;
using Fallout.CodeGeneration;
using Fallout.CodeGeneration.Model;
using Fallout.Common.IO;
using Fallout.Common.Utilities.Collections;
using AbsolutePath = Fallout.Common.IO.AbsolutePath;

namespace Fallout.MSBuildTasks;

Expand Down
13 changes: 8 additions & 5 deletions src/Fallout.SourceGenerators/Fallout.SourceGenerators.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" VersionOverride="4.7.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
<PackageReference Include="Scriban" PrivateAssets="all" GeneratePathProperty="true" />
<PackageReference Include="Glob" PrivateAssets="all" GeneratePathProperty="true" />
</ItemGroup>

<ItemGroup>
<None Include="$(MSBuildProjectDirectory)\..\Persistence\Fallout.Persistence.Solution\bin\$(Configuration)\netstandard2.0\Fallout.Persistence.Solution.dll" CopyToOutputDirectory="PreserveNewest" Visible="false" />
<None Include="$(PkgScriban)\lib\netstandard2.0\*.*" CopyToOutputDirectory="PreserveNewest" Visible="false" />
<None Include="$(PkgGlob)\lib\netstandard2.0\*.*" CopyToOutputDirectory="PreserveNewest" Visible="false" />
</ItemGroup>

<PropertyGroup>
Expand All @@ -39,13 +41,14 @@
<!-- TODO: check for easier method https://github.com/dotnet/roslyn/issues/52017#issuecomment-809113013 -->
<Target Name="GetDependencyTargetPaths">
<ItemGroup>
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetFramework)\Fallout.Build.Shared.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetFramework)\Fallout.Solution.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetFramework)\Fallout.Utilities.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildProjectDirectory)\bin\$(Configuration)\$(TargetFramework)\Fallout.Utilities.IO.Globbing.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildProjectDirectory)\bin\$(Configuration)\netstandard2.0\Fallout.Build.Shared.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildProjectDirectory)\bin\$(Configuration)\netstandard2.0\Fallout.Solution.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildProjectDirectory)\bin\$(Configuration)\netstandard2.0\Fallout.Utilities.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildProjectDirectory)\bin\$(Configuration)\netstandard2.0\Fallout.Utilities.IO.Globbing.dll" IncludeRuntimeDependency="false" />

<TargetPathWithTargetPlatformMoniker Include="$(MSBuildProjectDirectory)\..\Persistence\Fallout.Persistence.Solution\bin\$(Configuration)\netstandard2.0\Fallout.Persistence.Solution.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(PkgScriban)\lib\$(TargetFramework)\*.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(PkgScriban)\lib\netstandard2.0\*.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(PkgGlob)\lib\netstandard2.0\*.dll" IncludeRuntimeDependency="false" />
</ItemGroup>
</Target>

Expand Down
2 changes: 1 addition & 1 deletion src/Persistence/Fallout.Persistence.Solution/Shims.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static bool Contains(this string str, char c)
return str.Contains(c.ToString());
}

public static bool TryGetValue<T>(this HashSet<T> set, T equalValue, out T actualValue)
public static bool TryGetValue<T>(this HashSet<T> set, T equalValue, out T? actualValue)
{
foreach (var item in set)
{
Expand Down
7 changes: 3 additions & 4 deletions tests/Fallout.Common.Specs/CISpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ private static object CreateInstance(Type type)

private static bool IsRunning(Type type)
{
var property = type.GetProperty($"IsRunning{type.Name}", BindingFlags.NonPublic | BindingFlags.Static).NotNull();
return (bool) property.GetValue(obj: null);
var property = type?.GetProperty($"IsRunning{type.Name}", BindingFlags.NonPublic | BindingFlags.Static).NotNull();
return (bool?)property?.GetValue(obj: null) ?? false;
}

private class CITheoryAttribute : TheoryAttribute
Expand All @@ -127,8 +127,7 @@ private class CITheoryAttribute : TheoryAttribute
public CITheoryAttribute(Type type)
{
_type = type;
Skip = !IsRunning(_type) ? $"Only applies to {_type.Name}." : null;
}

public override string Skip => !IsRunning(_type) ? $"Only applies to {_type.Name}." : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
IsEmpty: true,
Unreleased: true,
Notes: [

],
StartIndex: 6,
EndIndex: 7
Expand All @@ -15,7 +15,7 @@
Notes: [
- Added something,
- Fixed something,

],
StartIndex: 8,
EndIndex: 11
Expand All @@ -26,7 +26,7 @@
Version: 1.2.2,
Notes: [
- Fixed something,

],
StartIndex: 12,
EndIndex: 14
Expand All @@ -37,7 +37,7 @@
Version: 0.2.0,
Notes: [
- Added something,

],
StartIndex: 15,
EndIndex: 17
Expand All @@ -54,4 +54,4 @@
StartIndex: 18,
EndIndex: 21
}
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Unreleased: true,
Notes: [
- Changed something,

],
StartIndex: 6,
EndIndex: 8
Expand All @@ -15,12 +15,12 @@
Version: 1.0.0,
Notes: [
- Some text that spans,
multiple lines,
multiple lines,
- A text on a single line,
,
- Added something,
- Fixed something,

],
StartIndex: 9,
EndIndex: 16
Expand All @@ -39,4 +39,4 @@
StartIndex: 17,
EndIndex: 22
}
]
]
2 changes: 1 addition & 1 deletion tests/Fallout.Core.Specs/ArchitectureFitnessSpecs.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System.Linq;
using System.Reflection;
using FluentAssertions;
using Fallout.Core.Planning;
using NetArchTest.Rules;
using Xunit;
using TestResult = NetArchTest.Rules.TestResult;

namespace Fallout.Core.Specs;

Expand Down
2 changes: 1 addition & 1 deletion tests/Fallout.ProjectModel.Specs/ProjectModelSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void ProjectSpec()
project.GetTargetFrameworks().Should().Equal("net8.0", "net9.0", "net10.0");
project.HasPackageReference("Microsoft.Build.Locator").Should().BeTrue();
project.GetPackageReferenceVersion("Microsoft.Build.Locator").Should().Be("1.7.8");
project.GetPackageReferenceVersion("Microsoft.Build").Should().Be("18.0.2");
project.GetPackageReferenceVersion("Microsoft.Build").Should().Be("18.7.1");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using FluentAssertions;
using Fallout.Common.IO;
using Xunit;
using Xunit.Abstractions;

namespace Fallout.Common.Specs;

Expand Down
12 changes: 8 additions & 4 deletions tests/Fallout.Utilities.Specs/IO/FileSystemDependentSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using Fallout.Common;
using Fallout.Common.IO;
using Xunit.Abstractions;
using Xunit;
using Xunit.Sdk;

namespace Fallout.Common.Specs;

Expand All @@ -21,9 +23,11 @@ protected FileSystemDependentSpecs(ITestOutputHelper testOutputHelper)
{
TestOutputHelper = testOutputHelper;

TestName = ((ITest) testOutputHelper.GetType()
.GetField("test", BindingFlags.NonPublic | BindingFlags.Instance).NotNull()
.GetValue(testOutputHelper).NotNull()).TestCase.TestMethod.Method.Name;
TestName = TestContext.Current.Test?.TestDisplayName ?? "";
TestName = Regex.Replace(TestName, @"[<>:""/\\|?*\x00-\x1F]", "_").Trim().TrimEnd('.', ' ');
TestName = Regex.IsMatch(TestName, "^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$", RegexOptions.IgnoreCase)
? $"_{TestName}"
: TestName;

ExecutionDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).NotNull();
RootDirectory = Constants.TryGetRootDirectoryFrom(EnvironmentInfo.WorkingDirectory);
Expand Down
1 change: 0 additions & 1 deletion tests/Fallout.Utilities.Specs/IO/MoveCopySpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Fallout.Common.IO;
using Fallout.Common.Utilities.Collections;
using Xunit;
using Xunit.Abstractions;

namespace Fallout.Common.Specs;

Expand Down
Loading