Skip to content

Commit 978b56d

Browse files
committed
Limit NOTICE.txt to third party vendors and clean it up a bit automatically
1 parent ce03e68 commit 978b56d

File tree

2 files changed

+33
-226
lines changed

2 files changed

+33
-226
lines changed

NOTICE.txt

Lines changed: 1 addition & 223 deletions
Original file line numberDiff line numberDiff line change
@@ -1,309 +1,87 @@
11
Elastic Documentation Tooling
22
Copyright 2024-2024 Elasticsearch B.V.
33

4+
45
License notice for Errata (v0.13.0)
56
------------------------------------
6-
77
https://github.com/spectreconsole/errata at 2f819fb40220b14f00e4678a5499768f7437c1ee
8-
98
Patrik Svensson, Phil Scott, James Randall
10-
119
Licensed under MIT
12-
1310
Available at https://licenses.nuget.org/MIT
1411

15-
1612
License notice for GitHub.Actions.Core (v8.1.1)
1713
------------------------------------
18-
1914
https://github.com/IEvangelist/dotnet-github-actions-sdk at 57f96243866a8143e0c52dd00776d7a345c15681
20-
2115
Copyright © 2022-2024 David Pine
22-
2316
Licensed under MIT
24-
2517
Available at https://licenses.nuget.org/MIT
2618

27-
28-
License notice for Microsoft.DotNet.ILCompiler (v8.0.8)
29-
------------------------------------
30-
31-
https://github.com/dotnet/runtime at 08338fcaa5c9b9a8190abb99222fed12aaba956c
32-
33-
https://dot.net/
34-
35-
Copyright © Microsoft Corporation. All rights reserved.
36-
37-
Licensed under MIT
38-
39-
Available at https://licenses.nuget.org/MIT
40-
41-
42-
License notice for Microsoft.Extensions.Logging (v8.0.0)
43-
------------------------------------
44-
45-
https://github.com/dotnet/runtime at 5535e31a712343a63f5d7d796cd874e563e5ac14
46-
47-
https://dot.net/
48-
49-
Copyright © Microsoft Corporation. All rights reserved.
50-
51-
Licensed under MIT
52-
53-
Available at https://licenses.nuget.org/MIT
54-
55-
56-
License notice for Microsoft.NET.ILLink.Tasks (v8.0.8)
57-
------------------------------------
58-
59-
https://github.com/dotnet/runtime at 08338fcaa5c9b9a8190abb99222fed12aaba956c
60-
61-
https://dot.net/
62-
63-
Copyright © Microsoft Corporation. All rights reserved.
64-
65-
Licensed under MIT
66-
67-
Available at https://licenses.nuget.org/MIT
68-
69-
7019
License notice for DotNet.Glob (v3.1.3)
7120
------------------------------------
72-
7321
https://github.com/dazinator/DotNet.Glob.git at 6f8a320a9cc6069e80f36bb24f777a21d1c48064
74-
7522
https://github.com/dazinator/DotNet.Glob
76-
7723
License available at https://github.com/dazinator/DotNet.Glob/blob/master/LICENSE
7824

79-
8025
License notice for Markdig (v0.37.0)
8126
------------------------------------
82-
8327
https://github.com/xoofx/markdig at 1a1bbecc467a800dd6b39e68825df50309f6065c
84-
8528
https://github.com/lunet-io/markdig
86-
8729
Alexandre Mutel
88-
8930
Licensed under BSD-2-Clause
90-
9131
Available at https://licenses.nuget.org/BSD-2-Clause
9232

93-
94-
License notice for Microsoft.Extensions.DependencyInjection (v8.0.0)
95-
------------------------------------
96-
97-
https://github.com/dotnet/runtime at 5535e31a712343a63f5d7d796cd874e563e5ac14
98-
99-
https://dot.net/
100-
101-
Copyright © Microsoft Corporation. All rights reserved.
102-
103-
Licensed under MIT
104-
105-
Available at https://licenses.nuget.org/MIT
106-
107-
108-
License notice for Microsoft.Extensions.DependencyInjection.Abstractions (v8.0.1)
109-
------------------------------------
110-
111-
https://github.com/dotnet/runtime at 9f4b1f5d664afdfc80e1508ab7ed099dff210fbd
112-
113-
https://dot.net/
114-
115-
Copyright © Microsoft Corporation. All rights reserved.
116-
117-
Licensed under MIT
118-
119-
Available at https://licenses.nuget.org/MIT
120-
121-
122-
License notice for Microsoft.Extensions.Logging.Abstractions (v8.0.0)
123-
------------------------------------
124-
125-
https://github.com/dotnet/runtime at 5535e31a712343a63f5d7d796cd874e563e5ac14
126-
127-
https://dot.net/
128-
129-
Copyright © Microsoft Corporation. All rights reserved.
130-
131-
Licensed under MIT
132-
133-
Available at https://licenses.nuget.org/MIT
134-
135-
136-
License notice for Microsoft.Extensions.Options (v8.0.0)
137-
------------------------------------
138-
139-
https://github.com/dotnet/runtime at 5535e31a712343a63f5d7d796cd874e563e5ac14
140-
141-
https://dot.net/
142-
143-
Copyright © Microsoft Corporation. All rights reserved.
144-
145-
Licensed under MIT
146-
147-
Available at https://licenses.nuget.org/MIT
148-
149-
150-
License notice for Microsoft.Extensions.Primitives (v8.0.0)
151-
------------------------------------
152-
153-
https://github.com/dotnet/runtime at 5535e31a712343a63f5d7d796cd874e563e5ac14
154-
155-
https://dot.net/
156-
157-
Copyright © Microsoft Corporation. All rights reserved.
158-
159-
Licensed under MIT
160-
161-
Available at https://licenses.nuget.org/MIT
162-
163-
16433
License notice for RazorSlices (v0.8.1)
16534
------------------------------------
166-
16735
https://github.com/DamianEdwards/RazorSlices at 65fde587ac2363d8af45ca551eb845d141aba7d2
168-
16936
Copyright © Damian Edwards
170-
17137
Licensed under MIT
172-
17338
Available at https://licenses.nuget.org/MIT
17439

