Merge branch 'master' into master-UpdateDependencies

This commit is contained in:
Eric Erhardt 2018-04-09 10:30:10 -05:00 committed by GitHub
commit 47bda58a23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
183 changed files with 4789 additions and 772 deletions

View file

@ -22,18 +22,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestPackages", "TestPackage
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4-BC0F-443B-8ADF-691321F10108}"
ProjectSection(SolutionItems) = preProject
build\AppHostTemplate.proj = build\AppHostTemplate.proj
build\AzureInfo.props = build\AzureInfo.props
build\BackwardsCompatibilityRuntimes.props = build\BackwardsCompatibilityRuntimes.props
build\BranchInfo.props = build\BranchInfo.props
build\Branding.props = build\Branding.props
build\BuildDefaults.props = build\BuildDefaults.props
build\BuildInfo.targets = build\BuildInfo.targets
build\BundledDotnetTools.proj = build\BundledDotnetTools.proj
build\BundledDotnetTools.props = build\BundledDotnetTools.props
build\BundledRuntimes.props = build\BundledRuntimes.props
build\BundledSdks.props = build\BundledSdks.props
build\BundledTemplates.proj = build\BundledTemplates.proj
build\BundledTemplates.props = build\BundledTemplates.props
build\BundledTools.props = build\BundledTools.props
build\BundledVersions.targets = build\BundledVersions.targets
build\Compile.targets = build\Compile.targets
build\CrossGen.props = build\CrossGen.props
build\DependencyVersions.props = build\DependencyVersions.props

View file

@ -4,7 +4,5 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<OutputType>Exe</OutputType>
<!-- Issue: https://github.com/dotnet/sdk/issues/1150 -->
<DisableImplicitAssetTargetFallback>true</DisableImplicitAssetTargetFallback>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,49 @@
<Project ToolsVersion="15.0" DefaultTargets="ExtractAppHostToOutput">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.tasks))\dir.tasks" />
<PropertyGroup>
<NativeExecutableExtension Condition=" $(Rid.StartsWith('win'))">.exe</NativeExecutableExtension>
<AppHostExecutableName>AppHost$(NativeExecutableExtension)</AppHostExecutableName>
</PropertyGroup>
<Target Name="ExtractAppHostToOutput"
Condition="!Exists('$(AppHostTemplatePath)/$(AppHostExecutableName)')"
DependsOnTargets="EnsureAppHostPackageRestored">
<Message Text="Restore $(TemplateFillInPackageName) from $(AppHostTemplatePath) to $(AppHostTemplateRestoreAdditionalParameters)."
Importance="High" />
<ItemGroup>
<AllFileOfRestoredAppHostPackage Include="$(AppHostIntermediateDirectory)\**\*.*" />
<NativeRestoredAppHostNETCore
Include="@(AllFileOfRestoredAppHostPackage)"
Condition="'%(FileName)%(Extension)' == '$(AppHostExecutableName)'"/>
</ItemGroup>
<Error Condition="@(NativeRestoredAppHostNETCore->Distinct()->Count()) != 1"
Text="Failed to determine the $(_NETCoreDotNetAppHostPackageName) executable in $(AllFileOfRestoredAppHostPackage)" />
<Copy
SourceFiles="@(NativeRestoredAppHostNETCore)"
DestinationFolder="$(AppHostTemplatePath)" />
<Message Text="Copy from @(NativeRestoredAppHostNETCore) to $(AppHostTemplatePath)."
Importance="High" />
</Target>
<Target Name="EnsureAppHostPackageRestored">
<PropertyGroup>
<AppHostTemplateRestoreAdditionalParameters>--runtime $(Rid)</AppHostTemplateRestoreAdditionalParameters>
<AppHostTemplateRestoreAdditionalParameters>$(AppHostTemplateRestoreAdditionalParameters) /p:TargetFramework=$(CliTargetFramework)</AppHostTemplateRestoreAdditionalParameters>
<AppHostTemplateRestoreAdditionalParameters>$(AppHostTemplateRestoreAdditionalParameters) /p:TemplateFillInPackageName=$(TemplateFillInPackageName)</AppHostTemplateRestoreAdditionalParameters>
<AppHostTemplateRestoreAdditionalParameters>$(AppHostTemplateRestoreAdditionalParameters) /p:TemplateFillInPackageVersion=$(TemplateFillInPackageVersion)</AppHostTemplateRestoreAdditionalParameters>
<AppHostTemplateRestoreAdditionalParameters>$(AppHostTemplateRestoreAdditionalParameters) /p:RestorePackagesPath=$(AppHostIntermediateDirectory)</AppHostTemplateRestoreAdditionalParameters>
</PropertyGroup>
<DotNetRestore ToolPath="$(PreviousStageDirectory)"
ProjectPath="$(MSBuildThisFileDirectory)/templates/templates.csproj"
AdditionalParameters="$(AppHostTemplateRestoreAdditionalParameters)" />
</Target>
</Project>

View file

@ -4,7 +4,7 @@
<MicrosoftAspNetCoreAppPackageVersion>2.1.0-preview2-30475</MicrosoftAspNetCoreAppPackageVersion>
<MicrosoftNETCoreAppPackageVersion>2.1.0-preview3-26406-06</MicrosoftNETCoreAppPackageVersion>
<MicrosoftNETCoreDotNetHostResolverPackageVersion>$(MicrosoftNETCoreAppPackageVersion)</MicrosoftNETCoreDotNetHostResolverPackageVersion>
<MicrosoftBuildPackageVersion>15.7.0-preview-000127</MicrosoftBuildPackageVersion>
<MicrosoftBuildPackageVersion>15.7.0-preview-000144</MicrosoftBuildPackageVersion>
<MicrosoftBuildFrameworkPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildFrameworkPackageVersion>
<MicrosoftBuildRuntimePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildRuntimePackageVersion>
<MicrosoftBuildLocalizationPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildLocalizationPackageVersion>
@ -17,25 +17,24 @@
<MicrosoftNETSdkPackageVersion>2.1.300-preview3-62804-06</MicrosoftNETSdkPackageVersion>
<MicrosoftNETBuildExtensionsPackageVersion>$(MicrosoftNETSdkPackageVersion)</MicrosoftNETBuildExtensionsPackageVersion>
<MicrosoftNETSdkRazorPackageVersion>$(MicrosoftAspNetCoreAppPackageVersion)</MicrosoftNETSdkRazorPackageVersion>
<MicrosoftNETSdkWebPackageVersion>2.1.300-preview2-20180306-1448279</MicrosoftNETSdkWebPackageVersion>
<MicrosoftNETSdkWebPackageVersion>2.1.300-preview2-20180403-1549509</MicrosoftNETSdkWebPackageVersion>
<MicrosoftNETSdkPublishPackageVersion>$(MicrosoftNETSdkWebPackageVersion)</MicrosoftNETSdkPublishPackageVersion>
<MicrosoftNETSdkWebProjectSystemPackageVersion>$(MicrosoftNETSdkWebPackageVersion)</MicrosoftNETSdkWebProjectSystemPackageVersion>
<MicrosoftDotNetCommonItemTemplatesPackageVersion>1.0.1-beta3-20180104-1263555</MicrosoftDotNetCommonItemTemplatesPackageVersion>
<MicrosoftDotNetCommonItemTemplatesPackageVersion>1.0.2-beta3-20180403-1549505</MicrosoftDotNetCommonItemTemplatesPackageVersion>
<MicrosoftDotNetCommonProjectTemplates20PackageVersion>$(MicrosoftDotNetCommonItemTemplatesPackageVersion)</MicrosoftDotNetCommonProjectTemplates20PackageVersion>
<MicrosoftDotNetTestProjectTemplates20PackageVersion>1.0.1-beta3-20180227-1423805</MicrosoftDotNetTestProjectTemplates20PackageVersion>
<MicrosoftTemplateEngineCliPackageVersion>1.0.0-beta3-20171204-315</MicrosoftTemplateEngineCliPackageVersion>
<MicrosoftDotNetTestProjectTemplates20PackageVersion>1.0.2-beta3-20180403-1549505</MicrosoftDotNetTestProjectTemplates20PackageVersion>
<MicrosoftTemplateEngineCliPackageVersion>1.0.2-beta3-20180403-1549505</MicrosoftTemplateEngineCliPackageVersion>
<MicrosoftTemplateEngineAbstractionsPackageVersion>$(MicrosoftTemplateEngineCliPackageVersion)</MicrosoftTemplateEngineAbstractionsPackageVersion>
<MicrosoftTemplateEngineCliLocalizationPackageVersion>$(MicrosoftTemplateEngineCliPackageVersion)</MicrosoftTemplateEngineCliLocalizationPackageVersion>
<MicrosoftTemplateEngineOrchestratorRunnableProjectsPackageVersion>$(MicrosoftTemplateEngineCliPackageVersion)</MicrosoftTemplateEngineOrchestratorRunnableProjectsPackageVersion>
<MicrosoftTemplateEngineUtilsPackageVersion>$(MicrosoftTemplateEngineCliPackageVersion)</MicrosoftTemplateEngineUtilsPackageVersion>
<MicrosoftDotNetPlatformAbstractionsPackageVersion>2.1.0-preview3-26406-06</MicrosoftDotNetPlatformAbstractionsPackageVersion>
<MicrosoftExtensionsDependencyModelPackageVersion>2.1.0-preview3-26406-06</MicrosoftExtensionsDependencyModelPackageVersion>
<MicrosoftDotNetPlatformAbstractionsPackageVersion>2.1.0-preview3-26405-02</MicrosoftDotNetPlatformAbstractionsPackageVersion>
<MicrosoftExtensionsDependencyModelPackageVersion>2.1.0-preview3-26405-02</MicrosoftExtensionsDependencyModelPackageVersion>
<MicrosoftDotNetCliCommandLinePackageVersion>0.1.1-alpha-174</MicrosoftDotNetCliCommandLinePackageVersion>
<MicrosoftDotNetProjectJsonMigrationPackageVersion>1.2.1-alpha-002133</MicrosoftDotNetProjectJsonMigrationPackageVersion>
<MicrosoftDotNetToolsMigrateCommandPackageVersion>$(MicrosoftDotNetProjectJsonMigrationPackageVersion)</MicrosoftDotNetToolsMigrateCommandPackageVersion>
<MicrosoftDotNetArchivePackageVersion>0.2.0-beta-62628-01</MicrosoftDotNetArchivePackageVersion>
<MicrosoftDiaSymReaderNativePackageVersion>1.6.0-beta2-25304</MicrosoftDiaSymReaderNativePackageVersion>
<NuGetBuildTasksPackageVersion>4.7.0-preview3.5039</NuGetBuildTasksPackageVersion>
<NuGetBuildTasksPackageVersion>4.7.0-preview4.5065</NuGetBuildTasksPackageVersion>
<NuGetBuildTasksPackPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetBuildTasksPackPackageVersion>
<NuGetCommonPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetCommonPackageVersion>
<NuGetCommandLineXPlatPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetCommandLineXPlatPackageVersion>

