@@ -20,6 +20,10 @@ internal class BaselineHelper
20
20
private const string SemanticVersionPlaceholderMatchingPattern = "*.*.*" ; // wildcard pattern used to match on the version represented by the placeholder
21
21
private const string NonSemanticVersionPlaceholder = "x.y" ;
22
22
private const string NonSemanticVersionPlaceholderMatchingPattern = "*.*" ; // wildcard pattern used to match on the version represented by the placeholder
23
+ private const string TargetRidPlaceholder = "banana-rid" ;
24
+ private const string TargetRidPlaceholderMatchingPattern = "*-*" ; // wildcard pattern used to match on the rid represented by the placeholder
25
+ private const string PortableRidPlaceholder = "portable-rid" ;
26
+ private const string PortableRidPlaceholderMatchingPattern = "*-*" ; // wildcard pattern used to match on the rid represented by the placeholder
23
27
24
28
public static void CompareEntries ( string baselineFileName , IOrderedEnumerable < string > actualEntries )
25
29
{
@@ -91,7 +95,7 @@ public static string GetBaselineFilePath(string baselineFileName, string baselin
91
95
Path . Combine ( GetAssetsDirectory ( ) , baselineSubDir , baselineFileName ) ;
92
96
93
97
public static string RemoveRids ( string diff , bool isPortable = false ) =>
94
- isPortable ? diff . Replace ( Config . PortableRid , "portable-rid" ) : diff . Replace ( Config . TargetRid , "banana-rid" ) ;
98
+ isPortable ? diff . Replace ( Config . PortableRid , PortableRidPlaceholder ) : diff . Replace ( Config . TargetRid , TargetRidPlaceholder ) ;
95
99
96
100
public static string RemoveVersions ( string source )
97
101
{
@@ -119,14 +123,16 @@ public static string RemoveVersions(string source)
119
123
}
120
124
121
125
/// <summary>
122
- /// This returns a <see cref="Matcher"/> that can be used to match on a path whose versions have been removed via
123
- /// <see cref="RemoveVersions(string)"/>.
126
+ /// This returns a <see cref="Matcher"/> that can be used to match on a path whose versions and RID have been removed via
127
+ /// <see cref="RemoveVersions(string)"/> and <see cref="RemoveRids(string, bool)"/>
124
128
/// </summary>
125
129
public static Matcher GetFileMatcherFromPath ( string path )
126
130
{
127
131
path = path
128
132
. Replace ( SemanticVersionPlaceholder , SemanticVersionPlaceholderMatchingPattern )
129
- . Replace ( NonSemanticVersionPlaceholder , NonSemanticVersionPlaceholderMatchingPattern ) ;
133
+ . Replace ( NonSemanticVersionPlaceholder , NonSemanticVersionPlaceholderMatchingPattern )
134
+ . Replace ( TargetRidPlaceholder , TargetRidPlaceholderMatchingPattern )
135
+ . Replace ( PortableRidPlaceholder , PortableRidPlaceholderMatchingPattern ) ;
130
136
Matcher matcher = new ( ) ;
131
137
matcher . AddInclude ( path ) ;
132
138
return matcher ;
0 commit comments