Skip to content

Commit 1171057

Browse files
authored
NOTICE.txt includes all dep's notices for container redistribution (#69)
1 parent 5fc8ed4 commit 1171057

File tree

3 files changed

+152
-5
lines changed

3 files changed

+152
-5
lines changed

NOTICE.txt

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,87 @@
1-
Elastic .NET OpenTelemetry Distribution
2-
Copyright 2012-2024 Elasticsearch B.V.
1+
Elastic Documentation Tooling
2+
Copyright 2024-2024 Elasticsearch B.V.
3+
4+
5+
License notice for Errata (v0.13.0)
6+
------------------------------------
7+
https://github.com/spectreconsole/errata at 2f819fb40220b14f00e4678a5499768f7437c1ee
8+
Patrik Svensson, Phil Scott, James Randall
9+
Licensed under MIT
10+
Available at https://licenses.nuget.org/MIT
11+
12+
License notice for GitHub.Actions.Core (v8.1.1)
13+
------------------------------------
14+
https://github.com/IEvangelist/dotnet-github-actions-sdk at 57f96243866a8143e0c52dd00776d7a345c15681
15+
Copyright © 2022-2024 David Pine
16+
Licensed under MIT
17+
Available at https://licenses.nuget.org/MIT
18+
19+
License notice for DotNet.Glob (v3.1.3)
20+
------------------------------------
21+
https://github.com/dazinator/DotNet.Glob.git at 6f8a320a9cc6069e80f36bb24f777a21d1c48064
22+
https://github.com/dazinator/DotNet.Glob
23+
License available at https://github.com/dazinator/DotNet.Glob/blob/master/LICENSE
24+
25+
License notice for Markdig (v0.37.0)
26+
------------------------------------
27+
https://github.com/xoofx/markdig at 1a1bbecc467a800dd6b39e68825df50309f6065c
28+
https://github.com/lunet-io/markdig
29+
Alexandre Mutel
30+
Licensed under BSD-2-Clause
31+
Available at https://licenses.nuget.org/BSD-2-Clause
32+
33+
License notice for RazorSlices (v0.8.1)
34+
------------------------------------
35+
https://github.com/DamianEdwards/RazorSlices at 65fde587ac2363d8af45ca551eb845d141aba7d2
36+
Copyright © Damian Edwards
37+
Licensed under MIT
38+
Available at https://licenses.nuget.org/MIT
39+
40+
License notice for Slugify.Core (v4.0.1)
41+
------------------------------------
42+
https://github.com/ctolkien/Slugify at d480e12e3a1451e4b5ca5f070b7fb58db8f48b6c
43+
Licensed under MIT
44+
Available at https://licenses.nuget.org/MIT
45+
46+
License notice for Spectre.Console (v0.47.0)
47+
------------------------------------
48+
https://github.com/spectreconsole/spectre.console at 018f4ebd17b379e6455b3ac071ad144fc648a84a
49+
Patrik Svensson, Phil Scott, Nils Andresen
50+
Licensed under MIT
51+
Available at https://licenses.nuget.org/MIT
52+
53+
License notice for TestableIO.System.IO.Abstractions (v21.0.29)
54+
------------------------------------
55+
https://github.com/TestableIO/System.IO.Abstractions at f4afa40042a9ebea35abee195d5d49a46846523f
56+
Copyright © Tatham Oddie & friends 2010-2024
57+
Licensed under MIT
58+
Available at https://licenses.nuget.org/MIT
59+
60+
License notice for TestableIO.System.IO.Abstractions.Wrappers (v21.0.29)
61+
------------------------------------
62+
https://github.com/TestableIO/System.IO.Abstractions at f4afa40042a9ebea35abee195d5d49a46846523f
63+
Copyright © Tatham Oddie & friends 2010-2024
64+
Licensed under MIT
65+
Available at https://licenses.nuget.org/MIT
66+
67+
License notice for Utf8StreamReader (v1.3.2)
68+
------------------------------------
69+
https://github.com/Cysharp/Utf8StreamReader at 35e2361b7a67e0838b777262c4a7798da50206ca
70+
Copyright © Cysharp, Inc.
71+
Licensed under MIT
72+
Available at https://licenses.nuget.org/MIT
73+
74+
License notice for Vecc.YamlDotNet.Analyzers.StaticGenerator (v16.1.3)
75+
------------------------------------
76+
https://github.com/aaubry/YamlDotNet.git
77+
https://github.com/aaubry/YamlDotNet/wiki
78+
Available at https://aka.ms/deprecateLicenseUrl
79+
LICENSE.txt
80+
81+
License notice for YamlDotNet (v16.1.3)
82+
------------------------------------
83+
https://github.com/aaubry/YamlDotNet at 7923dd8e600f7fea7710f3b45f3fadcfa1aa589c
84+
https://github.com/aaubry/YamlDotNet/wiki
85+
Copyright (c) Antoine Aubry and contributors
86+
Licensed under MIT
87+
Available at https://licenses.nuget.org/MIT