View file

@ -142,6 +142,11 @@ Copyright (c) .NET Foundation. All rights reserved.
<BundledNETCorePlatformsPackageVersion>$(_NETCorePlatformsPackageVersion)</BundledNETCorePlatformsPackageVersion>
<NETCoreSdkVersion>$(SdkVersion)</NETCoreSdkVersion>
<_NETCoreSdkIsPreview>$(_NETCoreSdkIsPreview)</_NETCoreSdkIsPreview>
<!-- Latest patch versions for each minor version of .NET Core -->
<LatestPatchVersionForNetCore1_0 Condition="'$(LatestPatchVersionForNetCore1_0)' == ''">1.0.10</LatestPatchVersionForNetCore1_0>
<LatestPatchVersionForNetCore1_1 Condition="'$(LatestPatchVersionForNetCore1_1)' == ''">1.1.7</LatestPatchVersionForNetCore1_1>
<LatestPatchVersionForNetCore2_0 Condition="'$(LatestPatchVersionForNetCore2_0)' == ''">2.0.6</LatestPatchVersionForNetCore2_0>
</PropertyGroup>
</Project>
]]>

View file

@ -5,6 +5,8 @@ using System;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using System.Collections;
using System.Collections.Generic;
namespace Microsoft.DotNet.Scripts
{
@ -38,9 +40,7 @@ namespace Microsoft.DotNet.Scripts
private Lazy<string> _password = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_PASSWORD"));
private Lazy<string> _dotNetVersionUrl = new Lazy<string>(() => GetEnvironmentVariable("DOTNET_VERSION_URL", "https://raw.githubusercontent.com/dotnet/versions/master/build-info"));
private Lazy<string> _coreSetupVersionFragment = new Lazy<string>(() => GetEnvironmentVariable("CORESETUP_VERSION_FRAGMENT", GetDefaultCoreSetupVersionFragment()));
private Lazy<string> _roslynVersionFragment = new Lazy<string>(() => GetEnvironmentVariable("ROSLYN_VERSION_FRAGMENT"));
private Lazy<string> _gitHubUpstreamOwner = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_UPSTREAM_OWNER", "dotnet"));
private Lazy<string> _gitHubProject = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_PROJECT", "cli"));
private Lazy<string> _gitHubUpstreamBranch = new Lazy<string>(() => GetEnvironmentVariable("GITHUB_UPSTREAM_BRANCH", GetDefaultUpstreamBranch()));
@ -48,6 +48,9 @@ namespace Microsoft.DotNet.Scripts
GetEnvironmentVariable("GITHUB_PULL_REQUEST_NOTIFICATIONS", "")
.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries));
Lazy<Dictionary<string, string>> _versionFragments = new Lazy<Dictionary<string, string>>(() =>
System.Environment.GetEnvironmentVariables().Cast<DictionaryEntry>().Where(entry => ((string)entry.Key).EndsWith("_VERSION_FRAGMENT")).ToDictionary<DictionaryEntry, string, string>(entry =>
((string)entry.Key).Replace("_VERSION_FRAGMENT","").ToLowerInvariant(), entry => (string)entry.Value, StringComparer.OrdinalIgnoreCase));
private Config()
{
}
@ -56,9 +59,8 @@ namespace Microsoft.DotNet.Scripts
public string Email => _email.Value;
public string Password => _password.Value;
public string DotNetVersionUrl => _dotNetVersionUrl.Value;
public string CoreSetupVersionFragment => _coreSetupVersionFragment.Value;
public string RoslynVersionFragment => _roslynVersionFragment.Value;
public bool HasRoslynVersionFragment => !string.IsNullOrEmpty(RoslynVersionFragment);
public Dictionary<string, string> VersionFragments => _versionFragments.Value;
public bool HasVersionFragment(string repoName) => _versionFragments.Value.ContainsKey(repoName);
public string GitHubUpstreamOwner => _gitHubUpstreamOwner.Value;
public string GitHubProject => _gitHubProject.Value;
public string GitHubUpstreamBranch => _gitHubUpstreamBranch.Value;

View file

