Skip to content

Commit

Permalink
Merge branch 'release/9.0.2xx' into FileWatcherImprovements
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat authored Dec 11, 2024
2 parents 5bef206 + 6d67e2a commit 7812c52
Show file tree
Hide file tree
Showing 38 changed files with 277 additions and 155 deletions.
16 changes: 0 additions & 16 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,6 @@
referenced by the same 7.0 SDK that references the 7.0.VersionFeature70 runtime pack. -->
<_NET70ILLinkPackVersion>7.0.100-1.23211.1</_NET70ILLinkPackVersion>
</PropertyGroup>
<PropertyGroup Label="AspNetCore template versioning">
<!-- Automated versions for asp.net templates -->
<MicrosoftNETSdkPatchVersion>$(VersionFeature)</MicrosoftNETSdkPatchVersion>
<!--
Between branding and shipping, the templates should stay at last month's version.
If the incoming SDK version is 2 versions behind us, we know we just branded but haven't done the internal -> public merge yet.
Therefore we stay at last month's version.
We also need to special case the 1st patch release, because the incoming SDK version will never be 2 versions behind us in that case.
Instead the indicator is that the incoming SDK version is not RTM or greater yet.
Preview releases already use -1 versionining so don't subtract one for that version.
In public builds, we always use the 2 month old version.
-->
<SubtractOneFromTemplateVersions Condition="'$(SYSTEM_TEAMPROJECT)' != 'internal'">true</SubtractOneFromTemplateVersions>
<SubtractOneFromTemplateVersions Condition="$([MSBuild]::Subtract($(VersionFeature), $(MicrosoftNETSdkPatchVersion))) &gt;= 2">true</SubtractOneFromTemplateVersions>
<SubtractOneFromTemplateVersions Condition="$(VersionFeature) &gt;= 1 AND ! $(PreReleaseVersionLabel.Contains('rtm')) AND ! $(PreReleaseVersionLabel.Contains('servicing'))">true</SubtractOneFromTemplateVersions>
</PropertyGroup>
<PropertyGroup Label="Restore feeds">
<!-- In an orchestrated build, this may be overridden to other Azure feeds. -->
<DotNetAssetRootUrl Condition="'$(DotNetAssetRootUrl)'==''">https://dotnetbuilds.blob.core.windows.net/public/</DotNetAssetRootUrl>
Expand Down
26 changes: 0 additions & 26 deletions src/BuiltInTools/dotnet-format/Commands/FormatCommandCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ internal static class FormatCommandCommon
internal const int UnhandledExceptionExitCode = 1;
internal const int CheckFailedExitCode = 2;
internal const int UnableToLocateMSBuildExitCode = 3;
internal const int UnableToLocateDotNetCliExitCode = 4;

private static string[] VerbosityLevels => new[] { "q", "quiet", "m", "minimal", "n", "normal", "d", "detailed", "diag", "diagnostic" };
private static string[] SeverityLevels => new[] { "info", "warn", "error" };
Expand Down Expand Up @@ -102,14 +101,6 @@ internal static async Task<int> FormatAsync(FormatOptions formatOptions, ILogger
var runtimeVersion = GetRuntimeVersion();
logger.LogDebug(Resources.The_dotnet_runtime_version_is_0, runtimeVersion);

if (!TryGetDotNetCliVersion(out var dotnetVersion))
{
logger.LogError(Resources.Unable_to_locate_dotnet_CLI_Ensure_that_it_is_on_the_PATH);
return UnableToLocateDotNetCliExitCode;
}

logger.LogTrace(Resources.The_dotnet_CLI_version_is_0, dotnetVersion);

if (!TryLoadMSBuild(out var msBuildPath))
{
logger.LogError(Resources.Unable_to_locate_MSBuild_Ensure_the_NET_SDK_was_installed_with_the_official_installer);
Expand Down Expand Up @@ -354,23 +345,6 @@ private static string EnsureTrailingSlash(string path)
?.InformationalVersion;
}

internal static bool TryGetDotNetCliVersion([NotNullWhen(returnValue: true)] out string? dotnetVersion)
{
try
{
var processInfo = ProcessRunner.CreateProcess("dotnet", "--version", captureOutput: true, displayWindow: false);
var versionResult = processInfo.Result.GetAwaiter().GetResult();

dotnetVersion = versionResult.OutputLines[0].Trim();
return true;
}
catch
{
dotnetVersion = null;
return false;
}
}

internal static bool TryLoadMSBuild([NotNullWhen(returnValue: true)] out string? msBuildPath)
{
try
Expand Down
3 changes: 0 additions & 3 deletions src/BuiltInTools/dotnet-format/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,6 @@
<data name="Standard_input_used_multiple_times" xml:space="preserve">
<value>Standard input markers ('/dev/stdin', '-') can only be used either with `--include` or `--exclude`, but not both.</value>
</data>
<data name="Unable_to_locate_dotnet_CLI_Ensure_that_it_is_on_the_PATH" xml:space="preserve">
<value>Unable to locate dotnet CLI. Ensure that it is on the PATH.</value>
</data>
<data name="The_dotnet_CLI_version_is_0" xml:space="preserve">
<value>The dotnet CLI version is '{0}'.</value>
</data>
Expand Down
5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.cs.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.de.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.es.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.fr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.it.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.ja.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.ko.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.pl.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.pt-BR.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.ru.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.tr.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.zh-Hans.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions src/BuiltInTools/dotnet-format/xlf/Resources.zh-Hant.xlf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.DotNet.Cli.Utils;

namespace Microsoft.DotNet.CommandFactory
{
public class CompositeCommandResolver : ICommandResolver
{
private const string CommandResolveEvent = "commandresolution/commandresolved";
private IList<ICommandResolver> _orderedCommandResolvers;

public IEnumerable<ICommandResolver> OrderedCommandResolvers
Expand Down Expand Up @@ -33,6 +36,12 @@ public CommandSpec Resolve(CommandResolverArguments commandResolverArguments)

if (commandSpec != null)
{
TelemetryEventEntry.TrackEvent(CommandResolveEvent, new Dictionary<string, string>()
{
{ "commandName", commandResolverArguments is null ? string.Empty : Sha256Hasher.HashWithNormalizedCasing(commandResolverArguments.CommandName) },
{ "commandResolver", commandResolver.GetType().ToString() }
});

return commandSpec;
}
}
Expand Down
37 changes: 37 additions & 0 deletions src/Cli/dotnet/commands/dotnet-workload/WorkloadUtilities.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.Deployment.DotNet.Releases;

namespace Microsoft.DotNet.Workloads.Workload
{
internal class WorkloadUtilities
{
internal static int VersionCompare(string first, string second)
{
if (first.Equals(second))
{
return 0;
}

var firstDash = first.IndexOf('-');
var secondDash = second.IndexOf('-');
firstDash = firstDash < 0 ? first.Length : firstDash;
secondDash = secondDash < 0 ? second.Length : secondDash;

var firstVersion = new Version(first.Substring(0, firstDash));
var secondVersion = new Version(second.Substring(0, secondDash));

var comparison = firstVersion.CompareTo(secondVersion);
if (comparison != 0)
{
return comparison;
}

var modifiedFirst = new ReleaseVersion(1, 1, 1, firstDash == first.Length ? null : first.Substring(firstDash));
var modifiedSecond = new ReleaseVersion(1, 1, 1, secondDash == second.Length ? null : second.Substring(secondDash));

return modifiedFirst.CompareTo(modifiedSecond);
}
}
}
Loading

0 comments on commit 7812c52

Please sign in to comment.