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
1 change: 0 additions & 1 deletion .fallout/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"References",
"ReportCoverage",
"Restore",
"RunTargetInDockerImageTest",
"Test",
"UpdateContributors",
"UpdateStargazers"
Expand Down
270 changes: 0 additions & 270 deletions build/Build.Maintenance.cs

This file was deleted.

10 changes: 8 additions & 2 deletions build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ partial class Build
ITest,
IReportCoverage,
IPublish,
ICreateGitHubRelease
ICreateGitHubRelease,
// Build-local steps (build/Steps/) — each concern is its own component.
IGenerateTools,
IGeneratePublicApi,
IDownloadLicenses,
IHandleExternalRepositories,
IUpdateContributors,
IUpdateStargazers
{
public static int Main() => Execute<Build>(x => ((IPack)x).Pack);

Expand Down Expand Up @@ -70,7 +77,6 @@ partial class Build
string MajorMinorPatchVersion => Major
? $"{ParseMajor(ThisAssembly.AssemblyInformationalVersion) + 1}.0.0"
: ThisAssembly.AssemblyInformationalVersion.Split('+')[0];
string MilestoneTitle => $"v{MajorMinorPatchVersion}";

static int ParseMajor(string informationalVersion)
=> int.Parse(informationalVersion.Split('.')[0]);
Expand Down
45 changes: 45 additions & 0 deletions build/Steps/IDownloadLicenses.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Fallout.Common;
using Fallout.Common.IO;
using Fallout.Components;
using Serilog;
using static Fallout.Common.IO.HttpTasks;

// Step: fetch the third-party licenses bundled into the packages. Hooks into Pack via
// DependentFor<IPack> so it runs as part of the default pipeline, not just on demand.
interface IDownloadLicenses : IFalloutBuild
{
AbsolutePath LicensesDirectory => TemporaryDirectory / "licenses";

IEnumerable<(string Project, string Url)> Licenses
=> new[]
{
("Glob", "https://raw.githubusercontent.com/kthompson/glob/develop/LICENSE"),
("ICSharpCode.SharpZipLib", "https://raw.githubusercontent.com/icsharpcode/SharpZipLib/master/LICENSE.txt"),
("Microsoft.Build", "https://raw.githubusercontent.com/dotnet/msbuild/main/LICENSE"),
("Microsoft.CodeAnalysis", "https://raw.githubusercontent.com/dotnet/roslyn/main/License.txt"),
("Newtonsoft.Json", "https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/LICENSE.md"),
("NuGet", "https://raw.githubusercontent.com/NuGet/NuGet.Client/dev/LICENSE.txt"),
("Octokit", "https://raw.githubusercontent.com/octokit/octokit.net/main/LICENSE.txt"),
("Serilog", "https://raw.githubusercontent.com/serilog/serilog/dev/LICENSE"),
("Spectre.Console", "https://raw.githubusercontent.com/spectreconsole/spectre.console/main/LICENSE.md"),
("YamlDotNet", "https://raw.githubusercontent.com/aaubry/YamlDotNet/master/LICENSE.txt")
};

Target DownloadLicenses => _ => _
.After<ICompile>()
.DependentFor<IPack>()
.Executes(() =>
{
LicensesDirectory.CreateOrCleanDirectory();

var downloadTasks = Licenses.Select(async x =>
{
await HttpDownloadFileAsync(x.Url, LicensesDirectory / $"{x.Project}.txt");
Log.Information("Downloaded license for {Project}", x.Project);
});
Task.WaitAll(downloadTasks.ToArray());
});
}
Loading