@ -24,15 +24,8 @@ namespace Microsoft.DotNet.Scripts
bool onlyUpdate = args.Length > 0 && string.Equals("--Update", args[0], StringComparison.OrdinalIgnoreCase);
List<BuildInfo> buildInfos = new List<BuildInfo>();
buildInfos.Add(GetBuildInfo("CoreSetup", s_config.CoreSetupVersionFragment, fetchLatestReleaseFile: false));
if (s_config.HasRoslynVersionFragment)
{
buildInfos.Add(GetBuildInfo("Roslyn", s_config.RoslynVersionFragment, fetchLatestReleaseFile: false));
}
List<BuildInfo> buildInfos = new List<BuildInfo>(s_config.VersionFragments.Select<KeyValuePair<string, string>, BuildInfo>(fragment =>
GetBuildInfo(fragment.Key, fragment.Value, fetchLatestReleaseFile: false)));
IEnumerable<IDependencyUpdater> updaters = GetUpdaters();
var dependencyBuildInfos = buildInfos.Select(buildInfo =>
new BuildDependencyInfo(
@ -90,14 +83,55 @@ namespace Microsoft.DotNet.Scripts
private static IEnumerable<IDependencyUpdater> GetUpdaters()
{
string dependencyVersionsPath = Path.Combine("build", "DependencyVersions.props");
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftNETCoreAppPackageVersion", "Microsoft.NETCore.App");
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetPlatformAbstractionsPackageVersion", "Microsoft.DotNet.PlatformAbstractions");
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftExtensionsDependencyModelPackageVersion", "Microsoft.Extensions.DependencyModel");
if (s_config.HasRoslynVersionFragment)
if (s_config.HasVersionFragment("aspnet"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftAspNetCoreAppPackageVersion", "Microsoft.AspNetCore.App");
}
if (s_config.HasVersionFragment("clicommandlineparser"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetCliCommandLinePackageVersion", "Microsoft.DotNet.Cli.CommandLine");
}
if (s_config.HasVersionFragment("climigrate"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetProjectJsonMigrationPackageVersion", "Microsoft.DotNet.ProjectJsonMigration");
}
if (s_config.HasVersionFragment("coresetup"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftNETCoreAppPackageVersion", "Microsoft.NETCore.App");
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetPlatformAbstractionsPackageVersion", "Microsoft.DotNet.PlatformAbstractions");
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftExtensionsDependencyModelPackageVersion", "Microsoft.Extensions.DependencyModel");
}
if (s_config.HasVersionFragment("fsharp"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftFSharpCompilerPackageVersion", "Microsoft.FSharp.Compiler");
}
if (s_config.HasVersionFragment("msbuild"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftBuildPackageVersion", "Microsoft.Build");
}
if (s_config.HasVersionFragment("nugetclient"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "NuGetBuildTasksPackageVersion", "NuGet.Build.Tasks");
}
if (s_config.HasVersionFragment("roslyn"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftCodeAnalysisCSharpPackageVersion", "Microsoft.CodeAnalysis.CSharp");
}
if (s_config.HasVersionFragment("sdk"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftNETSdkPackageVersion", "Microsoft.NET.Sdk");
}
if (s_config.HasVersionFragment("templating"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetCommonItemTemplatesPackageVersion", "Microsoft.DotNet.Common.ItemTemplates");
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftDotNetTestProjectTemplates20PackageVersion", "Microsoft.DotNet.Test.ProjectTemplates.2.0");
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftTemplateEngineCliPackageVersion", "Microsoft.TemplateEngine.Cli");
}
if (s_config.HasVersionFragment("websdk"))
{
yield return CreateRegexUpdater(dependencyVersionsPath, "MicrosoftNETSdkWebPackageVersion", "Microsoft.NET.Sdk.Web");
}
}
private static IDependencyUpdater CreateRegexUpdater(string repoRelativePath, string propertyName, string packageId)

View file

@ -114,7 +114,7 @@ namespace Microsoft.DotNet.Cli.Utils
{
_projectRoot = msBuildExePath;
var globalProperties = new Dictionary<string, string>()
var globalProperties = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
{ "MSBuildExtensionsPath", Path.GetDirectoryName(msBuildExePath) }
};

View file

@ -399,6 +399,9 @@ namespace Microsoft.DotNet.Cli.Utils
Path.Combine(AppContext.BaseDirectory, "MSBuild.dll") :
msBuildExePath;
Reporter.Verbose.WriteLine(string.Format(LocalizableStrings.MSBuildArgs,
ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(args)));
var result = new MSBuildForwardingAppWithoutLogging(args, msBuildExePath)
.GetProcessStartInfo()
.ExecuteAndCaptureOutput(out string stdOut, out string stdErr);

View file

@ -0,0 +1,152 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
using System.Text;
namespace Microsoft.DotNet.Cli.Utils
{
/// <summary>
/// Embeds the App Name into the AppHost.exe
/// </summary>
public static class EmbedAppNameInHost
{
private static string _placeHolder = "c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2"; //hash value embedded in default apphost executable
private static byte[] _bytesToSearch = Encoding.UTF8.GetBytes(_placeHolder);
/// <summary>
/// Create an AppHost with embedded configuration of app binary location
/// </summary>
/// <param name="appHostSourceFilePath">The path of AppHost template, which has the place holder</param>
/// <param name="appHostDestinationFilePath">The destination path for desired location to place, including the file name</param>
/// <param name="appBinaryFilePath">Full path to app binary or relative path to appHostDestinationFilePath</param>
public static void EmbedAndReturnModifiedAppHostPath(
string appHostSourceFilePath,
string appHostDestinationFilePath,
string appBinaryFilePath)
{
var hostExtension = Path.GetExtension(appHostSourceFilePath);
var appbaseName = Path.GetFileNameWithoutExtension(appBinaryFilePath);
var bytesToWrite = Encoding.UTF8.GetBytes(appBinaryFilePath);
var destinationDirectory = new FileInfo(appHostDestinationFilePath).Directory.FullName;
if (File.Exists(appHostDestinationFilePath))
{
//We have already done the required modification to apphost.exe
return;
}
if (bytesToWrite.Length > 1024)
{
throw new EmbedAppNameInHostException(string.Format(LocalizableStrings.EmbedAppNameInHostFileNameIsTooLong, appBinaryFilePath));
}
var array = File.ReadAllBytes(appHostSourceFilePath);
SearchAndReplace(array, _bytesToSearch, bytesToWrite, appHostSourceFilePath);
if (!Directory.Exists(destinationDirectory))
{
Directory.CreateDirectory(destinationDirectory);
}
// Copy AppHostSourcePath to ModifiedAppHostPath so it inherits the same attributes\permissions.
File.Copy(appHostSourceFilePath, appHostDestinationFilePath);
// Re-write ModifiedAppHostPath with the proper contents.
using (FileStream fs = new FileStream(appHostDestinationFilePath, FileMode.Truncate, FileAccess.ReadWrite, FileShare.Read))
{
fs.Write(array, 0, array.Length);
}
}
// See: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm
private static int[] ComputeKMPFailureFunction(byte[] pattern)
{
int[] table = new int[pattern.Length];
if (pattern.Length >= 1)
{
table[0] = -1;
}
if (pattern.Length >= 2)
{
table[1] = 0;
}
int pos = 2;
int cnd = 0;
while (pos < pattern.Length)
{
if (pattern[pos - 1] == pattern[cnd])
{
table[pos] = cnd + 1;
cnd++;
pos++;
}
else if (cnd > 0)
{
cnd = table[cnd];
}
else
{
table[pos] = 0;
pos++;
}
}
return table;
}
// See: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm
private static int KMPSearch(byte[] pattern, byte[] bytes)
{
int m = 0;
int i = 0;
int[] table = ComputeKMPFailureFunction(pattern);
while (m + i < bytes.Length)
{
if (pattern[i] == bytes[m + i])
{
if (i == pattern.Length - 1)
{
return m;
}
i++;
}
else
{
if (table[i] > -1)
{
m = m + i - table[i];
i = table[i];
}
else
{
m++;
i = 0;
}
}
}
return -1;
}
private static void SearchAndReplace(byte[] array, byte[] searchPattern, byte[] patternToReplace, string appHostSourcePath)
{
int offset = KMPSearch(searchPattern, array);
if (offset < 0)
{
throw new EmbedAppNameInHostException(string.Format(LocalizableStrings.EmbedAppNameInHostAppHostHasBeenModified, appHostSourcePath, _placeHolder));
}
patternToReplace.CopyTo(array, offset);
if (patternToReplace.Length < searchPattern.Length)
{
for (int i = patternToReplace.Length; i < searchPattern.Length; i++)
{
array[i + offset] = 0x0;
}
}
}
}
}

View file

@ -0,0 +1,22 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace Microsoft.DotNet.Cli.Utils
{
public class EmbedAppNameInHostException : Exception
{
public EmbedAppNameInHostException()
{
}
public EmbedAppNameInHostException(string message) : base(message)
{
}
public EmbedAppNameInHostException(string message, Exception innerException) : base(message, innerException)
{
}
}
}

View file

@ -47,6 +47,7 @@ namespace Microsoft.DotNet.Cli.Utils
.GetEnvironmentVariable("PATH")
.Split(s_pathSeparator)
.Select(p => p.Trim(s_quote))
.Where(p => !string.IsNullOrWhiteSpace(p))
.Select(p => ExpandTildeSlash(p)));
_searchPaths = searchPaths;
@ -141,5 +142,14 @@ namespace Microsoft.DotNet.Cli.Utils
}
}
public string GetEnvironmentVariable(string variable, EnvironmentVariableTarget target)
{
return Environment.GetEnvironmentVariable(variable, target);
}
public void SetEnvironmentVariable(string variable, string value, EnvironmentVariableTarget target)
{
Environment.SetEnvironmentVariable(variable, value, target);
}
}
}

View file

@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.DotNet.PlatformAbstractions;
@ -45,6 +46,78 @@ namespace Microsoft.DotNet.Cli.Utils
?.Version;
}
public bool TryGetMostFitRuntimeIdentifier(
string alternativeCurrentRuntimeIdentifier,
string[] candidateRuntimeIdentifiers,
out string mostFitRuntimeIdentifier)
{
return TryGetMostFitRuntimeIdentifier(
RuntimeEnvironment.GetRuntimeIdentifier(),
alternativeCurrentRuntimeIdentifier,
DependencyContext.RuntimeGraph,
candidateRuntimeIdentifiers,
out mostFitRuntimeIdentifier);
}
internal static bool TryGetMostFitRuntimeIdentifier(
string currentRuntimeIdentifier,
string alternativeCurrentRuntimeIdentifier,
IReadOnlyList<RuntimeFallbacks> runtimeGraph,
string[] candidateRuntimeIdentifiers,
out string mostFitRuntimeIdentifier)
{
mostFitRuntimeIdentifier = null;
RuntimeFallbacks[] runtimeFallbacksCandidates;
if (!string.IsNullOrEmpty(currentRuntimeIdentifier))
{
runtimeFallbacksCandidates =
runtimeGraph
.Where(g => string.Equals(g.Runtime, currentRuntimeIdentifier, StringComparison.OrdinalIgnoreCase))
.ToArray();
}
else
{
runtimeFallbacksCandidates = Array.Empty<RuntimeFallbacks>();
}
if (runtimeFallbacksCandidates.Length == 0 && !string.IsNullOrEmpty(alternativeCurrentRuntimeIdentifier))
{
runtimeFallbacksCandidates =
runtimeGraph
.Where(g => string.Equals(g.Runtime, alternativeCurrentRuntimeIdentifier, StringComparison.OrdinalIgnoreCase))
.ToArray();
}
if (runtimeFallbacksCandidates.Length == 0)
{
return false;
}
RuntimeFallbacks runtimeFallbacks = runtimeFallbacksCandidates[0];
var runtimeFallbacksIncludesRuntime = new List<string>();
runtimeFallbacksIncludesRuntime.Add(runtimeFallbacks.Runtime);
runtimeFallbacksIncludesRuntime.AddRange(runtimeFallbacks.Fallbacks);
var candidateMap = candidateRuntimeIdentifiers
.Distinct(comparer: StringComparer.OrdinalIgnoreCase)
.ToDictionary(x => x, StringComparer.OrdinalIgnoreCase);
foreach (var fallback in runtimeFallbacksIncludesRuntime)
{
if (candidateMap.TryGetValue(fallback, out string match))
{
mostFitRuntimeIdentifier = match;
return true;
}
}
return false;
}
private DependencyContext CreateDependencyContext()
{
using (Stream depsFileStream = File.OpenRead(_depsFilePath))

View file

@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
namespace Microsoft.DotNet.Cli.Utils
@ -18,5 +19,9 @@ namespace Microsoft.DotNet.Cli.Utils
bool GetEnvironmentVariableAsBool(string name, bool defaultValue);
string GetEnvironmentVariable(string name);
string GetEnvironmentVariable(string variable, EnvironmentVariableTarget target);
void SetEnvironmentVariable(string variable, string value, EnvironmentVariableTarget target);
}
}

View file

@ -206,7 +206,7 @@
<value>Generating deps.json at: {0}</value>
</data>
<data name="UnableToGenerateDepsJson" xml:space="preserve">
<value>unable to generate deps.json, it may have been already generated: {0}</value>
<value>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</value>
</data>
<data name="DepsJsonGeneratorProjectNotSet" xml:space="preserve">
<value>Unable to find deps.json generator project.</value>
@ -262,4 +262,13 @@
<data name="UnableToInvokeMemberNameAfterCommand" xml:space="preserve">
<value>Unable to invoke {0} after the command has been run</value>
</data>
</root>
<data name="MSBuildArgs" xml:space="preserve">
<value>MSBuild arguments: {0}</value>
</data>
<data name="EmbedAppNameInHostAppHostHasBeenModified" xml:space="preserve">
<value>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</value>
</data>
<data name="EmbedAppNameInHostFileNameIsTooLong" xml:space="preserve">
<value>Given file name '{0}' is longer than 1024 bytes</value>
</data>
</root>

View file

@ -29,7 +29,6 @@
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETStandard' ">
<PackageReference Include="NETStandard.Library" Version="2.0.0" />
<PackageReference Include="System.Diagnostics.Process" Version="4.1.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">Soubor deps.json se nepodařilo vygenerovat, protože už je pravděpodobně vygenerovaný: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">Soubor deps.json se nepodařilo vygenerovat, protože už je pravděpodobně vygenerovaný: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">Běhové prostředí:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">"deps.json" kann nicht erzeugt werden; sie wurde vielleicht bereits erzeugt: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">"deps.json" kann nicht erzeugt werden; sie wurde vielleicht bereits erzeugt: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">Laufzeitumgebung:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">no se puede generar deps.json; es posible que ya se haya generado: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">no se puede generar deps.json; es posible que ya se haya generado: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">Entorno de tiempo de ejecución:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">impossible de générer deps.json, il a peut-être été déjà généré : {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">impossible de générer deps.json, il a peut-être été déjà généré : {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">Environnement d'exécution :</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">non è possibile generare deps.json. Potrebbe essere già stato generato: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">non è possibile generare deps.json. Potrebbe essere già stato generato: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">Ambiente di runtime:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">deps.json を生成できません。既に生成されている可能性があります: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">deps.json を生成できません。既に生成されている可能性があります: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">ランタイム環境:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">deps.json을 생성할 수 없습니다. 이미 생성되었을 수 있습니다. {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">deps.json을 생성할 수 없습니다. 이미 생성되었을 수 있습니다. {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">런타임 환경:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">nie można wygenerować pliku deps.json, być może został już wygenerowany: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">nie można wygenerować pliku deps.json, być może został już wygenerowany: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">Środowisko uruchomieniowe:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">não é possível gerar deps.json; ele pode já ter sido gerado: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">não é possível gerar deps.json; ele pode já ter sido gerado: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">Ambiente de tempo de execução:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">не удается создать deps.json, возможно, он уже создан: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">не удается создать deps.json, возможно, он уже создан: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">Среда выполнения:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">deps.json oluşturulamadı, zaten oluşturulmuş olabilir: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">deps.json oluşturulamadı, zaten oluşturulmuş olabilir: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">Çalışma Zamanı Ortamı:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">无法生成 deps.json该文件可能已生成: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">无法生成 deps.json该文件可能已生成: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">运行时环境:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -140,8 +140,8 @@
<note />
</trans-unit>
<trans-unit id="UnableToGenerateDepsJson">
<source>unable to generate deps.json, it may have been already generated: {0}</source>
<target state="translated">無法產生 deps.json可能已產生過: {0}</target>
<source>Unable to generate deps.json, it may have been already generated. You can specify the "-d" option before the tool name for diagnostic output (for example, "dotnet -d &lt;toolname&gt;": {0}</source>
<target state="needs-review-translation">無法產生 deps.json可能已產生過: {0}</target>
<note />
</trans-unit>
<trans-unit id="UnableToDeleteTemporaryDepsJson">
@ -244,6 +244,21 @@
<target state="translated">執行階段環境:</target>
<note />
</trans-unit>
<trans-unit id="MSBuildArgs">
<source>MSBuild arguments: {0}</source>
<target state="new">MSBuild arguments: {0}</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostAppHostHasBeenModified">
<source>Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</source>
<target state="new">Unable to use '{0}' as application host executable as it does not contain the expected placeholder byte sequence '{1}' that would mark where the application name would be written.</target>
<note />
</trans-unit>
<trans-unit id="EmbedAppNameInHostFileNameIsTooLong">
<source>Given file name '{0}' is longer than 1024 bytes</source>
<target state="new">Given file name '{0}' is longer than 1024 bytes</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -18,6 +18,7 @@ namespace Microsoft.DotNet.Configurer
private IFirstTimeUseNoticeSentinel _firstTimeUseNoticeSentinel;
private IAspNetCertificateSentinel _aspNetCertificateSentinel;
private IAspNetCoreCertificateGenerator _aspNetCoreCertificateGenerator;
private IFileSentinel _toolPathSentinel;
private string _cliFallbackFolderPath;
private readonly IEnvironmentPath _pathAdder;
@ -27,6 +28,7 @@ namespace Microsoft.DotNet.Configurer
IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
IAspNetCertificateSentinel aspNetCertificateSentinel,
IAspNetCoreCertificateGenerator aspNetCoreCertificateGenerator,
IFileSentinel toolPathSentinel,
IEnvironmentProvider environmentProvider,
IReporter reporter,
string cliFallbackFolderPath,
@ -37,6 +39,7 @@ namespace Microsoft.DotNet.Configurer
_firstTimeUseNoticeSentinel = firstTimeUseNoticeSentinel;
_aspNetCertificateSentinel = aspNetCertificateSentinel;
_aspNetCoreCertificateGenerator = aspNetCoreCertificateGenerator;
_toolPathSentinel = toolPathSentinel;
_environmentProvider = environmentProvider;
_reporter = reporter;
_cliFallbackFolderPath = cliFallbackFolderPath;
@ -45,7 +48,10 @@ namespace Microsoft.DotNet.Configurer
public void Configure()
{
AddPackageExecutablePath();
if (ShouldAddPackageExecutablePath())
{
AddPackageExecutablePath();
}
if (ShouldPrintFirstTimeUseNotice())
{
@ -66,7 +72,7 @@ namespace Microsoft.DotNet.Configurer
}
}
if(ShouldGenerateAspNetCertificate())
if (ShouldGenerateAspNetCertificate())
{
GenerateAspNetCertificate();
}
@ -92,21 +98,16 @@ namespace Microsoft.DotNet.Configurer
!_aspNetCertificateSentinel.Exists();
}
private bool ShouldAddPackageExecutablePath()
{
return ShouldRunFirstRunExperience() && !_toolPathSentinel.Exists();
}
private void AddPackageExecutablePath()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
if (!_firstTimeUseNoticeSentinel.Exists())
{
// Invoke when Windows first run
_pathAdder.AddPackageExecutablePathToUserPath();
}
}
else
{
// Invoke during installer, otherwise, _pathAdder will be no op object that this point
_pathAdder.AddPackageExecutablePathToUserPath();
}
_pathAdder.AddPackageExecutablePathToUserPath();
_toolPathSentinel.Create();
}
private bool ShouldPrintFirstTimeUseNotice()

View file

@ -0,0 +1,46 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
using Microsoft.Extensions.EnvironmentAbstractions;
namespace Microsoft.DotNet.Configurer
{
public class FileSentinel : IFileSentinel
{
private readonly FilePath _file;
private readonly IFileSystem _fileSystem;
public FileSentinel(FilePath file) :
this(file, fileSystem: null)
{
}
internal FileSentinel(FilePath file, IFileSystem fileSystem)
{
_file = file;
_fileSystem = fileSystem ?? FileSystemWrapper.Default;
}
public bool Exists()
{
return _fileSystem.File.Exists(_file.Value);
}
public void Create()
{
if (Exists())
{
return;
}
var directory = _file.GetDirectoryPath();
if (!_fileSystem.Directory.Exists(directory.Value))
{
_fileSystem.Directory.CreateDirectory(directory.Value);
}
_fileSystem.File.CreateEmptyFile(_file.Value);
}
}
}

View file

@ -0,0 +1,14 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace Microsoft.DotNet.Configurer
{
public interface IFileSentinel
{
bool Exists();
void Create();
}
}

View file

@ -151,7 +151,7 @@ Here are some options to fix this error:
<value>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</value>
</data>
</root>
</root>

View file

@ -0,0 +1,19 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.IO;
namespace Microsoft.DotNet.Configurer
{
public class NoOpFileSentinel : IFileSentinel
{
public bool Exists()
{
return true;
}
public void Create()
{
}
}
}

View file

@ -62,7 +62,7 @@ Tuto chybu můžete opravit pomocí některé z těchto možností:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Im Folgenden finden Sie einige Optionen, um diesen Fehler zu beheben:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -61,7 +61,7 @@ Estas son algunas opciones para corregir este error:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Voici quelques options pour corriger cette erreur :
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Ecco alcune opzioni per correggere questo errore:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Here are some options to fix this error:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Here are some options to fix this error:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Oto kilka opcji naprawiania tego błędu:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Aqui estão algumas opções para corrigir este erro:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Here are some options to fix this error:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Bu hatayı düzeltmek için bazı seçenekler:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Here are some options to fix this error:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -62,7 +62,7 @@ Here are some options to fix this error:
<source>ASP.NET Core
------------
Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate (Windows and macOS only) first install the dev-certs tool by running 'dotnet tool install dotnet-dev-certs -g --version 2.1.0-preview1-final' and then run 'dotnet-dev-certs https --trust'.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.</source>
<target state="needs-review-translation">ASP.NET Core
------------

View file

@ -19,6 +19,11 @@ namespace Microsoft.Extensions.EnvironmentAbstractions
return new TemporaryDirectory();
}
public IEnumerable<string> EnumerateFiles(string path, string searchPattern)
{
return Directory.EnumerateFiles(path, searchPattern);
}
public IEnumerable<string> EnumerateFileSystemEntries(string path)
{
return Directory.EnumerateFileSystemEntries(path);

View file

@ -11,6 +11,8 @@ namespace Microsoft.Extensions.EnvironmentAbstractions
ITemporaryDirectory CreateTemporaryDirectory();
IEnumerable<string> EnumerateFiles(string path, string searchPattern);
IEnumerable<string> EnumerateFileSystemEntries(string path);
IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern);

View file

@ -0,0 +1,15 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Threading.Tasks;
namespace Microsoft.DotNet.BuildServer
{
internal interface IBuildServerManager
{
string ServerName { get; }
Task<Result> ShutdownServerAsync();
}
}

View file

@ -0,0 +1,14 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using Microsoft.Extensions.EnvironmentAbstractions;
namespace Microsoft.DotNet.BuildServer
{
internal interface IRazorAssemblyResolver
{
IEnumerable<FilePath> EnumerateRazorToolAssemblies();
}
}

View file

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="MSBuildServer" xml:space="preserve">
<value>MSBuild server</value>
</data>
<data name="VBCSCompilerServer" xml:space="preserve">
<value>VB/C# compiler server</value>
</data>
<data name="RazorServer" xml:space="preserve">
<value>Razor build server</value>
</data>
<data name="NoRazorProjectFound" xml:space="preserve">
<value>a Razor project was not found in the current directory.</value>
</data>
</root>

View file

@ -0,0 +1,29 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Threading.Tasks;
using Microsoft.Build.Execution;
namespace Microsoft.DotNet.BuildServer
{
internal class MSBuildServerManager : IBuildServerManager
{
public string ServerName => LocalizableStrings.MSBuildServer;
public Task<Result> ShutdownServerAsync()
{
return Task.Run(() => {
try
{
BuildManager.DefaultBuildManager.ShutdownAllNodes();
return new Result(ResultKind.Success);
}
catch (Exception ex)
{
return new Result(ex);
}
});
}
}
}

View file

@ -0,0 +1,52 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.Build.Execution;
using Microsoft.Extensions.EnvironmentAbstractions;
namespace Microsoft.DotNet.BuildServer
{
internal class RazorAssemblyResolver : IRazorAssemblyResolver
{
private readonly IDirectory _directory;
public RazorAssemblyResolver(IDirectory directory = null)
{
_directory = directory ?? FileSystemWrapper.Default.Directory;
}
public IEnumerable<FilePath> EnumerateRazorToolAssemblies()
{
HashSet<string> seen = new HashSet<string>();
var globalProperties = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
// This property disables default item globbing to improve performance
// This should be safe because we are not evaluating items, only properties
{ Constants.EnableDefaultItems, "false" }
};
foreach (var projectFile in _directory.EnumerateFiles(Directory.GetCurrentDirectory(), "*.*proj"))
{
var project = new ProjectInstance(projectFile, globalProperties, null);
var path = project.GetPropertyValue("_RazorToolAssembly");
if (string.IsNullOrEmpty(path))
{
continue;
}
if (!seen.Add(path))
{
continue;
}
yield return new FilePath(path);
}
}
}
}

View file

@ -0,0 +1,65 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Build.Exceptions;
using Microsoft.DotNet.Cli;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools;
using Microsoft.Extensions.EnvironmentAbstractions;
namespace Microsoft.DotNet.BuildServer
{
internal class RazorServerManager : IBuildServerManager
{
private readonly IRazorAssemblyResolver _resolver;
private readonly ICommandFactory _commandFactory;
public RazorServerManager(IRazorAssemblyResolver resolver = null, ICommandFactory commandFactory = null)
{
_resolver = resolver ?? new RazorAssemblyResolver();
_commandFactory = commandFactory ?? new DotNetCommandFactory(alwaysRunOutOfProc: true);
}
public string ServerName => LocalizableStrings.RazorServer;
public Task<Result> ShutdownServerAsync()
{
return Task.Run(() => {
try
{
bool haveRazorAssembly = false;
foreach (var toolAssembly in _resolver.EnumerateRazorToolAssemblies())
{
haveRazorAssembly = true;
var command = _commandFactory
.Create("exec", new string[] { toolAssembly.Value, "shutdown" })
.CaptureStdOut()
.CaptureStdErr();
var result = command.Execute();
if (result.ExitCode != 0)
{
return new Result(ResultKind.Failure, result.StdErr);
}
}
if (!haveRazorAssembly)
{
return new Result(ResultKind.Skipped, LocalizableStrings.NoRazorProjectFound);
}
return new Result(ResultKind.Success);
}
catch (InvalidProjectFileException ex)
{
return new Result(ex);
}
});
}
}
}

View file

@ -0,0 +1,37 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
namespace Microsoft.DotNet.BuildServer
{
internal enum ResultKind
{
Success,
Failure,
Skipped
}
internal struct Result
{
public Result(ResultKind kind, string message = null)
{
Kind = kind;
Message = message;
Exception = null;
}
public Result(Exception exception)
{
Kind = ResultKind.Failure;
Message = exception.Message;
Exception = exception;
}
public ResultKind Kind { get; private set; }
public string Message { get; private set; }
public Exception Exception { get; private set; }
}
}

View file

@ -0,0 +1,48 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.DotNet.Cli;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.BuildServer
{
internal class VBCSCompilerServerManager : IBuildServerManager
{
internal static readonly string VBCSCompilerPath = Path.Combine(
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
"Roslyn",
"bincore",
"VBCSCompiler.dll");
private readonly ICommandFactory _commandFactory;
public VBCSCompilerServerManager(ICommandFactory commandFactory = null)
{
_commandFactory = commandFactory ?? new DotNetCommandFactory(alwaysRunOutOfProc: true);
}
public string ServerName => LocalizableStrings.VBCSCompilerServer;
public Task<Result> ShutdownServerAsync()
{
return Task.Run(() => {
var command = _commandFactory
.Create("exec", new[] { VBCSCompilerPath, "-shutdown" })
.CaptureStdOut()
.CaptureStdErr();
var result = command.Execute();
if (result.ExitCode != 0)
{
return new Result(ResultKind.Failure, result.StdErr);
}
return new Result(ResultKind.Success);
});
}
}
}

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="de" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="es" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="fr" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="it" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ja" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ko" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pl" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pt-BR" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ru" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="tr" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hant" original="../LocalizableStrings.resx">
<body>
<trans-unit id="MSBuildServer">
<source>MSBuild server</source>
<target state="new">MSBuild server</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerServer">
<source>VB/C# compiler server</source>
<target state="new">VB/C# compiler server</target>
<note />
</trans-unit>
<trans-unit id="RazorServer">
<source>Razor build server</source>
<target state="new">Razor build server</target>
<note />
</trans-unit>
<trans-unit id="NoRazorProjectFound">
<source>a Razor project was not found in the current directory.</source>
<target state="new">a Razor project was not found in the current directory.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -3,6 +3,7 @@
using Microsoft.DotNet.Tools.Add;
using Microsoft.DotNet.Tools.Build;
using Microsoft.DotNet.Tools.BuildServer;
using Microsoft.DotNet.Tools.Clean;
using Microsoft.DotNet.Tools.Help;
using Microsoft.DotNet.Tools.List;
@ -149,6 +150,10 @@ namespace Microsoft.DotNet.Cli
{
Command = ToolCommand.Run
},
["buildserver"] = new BuiltInCommandMetadata
{
Command = BuildServerCommand.Run
},
["internal-reportinstallsuccess"] = new BuiltInCommandMetadata
{
Command = InternalReportinstallsuccess.Run

View file

@ -595,6 +595,9 @@ setx PATH "%PATH%;{0}"
<data name="EnvironmentPathWindowsNeedReopen" xml:space="preserve">
<value>Since you just installed the .NET Core SDK, you will need to reopen the Command Prompt window before running the tool you installed.</value>
</data>
<data name="FailedToSetToolsPathEnvironmentVariable" xml:space="preserve">
<value>Failed to add '{0}' to the PATH environment variable. Please add this directory to your PATH to use tools installed with 'dotnet tool install'.</value>
</data>
<data name="FailedToCreateShellShim" xml:space="preserve">
<value>Failed to create tool shim for command '{0}': {1}</value>
</data>

View file

@ -56,6 +56,7 @@ namespace Microsoft.DotNet.Cli
CompleteCommandParser.Complete(),
InternalReportinstallsuccessCommandParser.InternalReportinstallsuccess(),
ToolCommandParser.Tool(),
BuildServerCommandParser.CreateCommand(),
CommonOptions.HelpOption(),
Create.Option("--info", ""),
Create.Option("-d", ""),

View file

@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
@ -23,6 +24,8 @@ namespace Microsoft.DotNet.Cli
{
public class Program
{
private static readonly string ToolPathSentinelFileName = $"{Product.Version}.toolpath.sentinel";
public static int Main(string[] args)
{
DebugHelper.HandleDebugSwitch(ref args);
@ -94,6 +97,12 @@ namespace Microsoft.DotNet.Cli
{
IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel = disposableFirstTimeUseNoticeSentinel;
IAspNetCertificateSentinel aspNetCertificateSentinel = new AspNetCertificateSentinel(cliFallbackFolderPathCalculator);
IFileSentinel toolPathSentinel = new FileSentinel(
new FilePath(
Path.Combine(
CliFolderPathCalculator.DotnetUserProfileFolderPath,
ToolPathSentinelFileName)));
for (; lastArg < args.Length; lastArg++)
{
if (IsArg(args[lastArg], "d", "diagnostics"))
@ -138,6 +147,7 @@ namespace Microsoft.DotNet.Cli
{
aspNetCertificateSentinel = new NoOpAspNetCertificateSentinel();
firstTimeUseNoticeSentinel = new NoOpFirstTimeUseNoticeSentinel();
toolPathSentinel = new NoOpFileSentinel();
hasSuperUserAccess = true;
}
@ -145,6 +155,7 @@ namespace Microsoft.DotNet.Cli
nugetCacheSentinel,
firstTimeUseNoticeSentinel,
aspNetCertificateSentinel,
toolPathSentinel,
cliFallbackFolderPathCalculator,
hasSuperUserAccess);
@ -209,6 +220,7 @@ namespace Microsoft.DotNet.Cli
INuGetCacheSentinel nugetCacheSentinel,
IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel,
IAspNetCertificateSentinel aspNetCertificateSentinel,
IFileSentinel toolPathSentinel,
CliFolderPathCalculator cliFolderPathCalculator,
bool hasSuperUserAccess)
{
@ -231,6 +243,7 @@ namespace Microsoft.DotNet.Cli
firstTimeUseNoticeSentinel,
aspNetCertificateSentinel,
aspnetCertificateGenerator,
toolPathSentinel,
environmentProvider,
Reporter.Output,
cliFolderPathCalculator.CliFallbackFolderPath,

View file

@ -33,14 +33,16 @@ namespace Microsoft.DotNet.ShellShim
{
environmentPath = new WindowsEnvironmentPath(
cliFolderPathCalculator.ToolsShimPath,
Reporter.Output);
Reporter.Output,
environmentProvider);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && hasSuperUserAccess)
{
environmentPath = new LinuxEnvironmentPath(
cliFolderPathCalculator.ToolsShimPathInUnix,
Reporter.Output,
environmentProvider, new FileWrapper());
environmentProvider,
new FileWrapper());
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && hasSuperUserAccess)
{

View file

@ -18,9 +18,9 @@ namespace Microsoft.DotNet.ShellShim
private const string PathName = "PATH";
private readonly BashPathUnderHomeDirectory _packageExecutablePath;
private readonly string _profiledDotnetCliToolsPath
= Environment.GetEnvironmentVariable("DOTNET_CLI_TEST_LINUX_PROFILED_PATH")
?? @"/etc/profile.d/dotnet-cli-tools-bin-path.sh";
internal static readonly string DotnetCliToolsProfilePath =
Environment.GetEnvironmentVariable("DOTNET_CLI_TEST_LINUX_PROFILED_PATH") ??
@"/etc/profile.d/dotnet-cli-tools-bin-path.sh";
internal LinuxEnvironmentPath(
BashPathUnderHomeDirectory packageExecutablePath,
@ -44,28 +44,27 @@ namespace Microsoft.DotNet.ShellShim
}
var script = $"export PATH=\"$PATH:{_packageExecutablePath.PathWithDollar}\"";
_fileSystem.WriteAllText(_profiledDotnetCliToolsPath, script);
_fileSystem.WriteAllText(DotnetCliToolsProfilePath, script);
}
private bool PackageExecutablePathExists()
{
var environmentVariable = _environmentProvider
.GetEnvironmentVariable(PathName);
if (environmentVariable == null)
var value = _environmentProvider.GetEnvironmentVariable(PathName);
if (value == null)
{
return false;
}
return environmentVariable
.Split(':').Contains(_packageExecutablePath.Path);
return value
.Split(':')
.Any(p => p == _packageExecutablePath.Path || p == _packageExecutablePath.PathWithTilde);
}
public void PrintAddPathInstructionIfPathDoesNotExist()
{
if (!PackageExecutablePathExists())
{
if (_fileSystem.Exists(_profiledDotnetCliToolsPath))
if (_fileSystem.Exists(DotnetCliToolsProfilePath))
{
_reporter.WriteLine(
CommonLocalizableStrings.EnvironmentPathLinuxNeedLogout);

View file

@ -18,7 +18,7 @@ namespace Microsoft.DotNet.ShellShim
private readonly IEnvironmentProvider _environmentProvider;
private readonly IReporter _reporter;
private static readonly string PathDDotnetCliToolsPath
internal static readonly string DotnetCliToolsPathsDPath
= Environment.GetEnvironmentVariable("DOTNET_CLI_TEST_OSX_PATHSD_PATH")
?? @"/etc/paths.d/dotnet-cli-tools";
@ -44,28 +44,27 @@ namespace Microsoft.DotNet.ShellShim
return;
}
var script = $"{_packageExecutablePath.PathWithTilde}";
_fileSystem.WriteAllText(PathDDotnetCliToolsPath, script);
_fileSystem.WriteAllText(DotnetCliToolsPathsDPath, _packageExecutablePath.PathWithTilde);
}
private bool PackageExecutablePathExists()
{
var environmentVariable = _environmentProvider.GetEnvironmentVariable(PathName);
if (environmentVariable == null)
var value = _environmentProvider.GetEnvironmentVariable(PathName);
if (value == null)
{
return false;
}
return environmentVariable.Split(':').Contains(_packageExecutablePath.PathWithTilde)
|| environmentVariable.Split(':').Contains(_packageExecutablePath.Path);
return value
.Split(':')
.Any(p => p == _packageExecutablePath.Path || p == _packageExecutablePath.PathWithTilde);
}
public void PrintAddPathInstructionIfPathDoesNotExist()
{
if (!PackageExecutablePathExists())
{
if (_fileSystem.Exists(PathDDotnetCliToolsPath))
if (_fileSystem.Exists(DotnetCliToolsPathsDPath))
{
_reporter.WriteLine(
CommonLocalizableStrings.EnvironmentPathOSXNeedReopen);

View file

@ -6,25 +6,28 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Xml.Linq;
using Microsoft.DotNet.Cli;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.PlatformAbstractions;
using Microsoft.DotNet.Tools;
using Microsoft.DotNet.Tools.Common;
using Microsoft.Extensions.EnvironmentAbstractions;
using Newtonsoft.Json;
namespace Microsoft.DotNet.ShellShim
{
internal class ShellShimRepository : IShellShimRepository
{
private const string LauncherExeResourceName = "Microsoft.DotNet.Tools.Launcher.Executable";
private const string LauncherConfigResourceName = "Microsoft.DotNet.Tools.Launcher.Config";
private const string ApphostNameWithoutExtension = "apphost";
private readonly DirectoryPath _shimsDirectory;
private readonly string _appHostSourceDirectory;
public ShellShimRepository(DirectoryPath shimsDirectory)
public ShellShimRepository(DirectoryPath shimsDirectory, string appHostSourcePath = null)
{
_shimsDirectory = shimsDirectory;
_appHostSourceDirectory = appHostSourcePath ?? Path.Combine(ApplicationEnvironment.ApplicationBasePath,
"AppHostTemplate");
}
public void CreateShim(FilePath targetExecutablePath, string commandName)
@ -47,7 +50,8 @@ namespace Microsoft.DotNet.ShellShim
}
TransactionalAction.Run(
action: () => {
action: () =>
{
try
{
if (!Directory.Exists(_shimsDirectory.Value))
@ -55,29 +59,13 @@ namespace Microsoft.DotNet.ShellShim
Directory.CreateDirectory(_shimsDirectory.Value);
}
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
CreateApphostShim(
commandName,
entryPoint: targetExecutablePath);
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
CreateConfigFile(
outputPath: GetWindowsConfigPath(commandName),
entryPoint: targetExecutablePath,
runner: "dotnet");
using (var shim = File.Create(GetWindowsShimPath(commandName).Value))
using (var resource = typeof(ShellShimRepository).Assembly.GetManifestResourceStream(LauncherExeResourceName))
{
resource.CopyTo(shim);
}
}
else
{
var script = new StringBuilder();
script.AppendLine("#!/bin/sh");
script.AppendLine($"dotnet {targetExecutablePath.ToQuotedString()} \"$@\"");
var shimPath = GetPosixShimPath(commandName);
File.WriteAllText(shimPath.Value, script.ToString());
SetUserExecutionPermission(shimPath);
SetUserExecutionPermission(GetShimPath(commandName));
}
}
catch (Exception ex) when (ex is UnauthorizedAccessException || ex is IOException)
@ -138,18 +126,35 @@ namespace Microsoft.DotNet.ShellShim
});
}
internal void CreateConfigFile(FilePath outputPath, FilePath entryPoint, string runner)
private void CreateApphostShim(string commandName, FilePath entryPoint)
{
XDocument config;
using (var resource = typeof(ShellShimRepository).Assembly.GetManifestResourceStream(LauncherConfigResourceName))
string appHostSourcePath;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
config = XDocument.Load(resource);
appHostSourcePath = Path.Combine(_appHostSourceDirectory, ApphostNameWithoutExtension + ".exe");
}
else
{
appHostSourcePath = Path.Combine(_appHostSourceDirectory, ApphostNameWithoutExtension);
}
var appSettings = config.Descendants("appSettings").First();
appSettings.Add(new XElement("add", new XAttribute("key", "entryPoint"), new XAttribute("value", entryPoint.Value)));
appSettings.Add(new XElement("add", new XAttribute("key", "runner"), new XAttribute("value", runner ?? string.Empty)));
config.Save(outputPath.Value);
var appHostDestinationFilePath = GetShimPath(commandName).Value;
var appBinaryFilePath = PathUtility.GetRelativePath(appHostDestinationFilePath, entryPoint.Value);
EmbedAppNameInHost.EmbedAndReturnModifiedAppHostPath(
appHostSourceFilePath: appHostSourcePath,
appHostDestinationFilePath: appHostDestinationFilePath,
appBinaryFilePath: appBinaryFilePath);
}
private class StartupOptions
{
public string appRoot { get; set; }
}
private class RootObject
{
public StartupOptions startupOptions { get; set; }
}
private bool ShimExists(string commandName)
@ -164,32 +169,21 @@ namespace Microsoft.DotNet.ShellShim
yield break;
}
yield return GetShimPath(commandName);
}
private FilePath GetShimPath(string commandName)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
yield return GetWindowsShimPath(commandName);
yield return GetWindowsConfigPath(commandName);
return new FilePath(_shimsDirectory.WithFile(commandName).Value +".exe");
}
else
{
yield return GetPosixShimPath(commandName);
return _shimsDirectory.WithFile(commandName);
}
}
private FilePath GetPosixShimPath(string commandName)
{
return _shimsDirectory.WithFile(commandName);
}
private FilePath GetWindowsShimPath(string commandName)
{
return new FilePath(_shimsDirectory.WithFile(commandName).Value + ".exe");
}
private FilePath GetWindowsConfigPath(string commandName)
{
return new FilePath(GetWindowsShimPath(commandName).Value + ".config");
}
private static void SetUserExecutionPermission(FilePath path)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))

View file

@ -14,14 +14,13 @@ namespace Microsoft.DotNet.ShellShim
private readonly IReporter _reporter;
private const string PathName = "PATH";
private readonly string _packageExecutablePath;
private readonly IEnvironmentProvider _environmentProvider;
public WindowsEnvironmentPath(
string packageExecutablePath, IReporter reporter)
public WindowsEnvironmentPath(string packageExecutablePath, IReporter reporter, IEnvironmentProvider environmentProvider)
{
_packageExecutablePath
= packageExecutablePath ?? throw new ArgumentNullException(nameof(packageExecutablePath));
_reporter
= reporter ?? throw new ArgumentNullException(nameof(reporter));
_packageExecutablePath = packageExecutablePath ?? throw new ArgumentNullException(nameof(packageExecutablePath));
_reporter = reporter ?? throw new ArgumentNullException(nameof(reporter));
_environmentProvider = environmentProvider ?? throw new ArgumentNullException(nameof(environmentProvider));
}
public void AddPackageExecutablePathToUserPath()
@ -31,12 +30,37 @@ namespace Microsoft.DotNet.ShellShim
return;
}
var existingUserEnvPath = Environment.GetEnvironmentVariable(PathName, EnvironmentVariableTarget.User);
var existingUserEnvPath = _environmentProvider.GetEnvironmentVariable(PathName, EnvironmentVariableTarget.User);
Environment.SetEnvironmentVariable(
PathName,
$"{existingUserEnvPath};{_packageExecutablePath}",
EnvironmentVariableTarget.User);
try
{
if (existingUserEnvPath == null)
{
_environmentProvider.SetEnvironmentVariable(
PathName,
_packageExecutablePath,
EnvironmentVariableTarget.User);
}
else
{
if (existingUserEnvPath.EndsWith(';'))
{
existingUserEnvPath = existingUserEnvPath.Substring(0, (existingUserEnvPath.Length - 1));
}
_environmentProvider.SetEnvironmentVariable(
PathName,
$"{existingUserEnvPath};{_packageExecutablePath}",
EnvironmentVariableTarget.User);
}
}
catch (System.Security.SecurityException)
{
_reporter.WriteLine(
string.Format(
CommonLocalizableStrings.FailedToSetToolsPathEnvironmentVariable,
_packageExecutablePath).Yellow());
}
}
private bool PackageExecutablePathExists()
@ -46,13 +70,13 @@ namespace Microsoft.DotNet.ShellShim
private bool PackageExecutablePathWillExistForFutureNewProcess()
{
return EnvironmentVariableConatinsPackageExecutablePath(Environment.GetEnvironmentVariable(PathName, EnvironmentVariableTarget.User))
|| EnvironmentVariableConatinsPackageExecutablePath(Environment.GetEnvironmentVariable(PathName, EnvironmentVariableTarget.Machine));
return EnvironmentVariableConatinsPackageExecutablePath(_environmentProvider.GetEnvironmentVariable(PathName, EnvironmentVariableTarget.User))
|| EnvironmentVariableConatinsPackageExecutablePath(_environmentProvider.GetEnvironmentVariable(PathName, EnvironmentVariableTarget.Machine));
}
private bool PackageExecutablePathExistsForCurrentProcess()
{
return EnvironmentVariableConatinsPackageExecutablePath(Environment.GetEnvironmentVariable(PathName, EnvironmentVariableTarget.Process));
return EnvironmentVariableConatinsPackageExecutablePath(_environmentProvider.GetEnvironmentVariable(PathName, EnvironmentVariableTarget.Process));
}
private bool EnvironmentVariableConatinsPackageExecutablePath(string environmentVariable)
@ -62,15 +86,16 @@ namespace Microsoft.DotNet.ShellShim
return false;
}
return environmentVariable.Split(';').Contains(_packageExecutablePath);
return environmentVariable
.Split(';')
.Any(p => string.Equals(p, _packageExecutablePath, StringComparison.OrdinalIgnoreCase));
}
public void PrintAddPathInstructionIfPathDoesNotExist()
{
if (!PackageExecutablePathExistsForCurrentProcess() && PackageExecutablePathWillExistForFutureNewProcess())
{
_reporter.WriteLine(
CommonLocalizableStrings.EnvironmentPathWindowsNeedReopen);
_reporter.WriteLine(CommonLocalizableStrings.EnvironmentPathWindowsNeedReopen);
}
else if (!PackageExecutablePathWillExistForFutureNewProcess())
{

View file

@ -0,0 +1,33 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using Microsoft.DotNet.Cli;
using Microsoft.DotNet.Cli.CommandLine;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.BuildServer.Shutdown;
namespace Microsoft.DotNet.Tools.BuildServer
{
public class BuildServerCommand : DotNetTopLevelCommandBase
{
protected override string CommandName => "buildserver";
protected override string FullCommandNameLocalized => LocalizableStrings.BuildServerCommandName;
protected override string ArgumentName => "";
protected override string ArgumentDescriptionLocalized => "";
internal override Dictionary<string, Func<AppliedOption, CommandBase>> SubCommands =>
new Dictionary<string, Func<AppliedOption, CommandBase>>
{
["shutdown"] = appliedOption => new BuildServerShutdownCommand(
appliedOption["shutdown"],
ParseResult),
};
public static int Run(string[] args)
{
return new BuildServerCommand().RunCommand(args);
}
}
}

View file

@ -0,0 +1,21 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.Cli.CommandLine;
using LocalizableStrings = Microsoft.DotNet.Tools.BuildServer.LocalizableStrings;
namespace Microsoft.DotNet.Cli
{
internal static class BuildServerCommandParser
{
public static Command CreateCommand()
{
return Create.Command(
"buildserver",
LocalizableStrings.CommandDescription,
Accept.NoArguments(),
CommonOptions.HelpOption(),
ServerShutdownCommandParser.CreateCommand());
}
}
}

View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="BuildServerCommandName" xml:space="preserve">
<value>.NET Build Server Command</value>
</data>
<data name="CommandDescription" xml:space="preserve">
<value>Interact with servers started from a build.</value>
</data>
</root>

View file

@ -0,0 +1,144 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.DotNet.BuildServer;
using Microsoft.DotNet.Cli;
using Microsoft.DotNet.Cli.CommandLine;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.BuildServer.Shutdown
{
internal class BuildServerShutdownCommand : CommandBase
{
private readonly bool _useOrderedWait;
private readonly IReporter _reporter;
private readonly IReporter _errorReporter;
public BuildServerShutdownCommand(
AppliedOption options,
ParseResult result,
IEnumerable<IBuildServerManager> managers = null,
bool useOrderedWait = false,
IReporter reporter = null)
: base(result)
{
if (managers == null)
{
bool msbuild = options.ValueOrDefault<bool>("msbuild");
bool vbcscompiler = options.ValueOrDefault<bool>("vbcscompiler");
bool razor = options.ValueOrDefault<bool>("razor");
bool all = !msbuild && !vbcscompiler && !razor;
var enabledManagers = new List<IBuildServerManager>();
if (msbuild || all)
{
enabledManagers.Add(new MSBuildServerManager());
}
if (vbcscompiler || all)
{
enabledManagers.Add(new VBCSCompilerServerManager());
}
if (razor || all)
{
enabledManagers.Add(new RazorServerManager());
}
managers = enabledManagers;
}
Managers = managers;
_useOrderedWait = useOrderedWait;
_reporter = reporter ?? Reporter.Output;
_errorReporter = reporter ?? Reporter.Error;
}
public IEnumerable<IBuildServerManager> Managers { get; }
public override int Execute()
{
bool success = true;
var tasks = StartShutdown();
while (tasks.Count > 0)
{
var index = WaitForResult(tasks.Select(t => t.Item2).ToArray());
var (manager, task) = tasks[index];
success &= HandleResult(manager, task.Result);
tasks.RemoveAt(index);
}
return success ? 0 : 1;
}
private List<(IBuildServerManager, Task<Result>)> StartShutdown()
{
var tasks = new List<(IBuildServerManager, Task<Result>)>();
foreach (var manager in Managers)
{
_reporter.WriteLine(string.Format(LocalizableStrings.ShuttingDownServer, manager.ServerName));
tasks.Add((manager, manager.ShutdownServerAsync()));
}
return tasks;
}
private int WaitForResult(Task[] tasks)
{
if (_useOrderedWait)
{
tasks[0].Wait();
return 0;
}
return Task.WaitAny(tasks);
}
private bool HandleResult(IBuildServerManager manager, Result result)
{
switch (result.Kind)
{
case ResultKind.Success:
_reporter.WriteLine(
string.Format(
LocalizableStrings.ShutDownSucceeded,
manager.ServerName).Green());
return true;
case ResultKind.Skipped:
_reporter.WriteLine(
string.Format(
LocalizableStrings.ShutDownSkipped,
manager.ServerName,
result.Message).Cyan());
return true;
case ResultKind.Failure:
_errorReporter.WriteLine(
string.Format(
LocalizableStrings.ShutDownFailed,
manager.ServerName,
result.Message).Red());
if (Reporter.IsVerbose && result.Exception != null)
{
Reporter.Verbose.WriteLine(result.Exception.ToString().Red());
}
return false;
default:
throw new NotSupportedException(
string.Format(
LocalizableStrings.UnsupportedEnumValue,
result.Kind.ToString(),
nameof(ResultKind)));
}
}
}
}

View file

@ -0,0 +1,31 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.Cli.CommandLine;
using LocalizableStrings = Microsoft.DotNet.Tools.BuildServer.Shutdown.LocalizableStrings;
namespace Microsoft.DotNet.Cli
{
internal static class ServerShutdownCommandParser
{
public static Command CreateCommand()
{
return Create.Command(
"shutdown",
LocalizableStrings.CommandDescription,
Create.Option(
"--msbuild",
LocalizableStrings.MSBuildOptionDescription,
Accept.NoArguments()),
Create.Option(
"--vbcscompiler",
LocalizableStrings.VBCSCompilerOptionDescription,
Accept.NoArguments()),
Create.Option(
"--razor",
LocalizableStrings.RazorOptionDescription,
Accept.NoArguments()),
CommonOptions.HelpOption());
}
}
}

View file

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="CommandDescription" xml:space="preserve">
<value>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</value>
</data>
<data name="MSBuildOptionDescription" xml:space="preserve">
<value>Shuts down the MSBuild build server.</value>
</data>
<data name="VBCSCompilerOptionDescription" xml:space="preserve">
<value>Shuts down the VB/C# compiler build server.</value>
</data>
<data name="RazorOptionDescription" xml:space="preserve">
<value>Shuts down the Razor build server.</value>
</data>
<data name="ShuttingDownServer" xml:space="preserve">
<value>Shutting down {0}...</value>
</data>
<data name="ShutDownSucceeded" xml:space="preserve">
<value>{0} shut down successfully.</value>
</data>
<data name="ShutDownFailed" xml:space="preserve">
<value>{0} failed to shut down: {1}</value>
</data>
<data name="ShutDownSkipped" xml:space="preserve">
<value>{0} shut down was skipped: {1}</value>
</data>
<data name="UnsupportedEnumValue" xml:space="preserve">
<value>The value '{0}' for enum type '{1}' is not supported.</value>
</data>
</root>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="de" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="es" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="fr" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="it" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ja" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ko" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pl" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="pt-BR" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="ru" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="tr" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hans" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="zh-Hant" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Shuts down build servers that are started from dotnet. By default, all servers are shut down.</source>
<target state="new">Shuts down build servers that are started from dotnet. By default, all servers are shut down.</target>
<note />
</trans-unit>
<trans-unit id="MSBuildOptionDescription">
<source>Shuts down the MSBuild build server.</source>
<target state="new">Shuts down the MSBuild build server.</target>
<note />
</trans-unit>
<trans-unit id="VBCSCompilerOptionDescription">
<source>Shuts down the VB/C# compiler build server.</source>
<target state="new">Shuts down the VB/C# compiler build server.</target>
<note />
</trans-unit>
<trans-unit id="RazorOptionDescription">
<source>Shuts down the Razor build server.</source>
<target state="new">Shuts down the Razor build server.</target>
<note />
</trans-unit>
<trans-unit id="ShuttingDownServer">
<source>Shutting down {0}...</source>
<target state="new">Shutting down {0}...</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSucceeded">
<source>{0} shut down successfully.</source>
<target state="new">{0} shut down successfully.</target>
<note />
</trans-unit>
<trans-unit id="ShutDownFailed">
<source>{0} failed to shut down: {1}</source>
<target state="new">{0} failed to shut down: {1}</target>
<note />
</trans-unit>
<trans-unit id="ShutDownSkipped">
<source>{0} shut down was skipped: {1}</source>
<target state="new">{0} shut down was skipped: {1}</target>
<note />
</trans-unit>
<trans-unit id="UnsupportedEnumValue">
<source>The value '{0}' for enum type '{1}' is not supported.</source>
<target state="new">The value '{0}' for enum type '{1}' is not supported.</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="cs" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Interact with servers started from a build.</source>
<target state="new">Interact with servers started from a build.</target>
<note />
</trans-unit>
<trans-unit id="BuildServerCommandName">
<source>.NET Build Server Command</source>
<target state="new">.NET Build Server Command</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
<file datatype="xml" source-language="en" target-language="de" original="../LocalizableStrings.resx">
<body>
<trans-unit id="CommandDescription">
<source>Interact with servers started from a build.</source>
<target state="new">Interact with servers started from a build.</target>
<note />
</trans-unit>
<trans-unit id="BuildServerCommandName">
<source>.NET Build Server Command</source>
<target state="new">.NET Build Server Command</target>
<note />
</trans-unit>
</body>
</file>
</xliff>

Some files were not shown because too many files have changed in this diff Show more