From 079f997068b68e4eed38ea9b1932f9e57d4024c8 Mon Sep 17 00:00:00 2001 From: Jay Cho Date: Fri, 31 Aug 2018 16:24:40 +0900 Subject: [PATCH] [ABIChecker] Add feature to check internal api changes (#424) * [ABIChecker] Add feature to check internal api changes * Add new fature that checks changed module * Remove repeated code * Rename the file - Remame the file name from ABITester.cs to ABIChecker.cs - Fix typo * Remove unused files and code blocks * Apply Review comments - Fix property name - Remove unnessassary try-catch statement --- tools/bin/ABIChecker/ABIChecker.deps.json | 87 +++------- tools/bin/ABIChecker/ABIChecker.dll | Bin 13312 -> 13312 bytes tools/bin/ABIChecker/ABIChecker.pdb | Bin 3460 -> 4000 bytes .../System.Composition.AttributedModel.dll | Bin .../ABIChecker/System.Composition.Convention.dll | Bin .../bin/ABIChecker/System.Composition.Hosting.dll | Bin .../bin/ABIChecker/System.Composition.Runtime.dll | Bin .../ABIChecker/System.Composition.TypedParts.dll | Bin tools/src/ABIChecker/ABIChecker.cs | 149 +++++++++++++++++ tools/src/ABIChecker/ABITester.cs | 78 --------- tools/src/ABIChecker/AssemblyChecker.cs | 99 +++++++++++ tools/src/ABIChecker/Checker/AssemblyChecker.cs | 129 --------------- tools/src/ABIChecker/Checker_ABI.sln | 25 --- tools/src/ABIChecker/Program.cs | 31 +--- .../src/ABIChecker/Properties/launchSettings.json | 8 - tools/src/ABIChecker/Utilities/ObjectUtil.cs | 181 --------------------- .../ABIChecker/Utilities/ReflectionExtension.cs | 23 --- 17 files changed, 272 insertions(+), 538 deletions(-) mode change 100644 => 100755 tools/bin/ABIChecker/System.Composition.AttributedModel.dll mode change 100644 => 100755 tools/bin/ABIChecker/System.Composition.Convention.dll mode change 100644 => 100755 tools/bin/ABIChecker/System.Composition.Hosting.dll mode change 100644 => 100755 tools/bin/ABIChecker/System.Composition.Runtime.dll mode change 100644 => 100755 tools/bin/ABIChecker/System.Composition.TypedParts.dll create mode 100644 tools/src/ABIChecker/ABIChecker.cs delete mode 100644 tools/src/ABIChecker/ABITester.cs create mode 100644 tools/src/ABIChecker/AssemblyChecker.cs delete mode 100644 tools/src/ABIChecker/Checker/AssemblyChecker.cs delete mode 100644 tools/src/ABIChecker/Checker_ABI.sln delete mode 100644 tools/src/ABIChecker/Properties/launchSettings.json delete mode 100644 tools/src/ABIChecker/Utilities/ObjectUtil.cs delete mode 100644 tools/src/ABIChecker/Utilities/ReflectionExtension.cs diff --git a/tools/bin/ABIChecker/ABIChecker.deps.json b/tools/bin/ABIChecker/ABIChecker.deps.json index 7ac35e1..7778382 100644 --- a/tools/bin/ABIChecker/ABIChecker.deps.json +++ b/tools/bin/ABIChecker/ABIChecker.deps.json @@ -34,10 +34,7 @@ "System.Runtime.Extensions": "4.3.0" }, "runtime": { - "lib/netstandard1.5/CommandLine.dll": { - "assemblyVersion": "2.0.275.0", - "fileVersion": "2.0.275.0" - } + "lib/netstandard1.5/CommandLine.dll": {} } }, "Microsoft.CodeAnalysis/2.6.1": { @@ -90,10 +87,7 @@ "System.Xml.XmlDocument": "4.3.0" }, "runtime": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.dll": { - "assemblyVersion": "2.6.0.0", - "fileVersion": "2.6.1.62414" - } + "lib/netstandard1.3/Microsoft.CodeAnalysis.dll": {} } }, "Microsoft.CodeAnalysis.CSharp/2.6.1": { @@ -101,10 +95,7 @@ "Microsoft.CodeAnalysis.Common": "2.6.1" }, "runtime": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.CSharp.dll": { - "assemblyVersion": "2.6.0.0", - "fileVersion": "2.6.1.62414" - } + "lib/netstandard1.3/Microsoft.CodeAnalysis.CSharp.dll": {} } }, "Microsoft.CodeAnalysis.CSharp.Workspaces/2.6.1": { @@ -113,10 +104,7 @@ "Microsoft.CodeAnalysis.Workspaces.Common": "2.6.1" }, "runtime": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.CSharp.Workspaces.dll": { - "assemblyVersion": "2.6.0.0", - "fileVersion": "2.6.1.62414" - } + "lib/netstandard1.3/Microsoft.CodeAnalysis.CSharp.Workspaces.dll": {} } }, "Microsoft.CodeAnalysis.VisualBasic/2.6.1": { @@ -124,10 +112,7 @@ "Microsoft.CodeAnalysis.Common": "2.6.1" }, "runtime": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.VisualBasic.dll": { - "assemblyVersion": "2.6.0.0", - "fileVersion": "2.6.1.62414" - } + "lib/netstandard1.3/Microsoft.CodeAnalysis.VisualBasic.dll": {} } }, "Microsoft.CodeAnalysis.VisualBasic.Workspaces/2.6.1": { @@ -136,10 +121,7 @@ "Microsoft.CodeAnalysis.Workspaces.Common": "2.6.1" }, "runtime": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll": { - "assemblyVersion": "2.6.0.0", - "fileVersion": "2.6.1.62414" - } + "lib/netstandard1.3/Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll": {} } }, "Microsoft.CodeAnalysis.Workspaces.Common/2.6.1": { @@ -153,10 +135,7 @@ "System.Threading.Tasks.Parallel": "4.3.0" }, "runtime": { - "lib/netstandard1.3/Microsoft.CodeAnalysis.Workspaces.dll": { - "assemblyVersion": "2.6.0.0", - "fileVersion": "2.6.1.62414" - } + "lib/netstandard1.3/Microsoft.CodeAnalysis.Workspaces.dll": {} } }, "Microsoft.CSharp/4.0.1": { @@ -191,10 +170,7 @@ "System.Runtime.InteropServices.RuntimeInformation": "4.0.0" }, "runtime": { - "lib/netstandard1.3/Microsoft.DotNet.PlatformAbstractions.dll": { - "assemblyVersion": "2.0.4.0", - "fileVersion": "2.0.4.0" - } + "lib/netstandard1.3/Microsoft.DotNet.PlatformAbstractions.dll": {} } }, "Microsoft.Extensions.DependencyModel/2.0.4": { @@ -206,10 +182,7 @@ "System.Linq": "4.3.0" }, "runtime": { - "lib/netstandard1.6/Microsoft.Extensions.DependencyModel.dll": { - "assemblyVersion": "2.0.4.0", - "fileVersion": "2.0.4.0" - } + "lib/netstandard1.6/Microsoft.Extensions.DependencyModel.dll": {} } }, "Microsoft.NETCore.Targets/1.1.0": {}, @@ -239,10 +212,7 @@ "System.Xml.XDocument": "4.3.0" }, "runtime": { - "lib/netstandard1.0/Newtonsoft.Json.dll": { - "assemblyVersion": "9.0.0.0", - "fileVersion": "9.0.1.19813" - } + "lib/netstandard1.0/Newtonsoft.Json.dll": {} } }, "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { @@ -428,10 +398,7 @@ "System.Runtime": "4.3.0" }, "runtime": { - "lib/netstandard1.0/System.Composition.AttributedModel.dll": { - "assemblyVersion": "1.0.31.0", - "fileVersion": "4.6.24705.1" - } + "lib/netstandard1.0/System.Composition.AttributedModel.dll": {} } }, "System.Composition.Convention/1.0.31": { @@ -450,10 +417,7 @@ "System.Threading": "4.3.0" }, "runtime": { - "lib/netstandard1.0/System.Composition.Convention.dll": { - "assemblyVersion": "1.0.31.0", - "fileVersion": "4.6.24705.1" - } + "lib/netstandard1.0/System.Composition.Convention.dll": {} } }, "System.Composition.Hosting/1.0.31": { @@ -473,10 +437,7 @@ "System.Threading": "4.3.0" }, "runtime": { - "lib/netstandard1.0/System.Composition.Hosting.dll": { - "assemblyVersion": "1.0.31.0", - "fileVersion": "4.6.24705.1" - } + "lib/netstandard1.0/System.Composition.Hosting.dll": {} } }, "System.Composition.Runtime/1.0.31": { @@ -491,10 +452,7 @@ "System.Runtime": "4.3.0" }, "runtime": { - "lib/netstandard1.0/System.Composition.Runtime.dll": { - "assemblyVersion": "1.0.31.0", - "fileVersion": "4.6.24705.1" - } + "lib/netstandard1.0/System.Composition.Runtime.dll": {} } }, "System.Composition.TypedParts/1.0.31": { @@ -515,10 +473,7 @@ "System.Runtime.Extensions": "4.3.0" }, "runtime": { - "lib/netstandard1.0/System.Composition.TypedParts.dll": { - "assemblyVersion": "1.0.31.0", - "fileVersion": "4.6.24705.1" - } + "lib/netstandard1.0/System.Composition.TypedParts.dll": {} } }, "System.Console/4.3.0": { @@ -1065,15 +1020,11 @@ "runtimeTargets": { "runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": { "rid": "unix", - "assetType": "runtime", - "assemblyVersion": "4.0.2.0", - "fileVersion": "4.6.24705.1" + "assetType": "runtime" }, "runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": { "rid": "win", - "assetType": "runtime", - "assemblyVersion": "4.0.2.0", - "fileVersion": "4.6.24705.1" + "assetType": "runtime" } } }, @@ -1281,7 +1232,7 @@ "Microsoft.CSharp/4.0.1": { "type": "package", "serviceable": true, - "sha512": "sha512-bM7IkLhJmBFtocrseXxf1cywbbkf49VkjPUhTKhDt8rhJ2b3Umd1N1FZCcfZowKQgithC1SZa3ldWjzN0O49aw==", + "sha512": "sha512-17h8b5mXa87XYKrrVqdgZ38JefSUqLChUQpXgSnpzsM0nDOhE40FTeNWOJ/YmySGV6tG6T8+hjz6vxbknHJr6A==", "path": "microsoft.csharp/4.0.1", "hashPath": "microsoft.csharp.4.0.1.nupkg.sha512" }, @@ -1309,7 +1260,7 @@ "Newtonsoft.Json/9.0.1": { "type": "package", "serviceable": true, - "sha512": "sha512-EZsVUqtnBHEhlJE22IjA3BU3JENwdgjwI5k/hBj7fn4pY4wRs8AU0F4m+NeEfcysrRiDXGj50SLlQTZxiqK+7g==", + "sha512": "sha512-U82mHQSKaIk+lpSVCbWYKNavmNH1i5xrExDEquU1i6I5pV6UMOqRnJRSlKO3cMPfcpp0RgDY+8jUXHdQ4IfXvw==", "path": "newtonsoft.json/9.0.1", "hashPath": "newtonsoft.json.9.0.1.nupkg.sha512" }, diff --git a/tools/bin/ABIChecker/ABIChecker.dll b/tools/bin/ABIChecker/ABIChecker.dll index 5cdf58de3ce2048586cff40fe049dca898b323bc..bd61eee411d0ce037a12cf293dc8ae84329b2cc9 100644 GIT binary patch literal 13312 zcmeHNdvILkbwBs9_ugGeYu#OYwHVv1WgBF#ypn7nwy`bCdccAovL$043G!-nB`x0F zE8lz9SU3hTgoJ5H3Y|%lGD(KgCM4-FA=6~Wp^!pTnxut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|BjckF>HZ>_nH;XzSSGQj&kZ6K@$N`I@@o^51T~nfpeQ_#Z zm@Vr30HgayAH9GlHOLl7DcEl)d8sSuo|@*%O2<&*^Zoae7#U?hox;6wH*Wc*z-?!D zg&MR&ap#BpLpu;KKp~=JDxiC&(|+~;on$C&y1BbdTzJ@ z=ljW?!+5ms88>e*^268k51@+6|YJ*YjDwXN<1>AO61eD?j_Ey6KOT7n0sR(_gu@ln4&i)YLyvog$Gc{%V@tBEAeI_OYZ_EXo^kvW ziL2wm;Ck39U{euXe2ko4K$H7btQY4D_qQGkAISq}lN!kKGeb_Eu<|&P??qpH?BvTm z6b_b;?|fwDYnznwE#3)k2PYoxzfe9gG2a`>_acjmvYm$@Z$pE7(qg$joE>}1H}`i5 z_}Mc>$;*!;*(ysH>Zkm41bs;1klzE@X(`DgE?}%|@iazP1don;SoX8eqq8@;AAg+w zL(szGs_xJA>nQYCIOWa4H^nMz7nVo&7&Eqg%<^ivi@j6v4f3V*V?TW7U~K$Q<33cq zu?+i_sF)%8Y1L$W>CwO5vi)=}tDkh=W^Qf6p3Y{bgEotw`T8E0fv$bv3&Tn?`J_iZ5D`#eG%dw6XyE0a8bK1#upX_VX z@n+gQhG%zwJCyxFnXZ?WrKa%6kLT%mHu0v{rswgJc5BpEYnj;o>v={z&b zuL1WMCylJ0Ww^C1?YJ-2>^6PY?9bpm6x?_$oplUvP*O?H0@nDZ_sp|>OHbJeVA#^* fM`#<*vfuM-hx>m}Yvlhw{hr(U|K|O#d*HtTKERzi diff --git a/tools/bin/ABIChecker/ABIChecker.pdb b/tools/bin/ABIChecker/ABIChecker.pdb index 7d03610549430a483bc44a40034ba041d105169a..7ef5a2eaa8848569ce4d8966dbe76963ccd60e55 100644 GIT binary patch literal 4000 zcmZ`+Yiv}<6+Sb2efRGAZHzG{wl~-Y<6vW+NeUr;@i69L{0Nj{JL~ney?DKgch}Gb z+TQE6O&@6mKR^VvDj{iTlSVXZQ>v(`3~f-W(4wRjRaGehDWqvirB+GP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reNDPbRW2L^3h7$UEu?c~XjnT97sF zeV|hI8`|+ws^HzbrVG_frCNxs(z*&<1a(rAxx#Yqldq~r@wLKr)+;j}hmeTo$`Hk8 zBiODVyMHJkvcGW6YMxnj)oe#OfAFx0?psWB)`cmuZzRBX1ulxx)w_B32}e)cxTJ3n z)?+^{slNQsckXQ6_F=HNVfyqlm#!zLuYAn^j}(V-Nz_r3N_)ivaR{={7exg hsEp4a-vD#F+-|;?yKv26{#Ys~%6{AJ<5~U|{x27G2BQD~ diff --git a/tools/bin/ABIChecker/System.Composition.AttributedModel.dll b/tools/bin/ABIChecker/System.Composition.AttributedModel.dll old mode 100644 new mode 100755 diff --git a/tools/bin/ABIChecker/System.Composition.Convention.dll b/tools/bin/ABIChecker/System.Composition.Convention.dll old mode 100644 new mode 100755 diff --git a/tools/bin/ABIChecker/System.Composition.Hosting.dll b/tools/bin/ABIChecker/System.Composition.Hosting.dll old mode 100644 new mode 100755 diff --git a/tools/bin/ABIChecker/System.Composition.Runtime.dll b/tools/bin/ABIChecker/System.Composition.Runtime.dll old mode 100644 new mode 100755 diff --git a/tools/bin/ABIChecker/System.Composition.TypedParts.dll b/tools/bin/ABIChecker/System.Composition.TypedParts.dll old mode 100644 new mode 100755 diff --git a/tools/src/ABIChecker/ABIChecker.cs b/tools/src/ABIChecker/ABIChecker.cs new file mode 100644 index 0000000..448d12f --- /dev/null +++ b/tools/src/ABIChecker/ABIChecker.cs @@ -0,0 +1,149 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; + +namespace Checker_ABI +{ + public class ABIChecker + { + AssemblyChecker _checker = new AssemblyChecker(); + string _basePath; + string _targetPath; + bool _isFile; + + [Flags] + public enum ABITestResult + { + None = 0, + InternalAPIChanged = 1 << 0, + ACRRequired = 1 << 1 + } + + public ABIChecker(string basePath, string targetPath, bool isFile) + { + _basePath = basePath; + _targetPath = targetPath; + _isFile = isFile; + } + + public ABITestResult CheckABI() + { + if (!_isFile) + { + return CheckDirectory(); + } + else + { + var result = CheckFile(new FileInfo(_basePath).FullName, new FileInfo(_targetPath).FullName); + Console.WriteLine($"File check result: {((result & ABITestResult.ACRRequired) == ABITestResult.ACRRequired ? "FAIL" : "PASS")}"); + return result; + } + } + + ABITestResult CheckDirectory() + { + DirectoryInfo baseDirectoryInfo = new DirectoryInfo(_basePath); + DirectoryInfo targetDirectoryInfo = new DirectoryInfo(_targetPath); + + if (!baseDirectoryInfo.Exists || !targetDirectoryInfo.Exists) + { + Console.WriteLine($"invalid directory path"); + } + + FileInfo[] baseDllFiles = baseDirectoryInfo.GetFiles("*.dll", SearchOption.TopDirectoryOnly); + FileInfo[] targetDllFiles = targetDirectoryInfo.GetFiles("*.dll", SearchOption.TopDirectoryOnly); + + Console.WriteLine($"File Count : {baseDllFiles.Length} == {targetDllFiles.Length}"); + + ABITestResult directoryResult = ABITestResult.None; + directoryResult |= CheckChangedModule(baseDllFiles, targetDllFiles); + Console.WriteLine($"Module Check : {directoryResult.ToString()}"); + Console.WriteLine("---------------------------------"); + + int count = 1; + foreach (var baseFile in baseDllFiles) + { + foreach (var targetFile in targetDllFiles) + { + if (baseFile.Name == targetFile.Name) + { + var fileResult = CheckFile(baseFile.FullName, targetFile.FullName); + Console.WriteLine($"{count++}. {baseFile.ToString()} : {((fileResult & ABITestResult.ACRRequired) == ABITestResult.ACRRequired ? "FAIL" : "PASS")}"); + directoryResult |= fileResult; + } + } + } + return directoryResult; + } + + ABITestResult CheckChangedModule(FileInfo[] baseDllFiles, FileInfo[] targetDllFiles) + { + var result = ABITestResult.None; + + var removedDllFiles = baseDllFiles.Where(b => !targetDllFiles.Any(t => t.Name == b.Name)); + foreach (var file in removedDllFiles) + { + Console.WriteLine($"!! Missing DLL: {file.Name}"); + result |= CheckFile(file.FullName); + } + + var addedDllFiles = targetDllFiles.Where(t => !baseDllFiles.Any(b => b.Name == t.Name)); + foreach (var file in addedDllFiles) + { + Console.WriteLine($"!! Added DLL : {file.Name}"); + result |= CheckFile(file.FullName); + } + + return result; + } + + ABITestResult CheckFile(string file) + { + return CheckFile(file, string.Empty); + } + + ABITestResult CheckFile(string baseFile, string targetFile) + { + ABITestResult result = ABITestResult.None; + IList changedAPIList; + try + { + if (targetFile == string.Empty) + { + changedAPIList = _checker.CheckAssemblyFile(Assembly.LoadFrom(baseFile)); + } + else + { + changedAPIList = _checker.CheckAssemblyFile(Assembly.LoadFrom(baseFile), Assembly.LoadFile(targetFile)); + } + var internalAPIList = new List(); + for (int i = changedAPIList.Count - 1; i >= 0; i--) + { + if (changedAPIList[i].GetCustomAttribute()?.State == System.ComponentModel.EditorBrowsableState.Never) + { + Console.WriteLine($" Internal API changed: {changedAPIList[i].DeclaringType}::{changedAPIList[i].ToString()}"); + internalAPIList.Add(changedAPIList[i]); + changedAPIList.Remove(changedAPIList[i]); + } + } + + if (changedAPIList.Count > 0) + { + result |= ABITestResult.ACRRequired; + } + if (internalAPIList.Count > 0) + { + result |= ABITestResult.InternalAPIChanged; + } + } + catch (Exception e) + { + Console.WriteLine(e); + } + + return result; + } + } +} diff --git a/tools/src/ABIChecker/ABITester.cs b/tools/src/ABIChecker/ABITester.cs deleted file mode 100644 index 47703a4..0000000 --- a/tools/src/ABIChecker/ABITester.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.IO; -using System.Reflection; - -namespace Checker_ABI -{ - public class ABITester - { - AssemblyChecker _checker = new AssemblyChecker(); - string _basePath; - string _latestPath; - bool _isFile; - - public ABITester(string basePath, string latestPath, bool isFile) - { - _basePath = basePath; - _latestPath = latestPath; - _isFile = isFile; - } - - public bool CheckABI() - { - if (!_isFile) - { - return InternalDirectoryCheck(); - } - else - { - var result = _checker.CheckAssemblyToList(Assembly.LoadFrom(_basePath), Assembly.LoadFile(_latestPath)); - var bResult = result.Count > 0 ? false : true; - Console.WriteLine($"{_basePath} : {(bResult ? "PASS" : "FAIL")}"); - return bResult; - } - } - - bool InternalDirectoryCheck() - { - DirectoryInfo baseDirectoryInfo = new DirectoryInfo(_basePath); - DirectoryInfo targetDirectoryInfo = new DirectoryInfo(_latestPath); - - if (!baseDirectoryInfo.Exists || !targetDirectoryInfo.Exists) - { - Console.WriteLine($"invalid directory path"); - } - - FileInfo[] baseDllFiles = baseDirectoryInfo.GetFiles("*.dll", SearchOption.TopDirectoryOnly); - FileInfo[] targetDllFiles = targetDirectoryInfo.GetFiles("*.dll", SearchOption.TopDirectoryOnly); - - Console.WriteLine($"File Count : {baseDllFiles.Length} == {targetDllFiles.Length}"); - - int num = 1; - int errCount = 0; - - foreach (var baseFile in baseDllFiles) - { - foreach (var latestFile in targetDllFiles) - { - if (baseFile.Name == latestFile.Name) - { - try - { - var result = _checker.CheckAssemblyToList(Assembly.LoadFrom(baseFile.FullName), Assembly.LoadFile(latestFile.FullName)); - bool bResult = result.Count > 0 ? false : true; - Console.WriteLine($"{num++}. {baseFile.ToString()} : {(bResult ? "PASS" : "FAIL")}"); - - if (!bResult) errCount++; - } - catch (Exception) - { - continue; - } - } - } - } - return errCount > 0 ? false : true; - } - } -} diff --git a/tools/src/ABIChecker/AssemblyChecker.cs b/tools/src/ABIChecker/AssemblyChecker.cs new file mode 100644 index 0000000..973fe5e --- /dev/null +++ b/tools/src/ABIChecker/AssemblyChecker.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; + +namespace Checker_ABI +{ + internal class AssemblyChecker + { + private const BindingFlags PublicOnlyFlags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Static; + + public IList CompareClassTypes(Type originalType, Type targetType) + { + if (originalType.ToString() != targetType.ToString()) + { + throw new ArgumentException("The full name of type is different. ABI check is only possible if name is the same."); + } + + var originalMembers = originalType.GetMembers(PublicOnlyFlags).ToList(); + var targetMembers = targetType.GetMembers(PublicOnlyFlags).ToList(); + + for (int i = originalMembers.Count-1; i >= 0; i--) + { + for (int j = targetMembers.Count-1; j >= 0; j--) + { + if (originalMembers[i].ToString() == targetMembers[j].ToString()) + { + if (originalMembers[i] is MethodInfo originalMember && targetMembers[j] is MethodInfo targetMamber) + { + if (originalMember.GetBaseDefinition().DeclaringType.ToString() != targetMamber.GetBaseDefinition().DeclaringType.ToString()) + { + continue; + } + } + originalMembers.RemoveAt(i); + targetMembers.RemoveAt(j); + break; + } + } + } + + IList diffrentMemberList = new List(); + foreach (var item in originalMembers) + { + Console.WriteLine($" !! Missing API: {item.DeclaringType}::{item.ToString()}"); + diffrentMemberList.Add(item); + } + + foreach (var item in targetMembers) + { + Console.WriteLine($" !! Added API: {item.DeclaringType}::{item.ToString()}"); + diffrentMemberList.Add(item); + } + + return diffrentMemberList; + } + + public IList CheckAssemblyFile(Assembly baseAssembly, Assembly targetAssembly) + { + var basePublicTypes = baseAssembly.GetTypes().Where(b => b.IsPublic).ToList(); + var targetPublicTypes = targetAssembly.GetTypes().Where(b => b.IsPublic).ToList(); + var diffrentMemberList = new List(); + + for (int i = 0; i < basePublicTypes.Count; i++) + { + for (int j = 0; j < targetPublicTypes.Count; j++) + { + if (basePublicTypes[i].ToString() == targetPublicTypes[j].ToString()) + { + var differentMembers = CompareClassTypes(basePublicTypes[i], targetPublicTypes[j]); + + if (differentMembers?.Count > 0) + { + Console.WriteLine($" ==> {basePublicTypes[i]}, Diffrent Member Count : {differentMembers.Count}"); + foreach (var member in differentMembers) + { + diffrentMemberList.Add(member); + } + } + } + } + } + return diffrentMemberList; + } + + public IList CheckAssemblyFile(Assembly assembly) + { + var publicTypes = assembly.GetTypes().Where(b => b.IsPublic).ToList(); + var diffrentMemberList = new List(); + + foreach (var type in publicTypes) + { + diffrentMemberList = diffrentMemberList.Concat(type.GetMembers(PublicOnlyFlags)).ToList(); + } + + return diffrentMemberList; + } + } +} diff --git a/tools/src/ABIChecker/Checker/AssemblyChecker.cs b/tools/src/ABIChecker/Checker/AssemblyChecker.cs deleted file mode 100644 index 2bc15bd..0000000 --- a/tools/src/ABIChecker/Checker/AssemblyChecker.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - -namespace Checker_ABI -{ - internal class AssemblyChecker - { - private const BindingFlags s_PublicOnlyFlags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Static; - - public bool TypeValidate(Type originalType, Type comparedType) - { - var originalMembers = originalType.GetMembers(s_PublicOnlyFlags); - var comparedMembers = comparedType.GetMembers(s_PublicOnlyFlags); - - // Compare Number of public Methods - MethodInfo[] originalMethods = originalType.GetMethods(s_PublicOnlyFlags); - MethodInfo[] comparedMethods = comparedType.GetMethods(s_PublicOnlyFlags); - - if (comparedMethods.Length != originalMethods.Length) - return false; - - // Compare Number of public Properties - PropertyInfo[] originalProperties = originalType.GetProperties(s_PublicOnlyFlags); - PropertyInfo[] comparedProperties = comparedType.GetProperties(s_PublicOnlyFlags); - - if (comparedProperties.Length != originalProperties.Length) - return false; - - // Compare number of public fields - FieldInfo[] originalFields = originalType.GetFields(s_PublicOnlyFlags); - FieldInfo[] comparedToFields = comparedType.GetFields(s_PublicOnlyFlags); - - if (comparedToFields.Length != originalFields.Length) - return false; - - - // Compare number of public events - EventInfo[] originalEvents = originalType.GetEvents(s_PublicOnlyFlags); - EventInfo[] comparedToEvents = comparedType.GetEvents(s_PublicOnlyFlags); - - if (originalEvents.Length != comparedToEvents.Length) - return false; - - return true; - } - - public IList CompareClassTypeToList(Type originalType, Type comparedType) - { - if (originalType.ToString() != comparedType.ToString()) - { - throw new ArgumentException("The full name of type is different. ABI check is only possible if name is the same."); - } - - IList diffrentMemberList = new List(); - var originalMembers = originalType.GetMembers(s_PublicOnlyFlags).ToList(); - var comparedMembers = comparedType.GetMembers(s_PublicOnlyFlags).ToList(); - - for (int i = originalMembers.Count-1; i >= 0; i--) - { - bool bResult = false; - for (int j = comparedMembers.Count-1; j >= 0; j--) - { - if (originalMembers[i].ToString() == comparedMembers[j].ToString()) - { - if (originalMembers[i] is MethodInfo first && comparedMembers[j] is MethodInfo last) - { - if (first.GetBaseDefinition().DeclaringType.ToString() != last.GetBaseDefinition().DeclaringType.ToString()) - { - continue; - } - } - - bResult = true; - originalMembers.RemoveAt(i); - comparedMembers.RemoveAt(j); - break; - } - } - - if (!bResult) - { - diffrentMemberList.Add(originalMembers[i]); - } - } - - if (comparedMembers.Count > 0) - { - foreach (var item in originalMembers) - diffrentMemberList.Add(item); - - foreach (var item in comparedMembers) - diffrentMemberList.Add(item); - } - - return diffrentMemberList; - } - - public IList CheckAssemblyToList(Assembly baseAssembly, Assembly latestAssembly) - { - var baseInfos = baseAssembly.GetTypes().Where(b => b.IsPublic).ToList(); - var lastInfos = latestAssembly.GetTypes().Where(b => b.IsPublic).ToList(); - var diffrentMemberList = new List(); - - for (int i = 0; i < baseInfos.Count; i++) - { - for (int j = 0; j < lastInfos.Count; j++) - { - if (baseInfos[i].ToString() == lastInfos[j].ToString()) - { - var result = CompareClassTypeToList(baseInfos[i], lastInfos[j]); - - if (result?.Count > 0) - { - Console.WriteLine($"ABI BREAK!! {baseInfos[i]} : Diffrent Member Count : {result.Count}"); - foreach (var item in result) - { - diffrentMemberList.Add(item); - Console.WriteLine($"ABI BREAK!! {item.DeclaringType}::{item}"); - } - } - } - } - } - return diffrentMemberList; - } - } -} diff --git a/tools/src/ABIChecker/Checker_ABI.sln b/tools/src/ABIChecker/Checker_ABI.sln deleted file mode 100644 index d88a160..0000000 --- a/tools/src/ABIChecker/Checker_ABI.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2036 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Checker_ABI", "Checker_ABI.csproj", "{99956C3A-4C56-455F-9793-7E98A056ED34}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {99956C3A-4C56-455F-9793-7E98A056ED34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {99956C3A-4C56-455F-9793-7E98A056ED34}.Debug|Any CPU.Build.0 = Debug|Any CPU - {99956C3A-4C56-455F-9793-7E98A056ED34}.Release|Any CPU.ActiveCfg = Release|Any CPU - {99956C3A-4C56-455F-9793-7E98A056ED34}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {FFC2467C-4F5E-4B70-86B1-DD71FC699C12} - EndGlobalSection -EndGlobal diff --git a/tools/src/ABIChecker/Program.cs b/tools/src/ABIChecker/Program.cs index 8c0277c..1831919 100644 --- a/tools/src/ABIChecker/Program.cs +++ b/tools/src/ABIChecker/Program.cs @@ -36,37 +36,16 @@ namespace Checker_ABI return 0; } - var tester = new ABITester(options.BasePath, options.PrPath, options.IsFile); - var bResult = tester.CheckABI(); + var abiChecker = new ABIChecker(options.BasePath, options.PrPath, options.IsFile); + var result = abiChecker.CheckABI(); Console.WriteLine("====================="); - Console.WriteLine($"ABI CHECK : {bResult}"); + Console.WriteLine($"ABI CHECK : {((result & ABIChecker.ABITestResult.ACRRequired) == ABIChecker.ABITestResult.ACRRequired ? "Fail" : "Pass")}"); Console.WriteLine("====================="); Console.WriteLine("=========ABI CHECK END========="); + Console.WriteLine("Return : " + (int)result); - return bResult ? 0 : 1; - } - - public static void LabelingTest() - { - WebRequest request = WebRequest.Create("https://api.github.com/repos/darkleem/google-diff-match-patch/issues/111/labels"); - request.Method = "POST"; - request.Headers.Add(HttpRequestHeader.UserAgent, "google-diff-match-patch"); - request.Headers.Add(HttpRequestHeader.ContentType, "application/json"); - request.Headers.Add(HttpRequestHeader.Authorization, "token 3a37a027156bca0e561ae7a317d29fd249502899"); - - - var postData = @"[""bug""]"; - var data = Encoding.ASCII.GetBytes(postData); - - using (var stream = request.GetRequestStream()) - { - stream.Write(data, 0, data.Length); - } - - var response = (HttpWebResponse)request.GetResponse(); - var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd(); - Console.WriteLine(responseString); + return (int)result; } } } diff --git a/tools/src/ABIChecker/Properties/launchSettings.json b/tools/src/ABIChecker/Properties/launchSettings.json deleted file mode 100644 index 5929676..0000000 --- a/tools/src/ABIChecker/Properties/launchSettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "profiles": { - "Checker_ABI": { - "commandName": "Project", - "commandLineArgs": "-p c:/base/bin/public -b c:/target/bin/public" - } - } -} \ No newline at end of file diff --git a/tools/src/ABIChecker/Utilities/ObjectUtil.cs b/tools/src/ABIChecker/Utilities/ObjectUtil.cs deleted file mode 100644 index e5c8baa..0000000 --- a/tools/src/ABIChecker/Utilities/ObjectUtil.cs +++ /dev/null @@ -1,181 +0,0 @@ -using System; -using System.Reflection; - -namespace Checker_ABI.Utilities -{ - /// ----------------------------------------------------------------------- - /// - /// This utility class contains a rich sets of utility methods that perform operations - /// on objects during runtime such as copying of property and field values - /// between 2 objects, deep cloning of objects, etc. - /// - /// ----------------------------------------------------------------------- - public abstract class ObjectUtils - { - /// - /// Deep Comparison two objects if they are alike. The objects are consider alike if - /// they are: - /// - /// of the same , - /// have the same number of methods, properties and fields - /// the public and private properties and fields values reflect each other's. - /// - /// - /// - /// - /// - public static bool IsALike(object original, object comparedToObject) - { - - if (original.GetType() != comparedToObject.GetType()) - return false; - - // ............................................... - // Compare Number of Private and public Methods - // ............................................... - MethodInfo[] originalMethods = original - .GetType() - .GetMethods(BindingFlags.Instance | - BindingFlags.NonPublic | - BindingFlags.Public); - - MethodInfo[] comparedMethods = comparedToObject - .GetType() - .GetMethods(BindingFlags.Instance | - BindingFlags.NonPublic | - BindingFlags.Public); - - if (comparedMethods.Length != originalMethods.Length) - return false; - - // ............................................... - // Compare Number of Private and public Properties - // ................................................ - PropertyInfo[] originalProperties = original - .GetType() - .GetProperties(BindingFlags.Instance | - BindingFlags.NonPublic | - BindingFlags.Public); - - PropertyInfo[] comparedProperties = comparedToObject - .GetType() - .GetProperties(BindingFlags.Instance | - BindingFlags.NonPublic | - BindingFlags.Public); - - - if (comparedProperties.Length != originalProperties.Length) - return false; - - - // ........................................... - // Compare number of public and private fields - // ........................................... - FieldInfo[] originalFields = original - .GetType() - .GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); - - FieldInfo[] comparedToFields = comparedToObject - .GetType() - .GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); - - - if (comparedToFields.Length != originalFields.Length) - return false; - - // ........................................ - // compare field values - // ........................................ - foreach (FieldInfo fi in originalFields) - { - - // check to see if the object to contains the field - FieldInfo fiComparedObj = comparedToObject.GetType().GetField(fi.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); - - if (fiComparedObj == null) - return false; - - // Get the value of the field from the original object - Object srcValue = original.GetType().InvokeMember(fi.Name, - BindingFlags.GetField | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, - null, - original, - null); - - - - // Get the value of the field - object comparedObjFieldValue = comparedToObject - .GetType() - .InvokeMember(fiComparedObj.Name, - BindingFlags.GetField | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, - null, - comparedToObject, - null); - - - // ------------------------------- - // now compare the field values - // ------------------------------- - - if (srcValue == null) - { - if (comparedObjFieldValue != null) - return false; - else - return true; - } - - if (srcValue.GetType() != comparedObjFieldValue.GetType()) - return false; - - if (!srcValue.ToString().Equals(comparedObjFieldValue.ToString())) - return false; - } - - // ........................................ - // compare each Property values - // ........................................ - foreach (PropertyInfo pi in originalProperties) - { - - // check to see if the object to contains the field - PropertyInfo piComparedObj = comparedToObject - .GetType() - .GetProperty(pi.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public); - - if (piComparedObj == null) - return false; - - // Get the value of the property from the original object - Object srcValue = original - .GetType() - .InvokeMember(pi.Name, - BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, - null, - original, - null); - - // Get the value of the property - object comparedObjValue = comparedToObject - .GetType() - .InvokeMember(piComparedObj.Name, - BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, - null, - comparedToObject, - null); - - - // ------------------------------- - // now compare the property values - // ------------------------------- - if (srcValue.GetType() != comparedObjValue.GetType()) - return false; - - if (!srcValue.ToString().Equals(comparedObjValue.ToString())) - return false; - } - return true; - } - } -} diff --git a/tools/src/ABIChecker/Utilities/ReflectionExtension.cs b/tools/src/ABIChecker/Utilities/ReflectionExtension.cs deleted file mode 100644 index de4db85..0000000 --- a/tools/src/ABIChecker/Utilities/ReflectionExtension.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; - -namespace Checker_ABI.Utilities -{ - public static class ReflectionExtension - { - public static bool IsOverride(this MethodInfo method) - { - if (method == null) throw new ArgumentNullException(); - return method.DeclaringType != method.GetBaseDefinition().DeclaringType; - } - - public static bool AreMethodsEqualForDeclaringType(MethodInfo first, MethodInfo second) - { - first = first.ReflectedType == first.DeclaringType ? first : first.DeclaringType.GetMethod(first.Name, first.GetParameters().Select(p => p.ParameterType).ToArray()); - second = second.ReflectedType == second.DeclaringType ? second : second.DeclaringType.GetMethod(second.Name, second.GetParameters().Select(p => p.ParameterType).ToArray()); - return first == second; - } - - } -} -- 2.7.4