Skip to content

Commit 254c2ee

Browse files
committed
Fixing fetching of PostSharp build artifacts.
1 parent e269fea commit 254c2ee

File tree

1 file changed

+4
-3
lines changed
  • src/PostSharp.Engineering.BuildTools/Dependencies/Model

1 file changed

+4
-3
lines changed

src/PostSharp.Engineering.BuildTools/Dependencies/Model/CiBuildId.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,22 @@ namespace PostSharp.Engineering.BuildTools.Dependencies.Model;
99
public record CiBuildId( int BuildNumber, string? BuildTypeId ) : ICiBuildSpec
1010
{
1111
// This is a hack to guess the build configuration from the BuildTypeId because this information is not available
12-
// when we restore artifacts.
12+
// when we restore artifacts. It is only useful for Metalama.Compiler, all other products do not take the BuildConfiguration
13+
// into account.
1314
public BuildConfiguration BuildConfiguration
1415
{
1516
get
1617
{
1718
if ( this.BuildTypeId == null )
1819
{
19-
throw new InvalidOperationException( "BuildTypeId is null." );
20+
return default;
2021
}
2122

2223
var match = Regex.Match( this.BuildTypeId, "_([A-Z][a-z]+)Build$" );
2324

2425
if ( !match.Success )
2526
{
26-
throw new InvalidOperationException( $"BuildTypeId '{this.BuildTypeId}' cannot be parsed." );
27+
return default;
2728
}
2829

2930
return Enum.Parse<BuildConfiguration>( match.Groups[1].Value );

0 commit comments

Comments
 (0)