1
1
using Nuke . Common ;
2
2
using Nuke . Common . Tooling ;
3
+ using System ;
3
4
using System . IO ;
4
5
5
6
class Build : NukeBuild
@@ -21,31 +22,42 @@ class Build : NukeBuild
21
22
private string IdsToolPath => System . IO . Path . GetDirectoryName ( ToolPathResolver . GetPackageExecutable ( "ids-tool.CommandLine" , "tools/net6.0/ids-tool.dll" ) ) ;
22
23
23
24
/// <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.
25
26
/// The tool is deployed by the annotated <see cref="IdsTool"/>.
26
27
/// </summary>
27
- Target CheckTestCases => _ => _
28
+ Target AuditDevelopment => _ => _
29
+ . AssuredAfterFailure ( )
28
30
. Executes ( ( ) =>
29
31
{
30
32
// 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 } \" ";
40
36
IdsTool ( arguments , workingDirectory : IdsToolPath ) ;
37
+ } ) ;
41
38
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 } \" ";
48
49
IdsTool ( arguments , workingDirectory : IdsToolPath ) ;
50
+ } ) ;
49
51
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." ) ;
50
62
} ) ;
51
63
}
0 commit comments