File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 37
37
</PropertyGroup >
38
38
39
39
<ItemGroup >
40
+ <PackageReference Include =" Cake.Common" Version =" 1.0.0" />
40
41
<PackageReference Include =" Cake.Core" Version =" 1.0.0" PrivateAssets =" All" />
41
42
<PackageReference Include =" Microsoft.CodeAnalysis.NetAnalyzers" Version =" 5.0.3" >
42
43
<PrivateAssets >all</PrivateAssets >
Original file line number Diff line number Diff line change 1
1
namespace Cake . AzureDevOps . Pipelines
2
2
{
3
+ using System ;
4
+ using Cake . Common . Build . AzurePipelines . Data ;
3
5
using Microsoft . TeamFoundation . Build . WebApi ;
4
6
5
7
/// <summary>
@@ -16,12 +18,17 @@ public static AzureDevOpsArtifactResource ToAzureDevOpsArtifactResource(this Art
16
18
{
17
19
artifactResource . NotNull ( nameof ( artifactResource ) ) ;
18
20
21
+ if ( ! Enum . TryParse ( artifactResource . Type , out AzurePipelinesArtifactType type ) )
22
+ {
23
+ throw new Exception ( $ "Unexpected value for artifact type '{ artifactResource . Type } '") ;
24
+ }
25
+
19
26
return
20
27
new AzureDevOpsArtifactResource
21
28
{
22
29
Data = artifactResource . Data ,
23
30
DownloadUrl = artifactResource . DownloadUrl ,
24
- Type = artifactResource . Type ,
31
+ Type = type ,
25
32
Url = artifactResource . Url ,
26
33
Properties = artifactResource . Properties ,
27
34
} ;
Original file line number Diff line number Diff line change 1
1
namespace Cake . AzureDevOps . Pipelines
2
2
{
3
3
using System . Collections . Generic ;
4
+ using Cake . Common . Build . AzurePipelines . Data ;
4
5
5
6
/// <summary>
6
7
/// Represents a resource associated with a <see cref="AzureDevOpsBuildArtifact" />.
@@ -20,7 +21,7 @@ public class AzureDevOpsArtifactResource
20
21
/// <summary>
21
22
/// Gets the type of the resource.
22
23
/// </summary>
23
- public string Type { get ; internal set ; }
24
+ public AzurePipelinesArtifactType Type { get ; internal set ; }
24
25
25
26
/// <summary>
26
27
/// Gets the full http link to the resource.
You can’t perform that action at this time.
0 commit comments