Skip to content

Commit

Permalink
fix: Fixed default search of the directories with tests for Hx_Extent…
Browse files Browse the repository at this point in the history
…Report and improved documentation for Hx_FileSystemSearch.
  • Loading branch information
hennadiilu committed Apr 2, 2024
1 parent 08582d3 commit d3ca63e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Heleonix.Build/Schemas/Tasks/Hx_FileSystemSearch.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ Example custom task with single required parameter
<xs:annotation>
<xs:documentation>
The .NET regular expression to include found paths. Use only '/' for path separators.
If 'Direction' is 'Down', then this regular expression is evaluated against the path starting from
the 'StartDir.
I.e. if 'StartDir' is 'D:/Dev/Repo' and the checked folder is 'D:/Dev/Repo/sub/folder',
then the regular expression is executed against '/sub/folder', so the 'StartDir' is trimmed.
</xs:documentation>
</xs:annotation>
</xs:attribute>
Expand Down
2 changes: 1 addition & 1 deletion src/Heleonix.Build/Targets/Hx_ExtentReport.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Condition="'$(Hx_ExtentReport_TestResultsDir)' == ''"
StartDir="$(Hx_Run_ArtifactsDir)"
Types="Directories"
PathRegExp="^.*/.*Test$">
PathRegExp="^/[^/]*Test$">
<Output TaskParameter="FoundDirs" PropertyName="Hx_ExtentReport_TestResultsDir"/>
</Hx_FileSystemSearch>
<PropertyGroup>
Expand Down
4 changes: 4 additions & 0 deletions src/Heleonix.Build/Tasks/Hx_FileSystemSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ protected override void ExecuteInternal()
return;
}

// Replace D:\Dev\Repo/Hx_Artifacts with D:\Dev\Repo\Hx_Artifacts i.e. on Windows.
// ^ ^
this.StartDir = this.StartDir.Replace('/', Path.DirectorySeparatorChar);

var pathRegExpOptions = (RegexOptions)Enum.Parse(typeof(RegexOptions), this.PathRegExpOptions);
var pathRegExp = string.IsNullOrEmpty(this.PathRegExp)
? null
Expand Down

0 comments on commit d3ca63e

Please sign in to comment.