Skip to content

Commit a5f216a

Browse files
committed
Added some extra continue statements when there is no reference to the new assembly.
1 parent 5e502ed commit a5f216a

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

CompatibilityChecker/Analyzer.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,11 @@ public void Run()
159159
Mapping<FieldDefinitionHandle> fieldMapping = _referenceToNewMapping.MapFieldDefinition(fieldDefinitionHandle);
160160
if (fieldMapping.Target.IsNil)
161161
{
162-
if (fieldMapping.CandidateTargets.IsDefaultOrEmpty)
162+
if (fieldMapping.CandidateTargets.IsDefaultOrEmpty)
163163
_reporter.Report(FieldMustNotBeChanged.CreateMessage(GetMetadataName(referenceMetadata, fieldDefinition))); //throw new NotImplementedException(string.Format("Publicly-visible field '{0}' was renamed or removed.", GetMetadataName(referenceMetadata, fieldDefinition)));
164164

165165
//throw new NotImplementedException();
166+
continue; // TODO test
166167
}
167168

168169
FieldDefinition newFieldDefinition = newMetadata.GetFieldDefinition(fieldMapping.Target);
@@ -288,7 +289,10 @@ public void Run()
288289

289290
Mapping<EventDefinitionHandle> eventDefinitionMapping = _referenceToNewMapping.MapEventDefinition(eventDefinitionHandle);
290291
if (eventDefinitionMapping.Target.IsNil)
292+
{
291293
_reporter.Report(EventMustNotBeRemoved.CreateMessage(GetMetadataName(referenceMetadata, eventDefinition, typeDefinition))); //throw new NotImplementedException(string.Format("Publicly-visible event '{0}' was renamed or removed.", GetMetadataName(referenceMetadata, eventDefinition, typeDefinition)));
294+
continue; // TODO test
295+
}
292296

293297
EventDefinition newEventDefinition = newMetadata.GetEventDefinition(eventDefinitionMapping.Target);
294298
if (eventDefinition.Attributes != newEventDefinition.Attributes)
@@ -389,7 +393,10 @@ public void Run()
389393
}
390394

391395
if (newPropertyDefinitionHandle.IsNil)
396+
{
392397
_reporter.Report(PropertyMustNotBeChanged.CreateMessage(GetMetadataName(referenceMetadata, propertyDefinition, typeDefinition))); //throw new NotImplementedException(string.Format("Publicly-visible property '{0}' was renamed or removed.", GetMetadataName(referenceMetadata, propertyDefinition, typeDefinition)));
398+
continue; // TODO test
399+
}
393400

394401
PropertyDefinition newPropertyDefinition = newMetadata.GetPropertyDefinition(newPropertyDefinitionHandle);
395402
if (propertyDefinition.Attributes != newPropertyDefinition.Attributes)

CompatibilityCheckerCLI/CompatibilityCheckerCLI.csproj

-4
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@
3535
<ItemGroup>
3636
<Reference Include="System" />
3737
<Reference Include="System.Core" />
38-
<Reference Include="System.Xml.Linq" />
39-
<Reference Include="System.Data.DataSetExtensions" />
4038
<Reference Include="Microsoft.CSharp" />
4139
<Reference Include="System.Data" />
42-
<Reference Include="System.Net.Http" />
43-
<Reference Include="System.Xml" />
4440
</ItemGroup>
4541
<ItemGroup>
4642
<Compile Include="Program.cs" />

CompatibilityCheckerCoreCLI/CompatibilityCheckerCoreCLI.csproj

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp2.2</TargetFramework>
6+
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
7+
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
8+
<ApplicationIcon />
9+
<StartupObject />
10+
<LangVersion>latest</LangVersion>
11+
</PropertyGroup>
12+
13+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
14+
<DebugType>portable</DebugType>
15+
<DebugSymbols>true</DebugSymbols>
616
</PropertyGroup>
717

818
<ItemGroup>

CompatibilityCheckerCoreCLI/Program.cs

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ private static void Main(string[] args)
5656
Console.Error.WriteLine("Reference file '{0}' not found or inaccessible.", referenceFile.FullName);
5757
if (!newFile.Exists)
5858
Console.Error.WriteLine("New file '{0}' not found or inaccessible.", newFile.FullName);
59+
Environment.ExitCode = 2;
5960
}
6061
}
6162
#if DEBUG

0 commit comments

Comments
 (0)