Skip to content

Commit 2c01d41

Browse files
author
David Kline
authored
Merge pull request #6754 from davidkline-ms/updMsBuild
update MSBuild for Unity reference to v0.8.2
2 parents bfe072f + da0f874 commit 2c01d41

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

Assets/MixedRealityToolkit.Providers/WindowsMixedReality/DotNetAdapter/DotNetAdapter.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
<ItemGroup>
1919
<PackageReference Include="Microsoft.Windows.MixedReality.DotNetWinRT">
20-
<Version>0.5.1034</Version>
20+
<Version>0.5.*</Version>
2121
</PackageReference>
2222
<PackageReference Include="MSBuildForUnity">
23-
<Version>0.8.1</Version>
23+
<Version>0.8.*</Version>
2424
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2525
<PrivateAssets>all</PrivateAssets>
2626
</PackageReference>

Assets/MixedRealityToolkit/Utilities/Editor/PackageManifest/PackageManifestUpdater.cs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)