File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
GitVersionCore/VersionConverters/AssemblyInfo
GitVersionCore.Tests/VersionConverters Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,25 @@ public void CanUpdateProjectFileWithStandardProjectFileXml(string xml)
52
52
canUpdate . ShouldBe ( true ) ;
53
53
}
54
54
55
+ [ TestCase ( @"
56
+ <Project Sdk=""Microsoft.NET.Sdk.Web"">
57
+ <PropertyGroup>
58
+ <OutputType>Exe</OutputType>
59
+ <TargetFramework>netcoreapp3.1</TargetFramework>
60
+ </PropertyGroup>
61
+ </Project>
62
+ " ) ]
63
+ [ Category ( NoMono ) ]
64
+ [ Description ( NoMonoDescription ) ]
65
+ public void CanUpdateProjectFileWithStandardWebProjectFileXml ( string xml )
66
+ {
67
+ using var projectFileUpdater = new ProjectFileUpdater ( log , fileSystem ) ;
68
+
69
+ var canUpdate = projectFileUpdater . CanUpdateProjectFile ( XElement . Parse ( xml ) ) ;
70
+
71
+ canUpdate . ShouldBe ( true ) ;
72
+ }
73
+
55
74
[ TestCase ( @"
56
75
<Project Sdk=""SomeOtherProject.Sdk"">
57
76
<PropertyGroup>
Original file line number Diff line number Diff line change @@ -102,11 +102,12 @@ internal bool CanUpdateProjectFile(XElement xmlRoot)
102
102
return false ;
103
103
}
104
104
105
- var supportedSdk = "Microsoft.NET.Sdk" ;
105
+ var supportedSdks = new [ ] { "Microsoft.NET.Sdk" , "Microsoft.NET.Sdk.Web" } ;
106
106
var sdkAttribute = xmlRoot . Attribute ( "Sdk" ) ;
107
- if ( sdkAttribute == null || sdkAttribute . Value != supportedSdk )
107
+ if ( sdkAttribute == null || ! supportedSdks . Contains ( sdkAttribute . Value ) )
108
108
{
109
- log . Warning ( $ "Specified project file Sdk ({ sdkAttribute ? . Value } ) is not supported, please ensure the project sdk is { supportedSdk } .") ;
109
+ var supportedSdkString = string . Join ( "|" , supportedSdks ) ;
110
+ log . Warning ( $ "Specified project file Sdk ({ sdkAttribute ? . Value } ) is not supported, please ensure the project sdk is of the following: { supportedSdkString } .") ;
110
111
return false ;
111
112
}
112
113
You can’t perform that action at this time.
0 commit comments