Remove no longer applicable workaround in run-build.ps1. Applied expression bodied properties to solution.

This commit is contained in:
Michael Yanni 2023-11-10 17:07:05 -08:00
parent 03b1532ebf
commit c9ab438e6c
13 changed files with 27 additions and 124 deletions

View file

@ -24,9 +24,6 @@ if ($PgoInstrument) {
if ($Sign) {
$Parameters = "$Parameters -sign /p:SignCoreSdk=true"
# Workaround https://github.com/dotnet/arcade/issues/1776
$WarnAsError = $false
}
$Parameters = "$Parameters -WarnAsError `$$WarnAsError"

View file

@ -16,15 +16,9 @@ namespace Microsoft.DotNet.Cli.Build
public bool Recursive { get; set; }
protected override string ToolName
{
get { return "chmod"; }
}
protected override string ToolName => "chmod";
protected override MessageImportance StandardOutputLoggingImportance
{
get { return MessageImportance.High; } // or else the output doesn't get logged by default
}
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
protected override string GenerateFullPathToTool()
{

View file

@ -83,22 +83,15 @@ namespace Microsoft.DotNet.Build.Tasks
return toolResult;
}
protected override string ToolName
{
get { return "crossgen2"; }
}
protected override string ToolName => "crossgen2";
protected override MessageImportance StandardOutputLoggingImportance
{
// Default is low, but we want to see output at normal verbosity.
get { return MessageImportance.Normal; }
}
=> MessageImportance.Normal;
protected override MessageImportance StandardErrorLoggingImportance
{
// This turns stderr messages into msbuild errors below.
get { return MessageImportance.High; }
}
=> MessageImportance.High;
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance)
{

View file

@ -45,10 +45,7 @@ namespace Microsoft.DotNet.Cli.Build
return $"-v {PackageVersion}";
}
protected override MessageImportance StandardOutputLoggingImportance
{
get { return MessageImportance.High; } // or else the output doesn't get logged by default
}
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
protected override string GenerateFullPathToTool()
{

View file

@ -39,15 +39,9 @@ namespace Microsoft.DotNet.Cli.Build
public string WorkingDirectory { get; set; }
protected override string ToolName
{
get { return $"dotnet{Constants.ExeSuffix}"; }
}
protected override string ToolName => $"dotnet{Constants.ExeSuffix}";
protected override MessageImportance StandardOutputLoggingImportance
{
get { return MessageImportance.High; } // or else the output doesn't get logged by default
}
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
protected override string GenerateFullPathToTool()
{

View file

@ -189,15 +189,9 @@ namespace Microsoft.DotNet.Build.Tasks
return false;
}
protected override string ToolName
{
get { return "tar"; }
}
protected override string ToolName => "tar";
protected override MessageImportance StandardOutputLoggingImportance
{
get { return MessageImportance.High; } // or else the output doesn't get logged by default
}
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
protected override string GenerateFullPathToTool()
{

View file

@ -93,15 +93,9 @@ namespace Microsoft.DotNet.Build.Tasks
return base.Execute();
}
protected override string ToolName
{
get { return "tar"; }
}
protected override string ToolName => "tar";
protected override MessageImportance StandardOutputLoggingImportance
{
get { return MessageImportance.High; } // or else the output doesn't get logged by default
}
protected override MessageImportance StandardOutputLoggingImportance => MessageImportance.High;
protected override string GenerateFullPathToTool()
{

View file

@ -16,64 +16,28 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
private string _versionSuffix;
private bool _serviceable;
private string OutputOption
{
get
{
return _outputDirectory == string.Empty ?
private string OutputOption => _outputDirectory == string.Empty ?
"" :
$"-o \"{_outputDirectory}\"";
}
}
private string BuildBasePathOption
{
get
{
return _buildBasePath == string.Empty ?
private string BuildBasePathOption => _buildBasePath == string.Empty ?
"" :
$"-b \"{_buildBasePath}\"";
}
}
private string TempOutputOption
{
get
{
return _tempOutputDirectory == string.Empty ?
private string TempOutputOption => _tempOutputDirectory == string.Empty ?
"" :
$"-t {_tempOutputDirectory}";
}
}
private string ConfigurationOption
{
get
{
return _configuration == string.Empty ?
private string ConfigurationOption => _configuration == string.Empty ?
"" :
$"-c {_configuration}";
}
}
private string VersionSuffixOption
{
get
{
return _versionSuffix == string.Empty ?
private string VersionSuffixOption => _versionSuffix == string.Empty ?
"" :
$"--version-suffix {_versionSuffix}";
}
}
private string ServiceableOption
{
get
{
return _serviceable ?
private string ServiceableOption => _serviceable ?
$"--serviceable" :
"";
}
}
public PackCommand WithConfiguration(string configuration)
{

View file

@ -19,13 +19,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
internal static readonly string DirectorySeparatorStr = new string(DirectorySeparatorChar, 1);
internal const char VolumeSeparatorChar = ':';
private static bool IsUnixLikePlatform
{
get
{
return Path.DirectorySeparatorChar == '/';
}
}
private static bool IsUnixLikePlatform => Path.DirectorySeparatorChar == '/';
internal static bool IsDirectorySeparator(char c)
{

View file

@ -42,12 +42,9 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
}
}
}
public string Path
{
get { return _path; }
}
public string Path => _path;
public DirectoryInfo DirectoryInfo => new DirectoryInfo(Path);
/// <summary>

View file

@ -55,12 +55,9 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
{
return new FileStream(_path, FileMode.Open, access);
}
public string Path
{
get { return _path; }
}
public string Path => _path;
public TempFile WriteAllText(string content, Encoding encoding)
{
File.WriteAllText(_path, content, encoding);

View file

@ -73,17 +73,11 @@ namespace Microsoft.DotNet.TestFramework
Build = new FileInfo(Path.Combine(inventoryFileDirectory.FullName, "build.txt"));
}
public IEnumerable<FileInfo> AllInventoryFiles
{
get
{
return new List<FileInfo>
public IEnumerable<FileInfo> AllInventoryFiles => new List<FileInfo>
{
Source,
Restore,
Build
};
}
}
}
}

View file

@ -34,13 +34,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
}
}
protected static string RepoRoot
{
get
{
return RepoDirectoriesProvider.RepoRoot;
}
}
protected static string RepoRoot => RepoDirectoriesProvider.RepoRoot;
public static TestAssets TestAssets
{