static void PopulateDeprecationInfo()
        {
            if (s_DidPopulateDeprecationInfo)
            {
                return;
            }

            s_DidPopulateDeprecationInfo = true;

#if UNITY_2021_1_OR_NEWER
            s_DeprecationInfo[k_DeprecatedWMRLoaderName] = new DeprecationInfo {
                icon          = EditorGUIUtility.IconContent("console.warnicon.sml"),
                renderContent = new GUIContent("",
                                               EditorGUIUtility.IconContent("console.warnicon.sml").image,
                                               @"Microsoft has transitioned support of Windows MR devices to OpenXR in Unity 2021, and recommends using Unity's OpenXR plugin. As such, this Windows XR plugin is marked as deprecated and will be removed in the 2021.2 release. It will continue to be supported in the 2020 LTS.")
            };
#endif //UNITY_2021_1_OR_NEWER
        }
        private static DeprecationInfo?ConvertPackageDeprecationMetadata(PackageDeprecationMetadata?deprecationMetadata)
        {
            if (deprecationMetadata == null)
            {
                return(null);
            }

            var deprecationInfo = new DeprecationInfo
            {
                Message = deprecationMetadata.Message,
                Reasons = deprecationMetadata.Reasons
            };

            if (deprecationMetadata.AlternatePackage != null)
            {
                deprecationInfo.AlternatePackageInfo = new AlternatePackageInfo
                {
                    Id    = deprecationMetadata.AlternatePackage.PackageId,
                    Range = deprecationMetadata.AlternatePackage.Range
                };
            }
            return(deprecationInfo);
        }
Example #3
0
 private static void HasSameNotice(DeprecationInfo publishedNotice, NewAzureDeprecationV1Message deprecationInfo)
 {
     Assert.NotNull(publishedNotice.Notice);
     Assert.Equal(deprecationInfo.Notice.Description, publishedNotice.Notice.Description);
     Assert.Equal(deprecationInfo.Notice.Links, publishedNotice.Notice.Links);
 }
Example #4
0
 private static void HasSameImpact(NewAzureDeprecationV1Message deprecationInfo, DeprecationInfo publishedNotice)
 {
     Assert.NotNull(publishedNotice.Impact);
     Assert.NotNull(publishedNotice.Impact.Services);
     Assert.Equal(deprecationInfo.Impact.Area, publishedNotice.Impact.Area);
     Assert.Equal(deprecationInfo.Impact.Cloud, publishedNotice.Impact.Cloud);
     Assert.Equal(deprecationInfo.Impact.Description, publishedNotice.Impact.Description);
     Assert.Equal(deprecationInfo.Impact.Type, publishedNotice.Impact.Type);
     Assert.Equal(deprecationInfo.Impact.Services.Count, publishedNotice.Impact.Services.Count);
     foreach (var impactedService in publishedNotice.Impact.Services)
     {
         Assert.Contains(impactedService, deprecationInfo.Impact.Services);
     }
 }
Example #5
0
 private static void HasSameTimeline(NewAzureDeprecationV1Message deprecationInfo, DeprecationInfo publishedNotice)
 {
     Assert.NotNull(publishedNotice.Timeline);
     Assert.Equal(deprecationInfo.Timeline.Count, publishedNotice.Timeline.Count);
     foreach (var timelineEntry in publishedNotice.Timeline)
     {
         var matchCount = deprecationInfo.Timeline.Count(entry =>
                                                         entry.Date == timelineEntry.Date &&
                                                         entry.Description.Equals(timelineEntry.Description, StringComparison.InvariantCultureIgnoreCase) &&
                                                         entry.Phase.Equals(timelineEntry.Phase, StringComparison.InvariantCultureIgnoreCase));
         Assert.Equal(1, matchCount);
     }
 }