diff options
author | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2016-01-28 17:55:33 +0300 |
---|---|---|
committer | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2016-01-28 17:55:58 +0300 |
commit | 3bc96e9c0232d762ff8794b5a25d433572622a9f (patch) | |
tree | 5935dd1bc65a06cb42c844e48816ca7d58086da0 | |
parent | 4d1c0d517cbdf329b55c75e7b88b809916c81c2d (diff) |
[mono-api-html] New interface members are only breaking if the interface existed.
5 files changed, 15 insertions, 15 deletions
diff --git a/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs b/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs index ff5326d9c8b..adbd862eb92 100644 --- a/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs @@ -57,7 +57,7 @@ namespace Xamarin.ApiDiff { State.Assembly = current.GetAttribute ("name"); } - public override void Added (XElement target) + public override void Added (XElement target, bool wasParentAdded) { // one assembly per xml file } diff --git a/mcs/tools/corcompare/mono-api-html/ClassComparer.cs b/mcs/tools/corcompare/mono-api-html/ClassComparer.cs index 1e19ab4b38e..a3399fbef04 100644 --- a/mcs/tools/corcompare/mono-api-html/ClassComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/ClassComparer.cs @@ -67,7 +67,7 @@ namespace Xamarin.ApiDiff { Compare (s.Elements ("class"), t.Elements ("class")); } - public override void Added (XElement target) + public override void Added (XElement target, bool wasParentAdded) { string name = target.Attribute ("name").Value; if (State.IgnoreNew.Any (re => re.IsMatch (name))) @@ -151,7 +151,7 @@ namespace Xamarin.ApiDiff { if (t != null) { Indent ().WriteLine ("\t// constructors"); foreach (var ctor in t.Elements ("constructor")) - ccomparer.Added (ctor); + ccomparer.Added (ctor, true); } t = target.Element ("fields"); @@ -161,28 +161,28 @@ namespace Xamarin.ApiDiff { else SetContext (target); foreach (var field in t.Elements ("field")) - fcomparer.Added (field); + fcomparer.Added (field, true); } t = target.Element ("properties"); if (t != null) { Indent ().WriteLine ("\t// properties"); foreach (var property in t.Elements ("property")) - pcomparer.Added (property); + pcomparer.Added (property, true); } t = target.Element ("events"); if (t != null) { Indent ().WriteLine ("\t// events"); foreach (var evnt in t.Elements ("event")) - ecomparer.Added (evnt); + ecomparer.Added (evnt, true); } t = target.Element ("methods"); if (t != null) { Indent ().WriteLine ("\t// methods"); foreach (var method in t.Elements ("method")) - mcomparer.Added (method); + mcomparer.Added (method, true); } t = target.Element ("classes"); diff --git a/mcs/tools/corcompare/mono-api-html/Comparer.cs b/mcs/tools/corcompare/mono-api-html/Comparer.cs index 8c692a03a9a..4210b9b95fb 100644 --- a/mcs/tools/corcompare/mono-api-html/Comparer.cs +++ b/mcs/tools/corcompare/mono-api-html/Comparer.cs @@ -48,7 +48,7 @@ namespace Xamarin.ApiDiff { return State.Output; } - public abstract void Added (XElement target); + public abstract void Added (XElement target, bool wasParentAdded); public abstract void Modified (XElement source, XElement target, ApiChanges changes); public abstract void Removed (XElement source); @@ -90,7 +90,7 @@ namespace Xamarin.ApiDiff { if (target != null) { foreach (var item in target) { SetContext (item); - Added (item); + Added (item, false); } } } diff --git a/mcs/tools/corcompare/mono-api-html/MemberComparer.cs b/mcs/tools/corcompare/mono-api-html/MemberComparer.cs index 4d703dc0618..d12d86625c2 100644 --- a/mcs/tools/corcompare/mono-api-html/MemberComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/MemberComparer.cs @@ -129,7 +129,7 @@ namespace Xamarin.ApiDiff { BeforeAdding (elements); a = true; } - Added (item); + Added (item, false); } if (a) AfterAdding (); @@ -204,14 +204,14 @@ namespace Xamarin.ApiDiff { Output.WriteLine ("<pre>"); } - public override void Added (XElement target) + public override void Added (XElement target, bool wasParentAdded) { var o = GetObsoleteMessage (target); if (!first && (o.Length > 0)) Output.WriteLine (); Indent (); - bool isInterface = IsInInterface (target); - Output.Write ("\t<span class='added added-{0} {1}' {2}>", ElementName, isInterface ? "breaking" : string.Empty, isInterface ? "data-is-breaking" : "data-is-non-breaking"); + bool isInterfaceBreakingChange = !wasParentAdded && IsInInterface (target); + Output.Write ("\t<span class='added added-{0} {1}' {2}>", ElementName, isInterfaceBreakingChange ? "breaking" : string.Empty, isInterfaceBreakingChange ? "data-is-breaking" : "data-is-non-breaking"); Output.Write ("{0}{1}", o, GetDescription (target)); Output.WriteLine ("</span>"); first = false; diff --git a/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs b/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs index 746166e0a64..063e34ecbf7 100644 --- a/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs @@ -55,7 +55,7 @@ namespace Xamarin.ApiDiff { State.Namespace = current.Attribute ("name").Value; } - public override void Added (XElement target) + public override void Added (XElement target, bool wasParentAdded) { string name = target.Attribute ("name").Value; if (State.IgnoreNew.Any (re => re.IsMatch (name))) @@ -66,7 +66,7 @@ namespace Xamarin.ApiDiff { Output.WriteLine (); // list all new types foreach (var addedType in target.Element ("classes").Elements ("class")) - comparer.Added (addedType); + comparer.Added (addedType, true); Output.WriteLine ("</div> <!-- end namespace {0} -->", name); Output.WriteLine (); } |