Skip to content

Commit daa0b52

Browse files
authored
Updated ids-tool (#140)
This version performs a more thorough audit of the repository. We are checking Development for schema and content We are checking Documentation\testcases for schema.
1 parent 4583ade commit daa0b52

File tree

4 files changed

+35
-18
lines changed

4 files changed

+35
-18
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ build/obj/
55
.tmp/
66
/build/.vs/
77
/.nuke/temp/
8+
/.vs/

.nuke/build.schema.json

+4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
"items": {
7373
"type": "string",
7474
"enum": [
75+
"AuditDevelopment",
76+
"AuditDocTestCases",
7577
"CheckTestCases"
7678
]
7779
}
@@ -82,6 +84,8 @@
8284
"items": {
8385
"type": "string",
8486
"enum": [
87+
"AuditDevelopment",
88+
"AuditDocTestCases",
8589
"CheckTestCases"
8690
]
8791
}

build/Build.cs

+29-17
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Nuke.Common;
22
using Nuke.Common.Tooling;
3+
using System;
34
using System.IO;
45

56
class Build : NukeBuild
@@ -21,31 +22,42 @@ class Build : NukeBuild
2122
private string IdsToolPath => System.IO.Path.GetDirectoryName(ToolPathResolver.GetPackageExecutable("ids-tool.CommandLine", "tools/net6.0/ids-tool.dll"));
2223

2324
/// <summary>
24-
/// Checks the validity of IDS files in the repository, using ids-tool.
25+
/// Checks the validity of development folder in the repository, using ids-tool.
2526
/// The tool is deployed by the annotated <see cref="IdsTool"/>.
2627
/// </summary>
27-
Target CheckTestCases => _ => _
28+
Target AuditDevelopment => _ => _
29+
.AssuredAfterFailure()
2830
.Executes(() =>
2931
{
3032
// development samples
31-
var schemaFile = Path.Combine(
32-
RootDirectory,
33-
"Development/ids.xsd"
34-
);
35-
var inputFolder = Path.Combine(
36-
RootDirectory,
37-
"Development"
38-
);
39-
var arguments = $"check \"{inputFolder}\" -x \"{schemaFile}\"";
33+
var schemaFile = RootDirectory / "Development" / "ids.xsd";
34+
var inputFolder = RootDirectory / "Development";
35+
var arguments = $"audit \"{inputFolder}\" -x \"{schemaFile}\"";
4036
IdsTool(arguments, workingDirectory: IdsToolPath);
37+
});
4138

42-
// test cases
43-
inputFolder = Path.Combine(
44-
RootDirectory,
45-
"Documentation/testcases"
46-
);
47-
arguments = $"check \"{inputFolder}\" -x \"{schemaFile}\"";
39+
Target AuditDocTestCases => _ => _
40+
.AssuredAfterFailure()
41+
.Executes(() =>
42+
{
43+
// we are omitting tests on the content of the Documentation/testcases folder,
44+
// because they include IDSs that intentionally contain errors
45+
//
46+
var schemaFile = RootDirectory / "Development" / "ids.xsd";
47+
var inputFolder = RootDirectory / "Documentation" / "testcases";
48+
var arguments = $"audit \"{inputFolder}\" --omitContent -x \"{schemaFile}\"";
4849
IdsTool(arguments, workingDirectory: IdsToolPath);
50+
});
4951

52+
/// <summary>
53+
/// Perform all tests via DependsOn, this is the one invoked by default
54+
/// </summary>
55+
Target CheckTestCases => _ => _
56+
.AssuredAfterFailure()
57+
.DependsOn(AuditDocTestCases)
58+
.DependsOn(AuditDevelopment)
59+
.Executes(() =>
60+
{
61+
Console.WriteLine("Empty target, to launch all available checking targets.");
5062
});
5163
}

build/_build.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="ids-tool.CommandLine" Version="1.0.9" />
14+
<PackageReference Include="ids-tool.CommandLine" Version="1.0.11" />
1515
<PackageReference Include="Nuke.Common" Version="6.2.1" />
1616
</ItemGroup>
1717

0 commit comments

Comments
 (0)