@@ -13,6 +13,13 @@ namespace Microsoft.MixedReality.Toolkit.Utilities.Editor
1313 /// </summary>
1414 internal static class PackageManifestUpdater
1515 {
16+ private static string MSBuildRegistryUrl = "https://pkgs.dev.azure.com/UnityDeveloperTools/MSBuildForUnity/_packaging/UnityDeveloperTools/npm/registry" ;
17+ private static string MSBuildRegistryName = "MS Build for Unity" ;
18+ private static string [ ] MSBuildRegistryScopes = new string [ ] { "com.microsoft" } ;
19+
20+ private static string MSBuildPackageName = "com.microsoft.msbuildforunity" ;
21+ private static string MSBuildPackageVersion = "0.8.2" ;
22+
1623 /// <summary>
1724 /// Ensures the required settings exist in the package manager to allow for
1825 /// installing MSBuild for Unity.
@@ -69,25 +76,22 @@ internal static void EnsureMSBuildForUnity()
6976 }
7077
7178 // Attempt to find an entry in the scoped regstries collection for the MSBuild for Unity url
72- const string msBuildRegistryUrl = "https://pkgs.dev.azure.com/UnityDeveloperTools/MSBuildForUnity/_packaging/UnityDeveloperTools/npm/registry" ;
7379 bool needToAddRegistry = true ;
7480 foreach ( ScopedRegistry registry in scopedRegistries )
7581 {
76- if ( registry . url == msBuildRegistryUrl )
82+ if ( registry . url == MSBuildRegistryUrl )
7783 {
7884 needToAddRegistry = false ;
7985 }
8086 }
8187
8288 // If no entry was found, add one.
83- const string msBuildRegistryName = "MS Build for Unity" ;
84- string [ ] msBuildRegistryScopes = new string [ ] { "com.microsoft" } ;
8589 if ( needToAddRegistry )
8690 {
8791 ScopedRegistry registry = new ScopedRegistry ( ) ;
88- registry . name = msBuildRegistryName ;
89- registry . url = msBuildRegistryUrl ;
90- registry . scopes = msBuildRegistryScopes ;
92+ registry . name = MSBuildRegistryName ;
93+ registry . url = MSBuildRegistryUrl ;
94+ registry . scopes = MSBuildRegistryScopes ;
9195
9296 scopedRegistries . Add ( registry ) ;
9397 }
@@ -102,7 +106,6 @@ internal static void EnsureMSBuildForUnity()
102106 // Attempt to find the MSBuild for Unity package entry in the dependencies collection
103107 // This loop also identifies the dependecies collection line and the start / end of a
104108 // pre-existing scoped registries collections
105- const string msBuildPackageName = "com.microsoft.msbuildforunity" ;
106109 bool needToAddPackage = true ;
107110 for ( int i = 0 ; i < manifestFileLines . Count ; i ++ )
108111 {
@@ -118,18 +121,17 @@ internal static void EnsureMSBuildForUnity()
118121 {
119122 dependenciesStartIndex = i ;
120123 }
121- if ( manifestFileLines [ i ] . Contains ( msBuildPackageName ) )
124+ if ( manifestFileLines [ i ] . Contains ( MSBuildPackageName ) )
122125 {
123126 needToAddPackage = false ;
124127 }
125128 }
126129
127130 // If no package was found add it to the dependencies collection.
128- const string msBuildPackageVersion = "0.8.1" ;
129131 if ( needToAddPackage )
130132 {
131133 // Add the package to the collection (pad the entry with four spaces)
132- manifestFileLines . Insert ( dependenciesStartIndex + 1 , $ " \" { msBuildPackageName } \" : \" { msBuildPackageVersion } \" ,") ;
134+ manifestFileLines . Insert ( dependenciesStartIndex + 1 , $ " \" { MSBuildPackageName } \" : \" { MSBuildPackageVersion } \" ,") ;
133135 }
134136
135137 if ( needToAddRegistry || needToAddPackage )
0 commit comments