build/Program.cs

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,64 @@
88
//using static Zx.Env;
99

1010
var app = ConsoleApp.Create();
11-
app.Add("", async (Cancel _) =>
11+
12+
app.Add("", async Task<int> (Cancel ctx) =>
1213
{
1314
await "dotnet tool restore";
1415
await "dotnet build -c Release --verbosity minimal";
16+
await File.WriteAllTextAsync("NOTICE.txt",
17+
$"""
18+
Elastic Documentation Tooling
19+
Copyright 2024-{DateTime.UtcNow.Year} Elasticsearch B.V.
20+
21+
22+
""", ctx);
23+
await "dotnet thirdlicense --project src/docs-builder/docs-builder.csproj --output .artifacts/NOTICE_temp.txt";
24+
await File.AppendAllTextAsync("NOTICE.txt", File.ReadAllText(".artifacts/NOTICE_temp.txt"), ctx);
25+
26+
//bit hacky for now clean this up later
27+
var lines = await File.ReadAllLinesAsync("NOTICE.txt");
28+
var newLines = new List<string>(lines.Length);
29+
var bclReference = false;
30+
for (var index = 0; index < lines.Length; index++)
31+
{
32+
var line = lines[index];
33+
if (index <= 2)
34+
{
35+
newLines.Add(line);
36+
continue;
37+
}
38+
39+
if (line.StartsWith("License notice for"))
40+
{
41+
if (line.StartsWith("License notice for System.") || line.StartsWith("License notice for Microsoft."))
42+
bclReference = true;
43+
else
44+
{
45+
bclReference = false;
46+
newLines.Add("");
47+
}
48+
}
49+
if (string.IsNullOrWhiteSpace(line) || bclReference) continue;
50+
newLines.Add(line);
51+
}
52+
await File.WriteAllLinesAsync("NOTICE.txt", newLines, ctx);
53+
54+
try
55+
{
56+
await "git status --porcelain";
57+
}
58+
catch (Exception ex)
59+
{
60+
Console.WriteLine(ex.ToString());
61+
Console.WriteLine("The build left unchecked artifacts in the source folder");
62+
await "git diff NOTICE.txt";
63+
return 1;
64+
}
65+
66+
return 0;
1567
});
68+
1669
app.Add("publish", async (Cancel _) =>
1770
{
1871
var source = "src/docs-builder/docs-builder.csproj";

dotnet-tools.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,22 @@
66
"version": "5.0.0",
77
"commands": [
88
"minver"
9-
]
9+
],
10+
"rollForward": false
1011
},
1112
"dotnet-project-licenses": {
1213
"version": "2.7.1",
1314
"commands": [
1415
"dotnet-project-licenses"
15-
]
16+
],
17+
"rollForward": false
18+
},
19+
"thirdlicense": {
20+
"version": "1.3.1",
21+
"commands": [
22+
"thirdlicense"
23+
],
24+
"rollForward": false
1625
}
1726
}
1827
}

0 commit comments

Comments
 (0)