175-
17640
License notice for Slugify.Core (v4.0.1)
17741
------------------------------------
178-
17942
https://github.com/ctolkien/Slugify at d480e12e3a1451e4b5ca5f070b7fb58db8f48b6c
180-
18143
Licensed under MIT
182-
18344
Available at https://licenses.nuget.org/MIT
18445

185-
18646
License notice for Spectre.Console (v0.47.0)
18747
------------------------------------
188-
18948
https://github.com/spectreconsole/spectre.console at 018f4ebd17b379e6455b3ac071ad144fc648a84a
190-
19149
Patrik Svensson, Phil Scott, Nils Andresen
192-
19350
Licensed under MIT
194-
195-
Available at https://licenses.nuget.org/MIT
196-
197-
198-
License notice for System.IO.Abstractions (v21.0.29)
199-
------------------------------------
200-
201-
https://github.com/TestableIO/System.IO.Abstractions at f4afa40042a9ebea35abee195d5d49a46846523f
202-
203-
Copyright © Tatham Oddie & friends 2010-2024
204-
205-
Licensed under MIT
206-
20751
Available at https://licenses.nuget.org/MIT
20852

209-
210-
License notice for System.Memory (v4.5.5)
211-
------------------------------------
212-
213-
https://dot.net/
214-
215-
Copyright © Microsoft Corporation. All rights reserved.
216-
217-
License available at https://github.com/dotnet/corefx/blob/master/LICENSE.TXT
218-
219-
220-
License notice for System.Runtime.CompilerServices.Unsafe (v6.0.0)
221-
------------------------------------
222-
223-
https://github.com/dotnet/runtime at 4822e3c3aa77eb82b2fb33c9321f923cf11ddde6
224-
225-
https://dot.net/
226-
227-
Copyright © Microsoft Corporation. All rights reserved.
228-
229-
Licensed under MIT
230-
231-
Available at https://licenses.nuget.org/MIT
232-
233-
234-
License notice for System.Text.Encoding.CodePages (v6.0.0)
235-
------------------------------------
236-
237-
https://github.com/dotnet/runtime at 4822e3c3aa77eb82b2fb33c9321f923cf11ddde6
238-
239-
https://dot.net/
240-
241-
Copyright © Microsoft Corporation. All rights reserved.
242-
243-
Licensed under MIT
244-
245-
Available at https://licenses.nuget.org/MIT
246-
247-
24853
License notice for TestableIO.System.IO.Abstractions (v21.0.29)
24954
------------------------------------
250-
25155
https://github.com/TestableIO/System.IO.Abstractions at f4afa40042a9ebea35abee195d5d49a46846523f
252-
25356
Copyright © Tatham Oddie & friends 2010-2024
254-
25557
Licensed under MIT
256-
25758
Available at https://licenses.nuget.org/MIT
25859

259-
26060
License notice for TestableIO.System.IO.Abstractions.Wrappers (v21.0.29)
26161
------------------------------------
262-
26362
https://github.com/TestableIO/System.IO.Abstractions at f4afa40042a9ebea35abee195d5d49a46846523f
264-
26563
Copyright © Tatham Oddie & friends 2010-2024
266-
26764
Licensed under MIT
268-
26965
Available at https://licenses.nuget.org/MIT
27066

271-
27267
License notice for Utf8StreamReader (v1.3.2)
27368
------------------------------------
274-
27569
https://github.com/Cysharp/Utf8StreamReader at 35e2361b7a67e0838b777262c4a7798da50206ca
276-
27770
Copyright © Cysharp, Inc.
278-
27971
Licensed under MIT
280-
28172
Available at https://licenses.nuget.org/MIT
28273

283-
28474
License notice for Vecc.YamlDotNet.Analyzers.StaticGenerator (v16.1.3)
28575
------------------------------------
286-
28776
https://github.com/aaubry/YamlDotNet.git
288-
28977
https://github.com/aaubry/YamlDotNet/wiki
290-
29178
Available at https://aka.ms/deprecateLicenseUrl
292-
29379
LICENSE.txt
29480

295-
29681
License notice for YamlDotNet (v16.1.3)
29782
------------------------------------
298-
29983
https://github.com/aaubry/YamlDotNet at 7923dd8e600f7fea7710f3b45f3fadcfa1aa589c
300-
30184
https://github.com/aaubry/YamlDotNet/wiki
302-
30385
Copyright (c) Antoine Aubry and contributors
304-
30586
Licensed under MIT
306-
30787
Available at https://licenses.nuget.org/MIT
308-
309-

build/Program.cs

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,43 @@ Copyright 2024-{DateTime.UtcNow.Year} Elasticsearch B.V.
2222
""", ctx);
2323
await "dotnet thirdlicense --project src/docs-builder/docs-builder.csproj --output .artifacts/NOTICE_temp.txt";
2424
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+
2554
try
2655
{
27-
await "git diff-index --quiet HEAD --";
56+
await "git status --porcelain";
2857
}
29-
catch
58+
catch (Exception ex)
3059
{
60+
Console.WriteLine(ex.ToString());
3161
Console.WriteLine("The build left unchecked artifacts in the source folder");
32-
await "git status --porcelain";
3362
await "git diff NOTICE.txt";
3463
return 1;
3564
}

0 commit comments

Comments
 (0)