Skip to content

Commit 0c29aa4

Browse files
committed
Do not emit CS1607 warnings for test builds
1 parent 37508bf commit 0c29aa4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/NerdBank.GitVersioning.Tests/BuildIntegrationTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,6 +1058,8 @@ private void MakeItAVBProject()
10581058
{
10591059
var csharpImport = this.testProject.Imports.Single(i => i.Project.Contains("CSharp"));
10601060
csharpImport.Project = @"$(MSBuildToolsPath)\Microsoft.VisualBasic.targets";
1061+
var isVbProperty = this.testProject.Properties.Single(p => p.Name == "IsVB");
1062+
isVbProperty.Value = "true";
10611063
}
10621064

10631065
private struct RestoreEnvironmentVariables : IDisposable

src/NerdBank.GitVersioning.Tests/test.prj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4+
<IsVB>false</IsVB>
45
<RootNamespace>TestNamespace</RootNamespace>
56
<AssemblyName>TestAssembly</AssemblyName>
67
<AssemblyTitle>TestAssembly</AssemblyTitle>
@@ -11,6 +12,8 @@
1112
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1213
<OutputType>Library</OutputType>
1314
<OutputPath>bin\</OutputPath>
15+
<NoWarn Condition=" '$(IsVB)' == 'false' ">$(NoWarn);1607</NoWarn>
16+
<NoWarn Condition=" '$(IsVB)' == 'true' ">$(NoWarn);40010</NoWarn>
1417
</PropertyGroup>
1518
<ItemGroup>
1619
<Reference Include="System" />

0 commit comments

Comments
 (0)