Skip to content

Commit 7ef7fc3

Browse files
author
davidkline-ms
committed
handle preview packages appropriately
1 parent 3eab036 commit 7ef7fc3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,22 @@ internal static bool IsMSBuildForUnityEnabled()
8282
string[] splitLine = line.Split(new char[] { ':' });
8383
if (splitLine.Length == 2)
8484
{
85+
// Ensure correct formatting of the version string, before we attempt to parse it.
8586
string versionString = splitLine[1].Trim(new char[] { ' ', '\"', ',' });
87+
bool replaceOnEquals = false;
88+
if (versionString.Contains("-"))
89+
{
90+
// The string references a preview version. Truncate at the '-'.
91+
versionString = versionString.Substring(0, versionString.IndexOf('-'));
92+
93+
// We want to update preview versions to the final.
94+
replaceOnEquals = true;
95+
}
8696

8797
Version version;
8898
if (Version.TryParse(versionString, out version))
8999
{
90-
isAppropriateVersion = version >= minVersion;
100+
isAppropriateVersion = replaceOnEquals ? (version > minVersion) : (version >= minVersion);
91101
}
92102
}
93103

0 commit comments

Comments
 (0)