Some PR feedback, cleaning up namespaces.
This commit is contained in:
parent
ef0fc05119
commit
cb90b1122c
15 changed files with 28 additions and 38 deletions
|
@ -1,8 +1,6 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
// 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.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Utils
|
namespace Microsoft.DotNet.Cli.Utils
|
||||||
{
|
{
|
||||||
public struct CommandResult
|
public struct CommandResult
|
||||||
|
|
|
@ -11,7 +11,7 @@ using System.IO;
|
||||||
using System.Runtime.Versioning;
|
using System.Runtime.Versioning;
|
||||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
|
|
||||||
namespace Microsoft.Dotnet.Cli.Compiler.Common
|
namespace Microsoft.DotNet.Cli.Compiler.Common
|
||||||
{
|
{
|
||||||
public class AssemblyInfoFileGenerator
|
public class AssemblyInfoFileGenerator
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,13 +2,11 @@
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using Microsoft.DotNet.ProjectModel;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.CommandLine;
|
using System.CommandLine;
|
||||||
using System.Linq;
|
|
||||||
using NuGet.Frameworks;
|
using NuGet.Frameworks;
|
||||||
|
|
||||||
namespace Microsoft.Dotnet.Cli.Compiler.Common
|
namespace Microsoft.DotNet.Cli.Compiler.Common
|
||||||
{
|
{
|
||||||
public class AssemblyInfoOptions
|
public class AssemblyInfoOptions
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,9 +12,9 @@ using System.Text;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Microsoft.DotNet.ProjectModel.Compilation;
|
using Microsoft.DotNet.ProjectModel.Compilation;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Utils
|
namespace Microsoft.DotNet.Cli.Compiler.Common
|
||||||
{
|
{
|
||||||
internal static class BindingRedirectGenerator
|
public static class BindingRedirectGenerator
|
||||||
{
|
{
|
||||||
private const int TokenLength = 8;
|
private const int TokenLength = 8;
|
||||||
private const string Namespace = "urn:schemas-microsoft-com:asm.v1";
|
private const string Namespace = "urn:schemas-microsoft-com:asm.v1";
|
||||||
|
@ -32,7 +32,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
private static readonly XName OldVersionAttributeName = XName.Get("oldVersion");
|
private static readonly XName OldVersionAttributeName = XName.Get("oldVersion");
|
||||||
private static readonly XName NewVersionAttributeName = XName.Get("newVersion");
|
private static readonly XName NewVersionAttributeName = XName.Get("newVersion");
|
||||||
|
|
||||||
internal static SHA1 Sha1 { get; } = SHA1.Create();
|
private static SHA1 Sha1 { get; } = SHA1.Create();
|
||||||
|
|
||||||
internal static XDocument GenerateBindingRedirects(this IEnumerable<LibraryExport> dependencies, XDocument document)
|
internal static XDocument GenerateBindingRedirects(this IEnumerable<LibraryExport> dependencies, XDocument document)
|
||||||
{
|
{
|
||||||
|
@ -92,7 +92,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
(string)identity.Attribute(CultureAttributeName) == redirect.From.Culture;
|
(string)identity.Attribute(CultureAttributeName) == redirect.From.Culture;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static XElement GetOrAddElement(XContainer parent, XName elementName)
|
private static XElement GetOrAddElement(XContainer parent, XName elementName)
|
||||||
{
|
{
|
||||||
XElement element;
|
XElement element;
|
||||||
if (parent.Element(elementName) != null)
|
if (parent.Element(elementName) != null)
|
|
@ -1,7 +1,8 @@
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using Microsoft.DotNet.ProjectModel;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Utils
|
namespace Microsoft.DotNet.Cli.Compiler.Common
|
||||||
{
|
{
|
||||||
internal static class CoreHost
|
internal static class CoreHost
|
||||||
{
|
{
|
|
@ -1,9 +1,9 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Utils
|
namespace Microsoft.DotNet.Cli.Compiler.Common
|
||||||
{
|
{
|
||||||
internal static class CsvFormatter
|
internal static class DepsFormatter
|
||||||
{
|
{
|
||||||
internal static string EscapeRow(IEnumerable<string> values)
|
internal static string EscapeRow(IEnumerable<string> values)
|
||||||
{
|
{
|
|
@ -1,10 +1,10 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Microsoft.DotNet.ProjectModel.Compilation;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using Microsoft.DotNet.ProjectModel;
|
||||||
|
using Microsoft.DotNet.ProjectModel.Compilation;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Utils
|
namespace Microsoft.DotNet.Cli.Compiler.Common
|
||||||
{
|
{
|
||||||
internal static class LibraryExporterExtensions
|
internal static class LibraryExporterExtensions
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
|
|
||||||
private static IEnumerable<string> GenerateLines(LibraryExport export, IEnumerable<LibraryAsset> items, string type)
|
private static IEnumerable<string> GenerateLines(LibraryExport export, IEnumerable<LibraryAsset> items, string type)
|
||||||
{
|
{
|
||||||
return items.Select(i => CsvFormatter.EscapeRow(new[]
|
return items.Select(i => DepsFormatter.EscapeRow(new[]
|
||||||
{
|
{
|
||||||
export.Library.Identity.Type.Value,
|
export.Library.Identity.Type.Value,
|
||||||
export.Library.Identity.Name,
|
export.Library.Identity.Name,
|
|
@ -7,14 +7,16 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using Microsoft.DotNet.ProjectModel;
|
||||||
|
using Microsoft.DotNet.ProjectModel.Compilation;
|
||||||
using Microsoft.DotNet.ProjectModel.Graph;
|
using Microsoft.DotNet.ProjectModel.Graph;
|
||||||
using Microsoft.DotNet.Tools.Common;
|
using Microsoft.DotNet.Tools.Common;
|
||||||
using NuGet.Frameworks;
|
using NuGet.Frameworks;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Utils
|
namespace Microsoft.DotNet.Cli.Compiler.Common
|
||||||
{
|
{
|
||||||
internal static class ProjectContextExtensions
|
public static class ProjectContextExtensions
|
||||||
{
|
{
|
||||||
public static string ProjectName(this ProjectContext context) => context.RootProject.Identity.Name;
|
public static string ProjectName(this ProjectContext context) => context.RootProject.Identity.Name;
|
||||||
|
|
||||||
|
@ -60,7 +62,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
|
|
||||||
public static string GetDefaultRootOutputPath(ProjectContext context, string currentOutputPath)
|
public static string GetDefaultRootOutputPath(ProjectContext context, string currentOutputPath)
|
||||||
{
|
{
|
||||||
string rootOutputPath = string.Empty;
|
var rootOutputPath = string.Empty;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(currentOutputPath))
|
if (string.IsNullOrEmpty(currentOutputPath))
|
||||||
{
|
{
|
||||||
|
@ -70,7 +72,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
return rootOutputPath;
|
return rootOutputPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void MakeCompilationOutputRunnable(this ProjectContext context, string outputPath, string configuration)
|
public static void MakeCompilationOutputRunnable(this ProjectContext context, string outputPath, string configuration)
|
||||||
{
|
{
|
||||||
context
|
context
|
||||||
.ProjectFile
|
.ProjectFile
|
||||||
|
@ -88,7 +90,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
.SelectMany(e => e.RuntimeAssets())
|
.SelectMany(e => e.RuntimeAssets())
|
||||||
.CopyTo(outputPath);
|
.CopyTo(outputPath);
|
||||||
|
|
||||||
GenerateBindingRedirects(context, outputPath, configuration);
|
GenerateBindingRedirects(context, exporter, outputPath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -151,7 +153,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static void GenerateBindingRedirects(this ProjectContext context, string outputPath, string configuration)
|
private static void GenerateBindingRedirects(this ProjectContext context, LibraryExporter exporter, string outputPath)
|
||||||
{
|
{
|
||||||
var existingConfig = new DirectoryInfo(context.ProjectDirectory)
|
var existingConfig = new DirectoryInfo(context.ProjectDirectory)
|
||||||
.EnumerateFiles()
|
.EnumerateFiles()
|
||||||
|
@ -167,7 +169,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var appConfig = context.CreateExporter(configuration).GetAllExports().GenerateBindingRedirects(baseAppConfig);
|
var appConfig = exporter.GetAllExports().GenerateBindingRedirects(baseAppConfig);
|
||||||
|
|
||||||
if (appConfig == null) return;
|
if (appConfig == null) return;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
"Microsoft.DotNet.Cli.Utils": {
|
"Microsoft.DotNet.Cli.Utils": {
|
||||||
"type": "build",
|
"type": "build",
|
||||||
"version": "1.0.0-*"
|
"version": "1.0.0-*"
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"dnxcore50": { }
|
"dnxcore50": { }
|
||||||
|
|
|
@ -10,7 +10,7 @@ using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using Microsoft.DotNet.ProjectModel;
|
||||||
using Microsoft.DotNet.Tools.Compiler;
|
using Microsoft.DotNet.Tools.Compiler;
|
||||||
using Microsoft.DotNet.ProjectModel.Utilities;
|
using Microsoft.DotNet.ProjectModel.Utilities;
|
||||||
|
using Microsoft.DotNet.Cli.Compiler.Common;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Build
|
namespace Microsoft.DotNet.Tools.Build
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.CommandLine;
|
using System.CommandLine;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
@ -13,7 +12,6 @@ using System.Text;
|
||||||
using Microsoft.DotNet.Cli.Compiler.Common;
|
using Microsoft.DotNet.Cli.Compiler.Common;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using Microsoft.DotNet.ProjectModel;
|
||||||
using Microsoft.Dotnet.Cli.Compiler.Common;
|
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Compiler.Csc
|
namespace Microsoft.DotNet.Tools.Compiler.Csc
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.CommandLine;
|
using System.CommandLine;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
@ -13,7 +12,6 @@ using System.Text;
|
||||||
using Microsoft.DotNet.Cli.Compiler.Common;
|
using Microsoft.DotNet.Cli.Compiler.Common;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using Microsoft.DotNet.ProjectModel;
|
||||||
using Microsoft.Dotnet.Cli.Compiler.Common;
|
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Compiler.Fsc
|
namespace Microsoft.DotNet.Tools.Compiler.Fsc
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,15 +6,10 @@ using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Xml.Linq;
|
|
||||||
using Microsoft.Dnx.Runtime.Common.CommandLine;
|
|
||||||
using Microsoft.Dotnet.Cli.Compiler.Common;
|
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
|
||||||
using Microsoft.DotNet.Cli.Compiler.Common;
|
using Microsoft.DotNet.Cli.Compiler.Common;
|
||||||
using Microsoft.DotNet.Tools.Common;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using Microsoft.DotNet.ProjectModel;
|
using Microsoft.DotNet.ProjectModel;
|
||||||
using Microsoft.DotNet.ProjectModel.Compilation;
|
using Microsoft.DotNet.ProjectModel.Compilation;
|
||||||
using Microsoft.DotNet.ProjectModel.Graph;
|
|
||||||
using Microsoft.DotNet.ProjectModel.Utilities;
|
using Microsoft.DotNet.ProjectModel.Utilities;
|
||||||
using NuGet.Frameworks;
|
using NuGet.Frameworks;
|
||||||
using Microsoft.Extensions.DependencyModel;
|
using Microsoft.Extensions.DependencyModel;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
// 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.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.Dnx.Runtime.Common.CommandLine;
|
using Microsoft.Dnx.Runtime.Common.CommandLine;
|
||||||
|
using Microsoft.DotNet.Cli.Compiler.Common;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
using System;
|
|
||||||
using Microsoft.Dotnet.Cli.Compiler.Common;
|
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Resgen
|
namespace Microsoft.DotNet.Tools.Resgen
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Microsoft.CodeAnalysis;
|
using Microsoft.CodeAnalysis;
|
||||||
using Microsoft.CodeAnalysis.CSharp;
|
using Microsoft.CodeAnalysis.CSharp;
|
||||||
using Microsoft.Dotnet.Cli.Compiler.Common;
|
using Microsoft.DotNet.Cli.Compiler.Common;
|
||||||
using Microsoft.DotNet.Cli.Utils;
|
using Microsoft.DotNet.Cli.Utils;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Resgen
|
namespace Microsoft.DotNet.Tools.Resgen
|
||||||
|
|
Loading…
Reference in a new issue