diff --git a/Directory.Build.targets b/Directory.Build.targets index 79641ba4cd..284598d48f 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -5,4 +5,12 @@ + + + + \ No newline at end of file diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 40f4985d59..aa1f8de945 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,6 +1,10 @@ + + https://github.com/dotnet/core-setup + ee0c7ead1a46f06f98aff9102b785f532b71da9c + https://github.com/dotnet/templating cd8a65408312bf4a92de7e97948782f9f88471e6 diff --git a/eng/Versions.props b/eng/Versions.props index ebb0f4dc67..41ec870b47 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -12,6 +12,7 @@ + 3.0.0-preview7-27826-20 3.0.100-preview7-012358 3.0.0-preview7.19325.7 2.2.1 diff --git a/global.json b/global.json index 37243683ef..422c27c271 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,11 @@ { "tools": { - "dotnet": "3.0.100-preview7-012358" + "dotnet": "3.0.100-preview7-012358", + "runtimes": { + "dotnet": [ + "$(MicrosoftNETCoreAppPackageVersion)" + ] + } }, "msbuild-sdks": { "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19323.4" diff --git a/src/dotnet/ToolManifest/JsonElementExtension.cs b/src/dotnet/ToolManifest/JsonElementExtension.cs index d69ab29304..3a66b321b0 100644 --- a/src/dotnet/ToolManifest/JsonElementExtension.cs +++ b/src/dotnet/ToolManifest/JsonElementExtension.cs @@ -15,12 +15,12 @@ internal static bool TryGetStringValue(this JsonElement element, string name, ou value = null; if (element.TryGetProperty(name, out JsonElement jsonValue)) { - if (jsonValue.Type != JsonValueType.String) + if (jsonValue.ValueKind != JsonValueKind.String) { throw new ToolManifestException( string.Format( LocalizableStrings.UnexpectedTypeInJson, - JsonValueType.String.ToString(), + JsonValueKind.String.ToString(), name)); } value = jsonValue.GetString(); @@ -35,12 +35,12 @@ internal static bool TryGetInt32Value(this JsonElement element, string name, out value = default; if (element.TryGetProperty(name, out JsonElement jsonValue)) { - if (jsonValue.Type != JsonValueType.Number) + if (jsonValue.ValueKind != JsonValueKind.Number) { throw new ToolManifestException( string.Format( LocalizableStrings.UnexpectedTypeInJson, - JsonValueType.Number.ToString(), + JsonValueKind.Number.ToString(), name)); } value = jsonValue.GetInt32(); @@ -55,12 +55,12 @@ internal static bool TryGetBooleanValue(this JsonElement element, string name, o value = default; if (element.TryGetProperty(name, out JsonElement jsonValue)) { - if (!(jsonValue.Type == JsonValueType.True || jsonValue.Type == JsonValueType.False)) + if (!(jsonValue.ValueKind == JsonValueKind.True || jsonValue.ValueKind == JsonValueKind.False)) { throw new ToolManifestException( string.Format( LocalizableStrings.UnexpectedTypeInJson, - JsonValueType.True.ToString() + "|" + JsonValueType.False.ToString(), + JsonValueKind.True.ToString() + "|" + JsonValueKind.False.ToString(), name)); } value = jsonValue.GetBoolean(); diff --git a/src/dotnet/ToolManifest/ToolManifestEditor.cs b/src/dotnet/ToolManifest/ToolManifestEditor.cs index 000855e595..42657f7152 100644 --- a/src/dotnet/ToolManifest/ToolManifestEditor.cs +++ b/src/dotnet/ToolManifest/ToolManifestEditor.cs @@ -164,11 +164,11 @@ private SerializableLocalToolsManifest DeserializeLocalToolsManifest(FilePath po serializableLocalToolsManifest.Tools = new List(); - if (tools.Type != JsonValueType.Object) + if (tools.ValueKind != JsonValueKind.Object) { throw new ToolManifestException( string.Format(LocalizableStrings.UnexpectedTypeInJson, - JsonValueType.Object.ToString(), + JsonValueKind.Object.ToString(), JsonPropertyTools)); } @@ -184,21 +184,21 @@ private SerializableLocalToolsManifest DeserializeLocalToolsManifest(FilePath po var commands = new List(); if (toolJson.Value.TryGetProperty(JsonPropertyCommands, out var commandsJson)) { - if (commandsJson.Type != JsonValueType.Array) + if (commandsJson.ValueKind != JsonValueKind.Array) { throw new ToolManifestException( string.Format(LocalizableStrings.UnexpectedTypeInJson, - JsonValueType.Array.ToString(), + JsonValueKind.Array.ToString(), JsonPropertyCommands)); } foreach (var command in commandsJson.EnumerateArray()) { - if (command.Type != JsonValueType.String) + if (command.ValueKind != JsonValueKind.String) { throw new ToolManifestException( string.Format(LocalizableStrings.UnexpectedTypeInJson, - JsonValueType.String.ToString(), + JsonValueKind.String.ToString(), "command")); } diff --git a/src/dotnet/ToolPackage/LocalToolsResolverCache.cs b/src/dotnet/ToolPackage/LocalToolsResolverCache.cs index 71fb22ddbf..437488ee08 100644 --- a/src/dotnet/ToolPackage/LocalToolsResolverCache.cs +++ b/src/dotnet/ToolPackage/LocalToolsResolverCache.cs @@ -51,7 +51,7 @@ public void Save( _fileSystem.File.WriteAllText( packageCacheFile, - JsonSerializer.ToString(existingCacheTable.Concat(diffedRow))); + JsonSerializer.Serialize(existingCacheTable.Concat(diffedRow))); } else { @@ -64,7 +64,7 @@ public void Save( _fileSystem.File.WriteAllText( packageCacheFile, - JsonSerializer.ToString(rowsToAdd)); + JsonSerializer.Serialize(rowsToAdd)); } } } @@ -96,7 +96,7 @@ private CacheRow[] GetCacheTable(string packageCacheFile) try { cacheTable = - JsonSerializer.Parse(_fileSystem.File.ReadAllText(packageCacheFile)); + JsonSerializer.Deserialize(_fileSystem.File.ReadAllText(packageCacheFile)); } catch (JsonException) { diff --git a/src/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsManager.cs b/src/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsManager.cs index 0e03bb34e6..da28cd7046 100644 --- a/src/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsManager.cs +++ b/src/dotnet/commands/dotnet-run/LaunchSettings/LaunchSettingsManager.cs @@ -29,7 +29,7 @@ public static LaunchSettingsApplyResult TryApplyLaunchSettings(string launchSett { var model = document.RootElement; - if (model.Type != JsonValueType.Object || !model.TryGetProperty(ProfilesKey, out var profilesObject) || profilesObject.Type != JsonValueType.Object) + if (model.ValueKind != JsonValueKind.Object || !model.TryGetProperty(ProfilesKey, out var profilesObject) || profilesObject.ValueKind != JsonValueKind.Object) { return new LaunchSettingsApplyResult(false, LocalizableStrings.LaunchProfilesCollectionIsNotAJsonObject); } @@ -43,19 +43,19 @@ public static LaunchSettingsApplyResult TryApplyLaunchSettings(string launchSett } else { - if (!profilesObject.TryGetProperty(profileName, out profileObject) || profileObject.Type != JsonValueType.Object) + if (!profilesObject.TryGetProperty(profileName, out profileObject) || profileObject.ValueKind != JsonValueKind.Object) { return new LaunchSettingsApplyResult(false, LocalizableStrings.LaunchProfileIsNotAJsonObject); } } - if (profileObject.Type == default) + if (profileObject.ValueKind == default) { foreach (var prop in profilesObject.EnumerateObject()) { - if (prop.Value.Type == JsonValueType.Object) + if (prop.Value.ValueKind == JsonValueKind.Object) { - if (prop.Value.TryGetProperty(CommandNameKey, out var commandNameElement) && commandNameElement.Type == JsonValueType.String) + if (prop.Value.TryGetProperty(CommandNameKey, out var commandNameElement) && commandNameElement.ValueKind == JsonValueKind.String) { if (_providers.ContainsKey(commandNameElement.GetString())) { @@ -67,13 +67,13 @@ public static LaunchSettingsApplyResult TryApplyLaunchSettings(string launchSett } } - if (profileObject.Type == default) + if (profileObject.ValueKind == default) { return new LaunchSettingsApplyResult(false, LocalizableStrings.UsableLaunchProfileCannotBeLocated); } if (!profileObject.TryGetProperty(CommandNameKey, out var finalCommandNameElement) - || finalCommandNameElement.Type != JsonValueType.String) + || finalCommandNameElement.ValueKind != JsonValueKind.String) { return new LaunchSettingsApplyResult(false, LocalizableStrings.UsableLaunchProfileCannotBeLocated); } @@ -100,9 +100,9 @@ private static bool TryLocateHandler(string commandName, out ILaunchSettingsProv private static bool IsDefaultProfileType(JsonProperty profileProperty) { - if (profileProperty.Value.Type != JsonValueType.Object + if (profileProperty.Value.ValueKind != JsonValueKind.Object || !profileProperty.Value.TryGetProperty(CommandNameKey, out var commandNameElement) - || commandNameElement.Type != JsonValueType.String) + || commandNameElement.ValueKind != JsonValueKind.String) { return false; } diff --git a/src/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs b/src/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs index 0f20c0772b..52f86b4db8 100644 --- a/src/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs +++ b/src/dotnet/commands/dotnet-run/LaunchSettings/ProjectLaunchSettingsProvider.cs @@ -54,7 +54,7 @@ public LaunchSettingsApplyResult TryApplySettings(JsonElement model, ref IComman } else if (string.Equals(property.Name, nameof(ProjectLaunchSettingsModel.EnvironmentVariables), StringComparison.OrdinalIgnoreCase)) { - if (property.Value.Type != JsonValueType.Object) + if (property.Value.ValueKind != JsonValueKind.Object) { return new LaunchSettingsApplyResult(false, string.Format(LocalizableStrings.ValueMustBeAnObject, property.Name)); } @@ -88,15 +88,15 @@ public LaunchSettingsApplyResult TryApplySettings(JsonElement model, ref IComman private static bool TryGetBooleanValue(JsonElement element, out bool value) { - switch (element.Type) + switch (element.ValueKind) { - case JsonValueType.True: + case JsonValueKind.True: value = true; return true; - case JsonValueType.False: + case JsonValueKind.False: value = false; return true; - case JsonValueType.Number: + case JsonValueKind.Number: if (element.TryGetDouble(out var doubleValue)) { value = doubleValue != 0; @@ -104,7 +104,7 @@ private static bool TryGetBooleanValue(JsonElement element, out bool value) } value = false; return false; - case JsonValueType.String: + case JsonValueKind.String: return bool.TryParse(element.GetString(), out value); default: value = false; @@ -114,21 +114,21 @@ private static bool TryGetBooleanValue(JsonElement element, out bool value) private static bool TryGetStringValue(JsonElement element, out string value) { - switch (element.Type) + switch (element.ValueKind) { - case JsonValueType.True: + case JsonValueKind.True: value = bool.TrueString; return true; - case JsonValueType.False: + case JsonValueKind.False: value = bool.FalseString; return true; - case JsonValueType.Null: + case JsonValueKind.Null: value = string.Empty; return true; - case JsonValueType.Number: + case JsonValueKind.Number: value = element.GetRawText(); return false; - case JsonValueType.String: + case JsonValueKind.String: value = element.GetString(); return true; default: diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index 00f198047a..067d574561 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -75,6 +75,12 @@ DestinationFiles="@(SdksContent -> '$(PublishDir)Sdks/%(RecursiveDir)%(Filename)%(Extension)')" /> + + + + diff --git a/test/Microsoft.DotNet.Tools.Tests.ComponentMocks/AppHostShellShimMakerMock.cs b/test/Microsoft.DotNet.Tools.Tests.ComponentMocks/AppHostShellShimMakerMock.cs index 9674f5c177..f539a568c8 100644 --- a/test/Microsoft.DotNet.Tools.Tests.ComponentMocks/AppHostShellShimMakerMock.cs +++ b/test/Microsoft.DotNet.Tools.Tests.ComponentMocks/AppHostShellShimMakerMock.cs @@ -26,7 +26,7 @@ public void CreateApphostShellShim(FilePath entryPoint, FilePath shimPath) _fileSystem.File.WriteAllText( shimPath.Value, - JsonSerializer.ToString(shim)); + JsonSerializer.Serialize(shim)); } public class FakeShim diff --git a/test/Microsoft.DotNet.Tools.Tests.ComponentMocks/ProjectRestorerMock.cs b/test/Microsoft.DotNet.Tools.Tests.ComponentMocks/ProjectRestorerMock.cs index 7581738aac..6408d6d92c 100644 --- a/test/Microsoft.DotNet.Tools.Tests.ComponentMocks/ProjectRestorerMock.cs +++ b/test/Microsoft.DotNet.Tools.Tests.ComponentMocks/ProjectRestorerMock.cs @@ -114,7 +114,7 @@ public void Restore(FilePath project, fakeExecutablePath); _fileSystem.File.WriteAllText( assetJsonOutput.WithFile(FakeCommandSettingsFileName).Value, - JsonSerializer.ToString(new {Name = feedPackage.ToolCommandName})); + JsonSerializer.Serialize(new {Name = feedPackage.ToolCommandName})); } public MockFeedPackage GetPackage( diff --git a/test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs index e64b6a68ab..7f25522042 100644 --- a/test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolInstallGlobalOrToolPathCommandTests.cs @@ -84,7 +84,7 @@ public void WhenRunWithPackageIdItShouldCreateValidShim() // It is hard to simulate shell behavior. Only Assert shim can point to executable dll _fileSystem.File.Exists(ExpectedCommandPath()).Should().BeTrue(); - var deserializedFakeShim = JsonSerializer.Parse( + var deserializedFakeShim = JsonSerializer.Deserialize( _fileSystem.File.ReadAllText(ExpectedCommandPath())); _fileSystem.File.Exists(deserializedFakeShim.ExecutablePath).Should().BeTrue(); @@ -151,7 +151,7 @@ public void WhenRunWithPackageIdWithSourceItShouldCreateValidShim() _fileSystem.File.Exists(ExpectedCommandPath()) .Should().BeTrue(); var deserializedFakeShim = - JsonSerializer.Parse( + JsonSerializer.Deserialize( _fileSystem.File.ReadAllText(ExpectedCommandPath())); _fileSystem.File.Exists(deserializedFakeShim.ExecutablePath).Should().BeTrue(); }