Native fixes
project.json cleanup Cleanup and Code Review Feedback
This commit is contained in:
parent
f16f839019
commit
c727c513dc
13 changed files with 54 additions and 59 deletions
|
@ -5,17 +5,18 @@ REM This file encapsulates the temporary steps to build the dotnet-compile-nativ
|
|||
REM The AppDepSDK package is a temporary artifact until we have CoreRT assemblies published to Nuget
|
||||
|
||||
set __ScriptDir=%~dp0
|
||||
set __RepoRoot=%__ScriptDir%\..\..
|
||||
set __RepoRoot=%__ScriptDir%..\..
|
||||
set __AppDepsProjectDir=%__RepoRoot%\src\Microsoft.DotNet.Tools.Compiler.Native\appdep
|
||||
|
||||
REM Get absolute path
|
||||
pushd %1
|
||||
set __OutputPath=%CD%\bin
|
||||
set __OutputPath=%__RepoRoot%\artifacts\win7-x64\stage2\bin
|
||||
popd
|
||||
|
||||
|
||||
pushd %__AppDepsProjectDir%
|
||||
rmdir /S /Q packages
|
||||
mkdir packages
|
||||
dotnet restore --packages %__AppDepsProjectDir%\packages
|
||||
set __AppDepSDK=%__AppDepsProjectDir%\packages\toolchain*\
|
||||
popd
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<string> EscapeArgArray(IEnumerable<string> args)
|
||||
private static IEnumerable<string> EscapeArgArray(IEnumerable<string> args)
|
||||
{
|
||||
var escapedArgs = new List<string>();
|
||||
|
||||
|
@ -70,7 +70,7 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<string> EscapeArgArrayForCmd(IEnumerable<string> arguments)
|
||||
private static IEnumerable<string> EscapeArgArrayForCmd(IEnumerable<string> arguments)
|
||||
{
|
||||
var escapedArgs = new List<string>();
|
||||
|
||||
|
|
|
@ -49,11 +49,9 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
{
|
||||
useComSpec=true;
|
||||
|
||||
List<string> concatenatedArgs = new List<string>();
|
||||
concatenatedArgs.Add(comSpec);
|
||||
concatenatedArgs.AddRange(scriptArguments);
|
||||
|
||||
scriptArguments = concatenatedArgs.ToArray();
|
||||
scriptArguments = new string[] { comSpec }
|
||||
.Concat(scriptArguments)
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
"NETStandard.Library": "1.0.0-rc2-23704",
|
||||
"System.Threading.ThreadPool": "4.0.10-rc2-23704",
|
||||
"System.Runtime.Serialization.Primitives": "4.1.0-rc2-23704",
|
||||
"Microsoft.DotNet.ProjectModel": {"target":"project"},
|
||||
"Microsoft.DotNet.Compiler.Common": {"target":"project"},
|
||||
"Microsoft.DotNet.ProjectModel": "1.0.0-*",
|
||||
"Microsoft.DotNet.Compiler.Common": "1.0.0-*",
|
||||
"Microsoft.Extensions.CommandLineUtils.Sources": {
|
||||
"type": "build",
|
||||
"version": "1.0.0-*"
|
||||
|
|
|
@ -220,7 +220,7 @@ namespace Microsoft.DotNet.Tools.Build
|
|||
private void CollectCheckPathProbingPreconditions(ProjectContext project, IncrementalPreconditions preconditions)
|
||||
{
|
||||
var pathCommands = CompilerUtil.GetCommandsInvokedByCompile(project)
|
||||
.Select(commandName => Command.Create(commandName, new string[] { }, project.TargetFramework))
|
||||
.Select(commandName => Command.Create(commandName, Enumerable.Empty<string>(), project.TargetFramework))
|
||||
.Where(c => c.ResolutionStrategy.Equals(CommandResolutionStrategy.Path));
|
||||
|
||||
foreach (var pathCommand in pathCommands)
|
||||
|
@ -257,37 +257,21 @@ namespace Microsoft.DotNet.Tools.Build
|
|||
|
||||
private bool InvokeCompileOnDependency(ProjectDescription projectDependency)
|
||||
{
|
||||
string[] args;
|
||||
var args = new List<string>();
|
||||
|
||||
args.Add("--framework");
|
||||
args.Add($"{projectDependency.Framework}");
|
||||
args.Add("--configuration");
|
||||
args.Add($"{_args.ConfigValue}");
|
||||
args.Add("--output");
|
||||
args.Add($"{_args.OutputValue}");
|
||||
args.Add("--temp-output");
|
||||
args.Add($"{_args.IntermediateValue}");
|
||||
args.Add($"{projectDependency.Project.ProjectDirectory}");
|
||||
|
||||
if (_args.NoHostValue)
|
||||
{
|
||||
args = new string[]
|
||||
{
|
||||
$"--framework",
|
||||
$"{projectDependency.Framework}",
|
||||
$"--configuration",
|
||||
$"{_args.ConfigValue}",
|
||||
$"--output",
|
||||
$"{_args.OutputValue}",
|
||||
$"--temp-output",
|
||||
$"{_args.IntermediateValue}",
|
||||
"--no-host",
|
||||
$"{projectDependency.Project.ProjectDirectory}"
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
args = new string[]
|
||||
{
|
||||
$"--framework",
|
||||
$"{projectDependency.Framework}",
|
||||
$"--configuration",
|
||||
$"{_args.ConfigValue}",
|
||||
$"--output",
|
||||
$"{_args.OutputValue}",
|
||||
$"--temp-output",
|
||||
$"{_args.IntermediateValue}",
|
||||
$"{projectDependency.Project.ProjectDirectory}"
|
||||
};
|
||||
args.Add("--no-host");
|
||||
}
|
||||
|
||||
var compileResult = Command.Create("dotnet-compile", args)
|
||||
|
@ -301,7 +285,7 @@ namespace Microsoft.DotNet.Tools.Build
|
|||
private bool InvokeCompileOnRootProject()
|
||||
{
|
||||
// todo: add methods to CompilerCommandApp to generate the arg string?
|
||||
List<string> args = new List<string>();
|
||||
var args = new List<string>();
|
||||
args.Add("--framework");
|
||||
args.Add(_rootProject.TargetFramework.ToString());
|
||||
args.Add("--configuration");
|
||||
|
@ -311,26 +295,40 @@ namespace Microsoft.DotNet.Tools.Build
|
|||
args.Add("--temp-output");
|
||||
args.Add(_args.IntermediateValue);
|
||||
|
||||
if (_args.NoHostValue) args.Add("--no-host");
|
||||
if (_args.NoHostValue)
|
||||
{
|
||||
args.Add("--no-host");
|
||||
}
|
||||
|
||||
//native args
|
||||
if (_args.IsNativeValue) args.Add("--native");
|
||||
if (_args.IsCppModeValue) args.Add("--cpp");
|
||||
if (_args.IsNativeValue)
|
||||
{
|
||||
args.Add("--native");
|
||||
}
|
||||
|
||||
if (_args.IsCppModeValue)
|
||||
{
|
||||
args.Add("--cpp");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_args.ArchValue))
|
||||
{
|
||||
args.Add("--arch");
|
||||
args.Add(_args.ArchValue);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_args.IlcArgsValue))
|
||||
{
|
||||
args.Add("--ilcargs");
|
||||
args.Add(_args.IlcArgsValue);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_args.IlcPathValue))
|
||||
{
|
||||
args.Add("--ilcpath");
|
||||
args.Add(_args.IlcPathValue);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(_args.IlcSdkPathValue))
|
||||
{
|
||||
args.Add("--ilcsdkpath");
|
||||
|
@ -339,7 +337,7 @@ namespace Microsoft.DotNet.Tools.Build
|
|||
|
||||
args.Add(_rootProject.ProjectDirectory);
|
||||
|
||||
var compileResult = Command.Create("dotnet-compile",args.ToArray())
|
||||
var compileResult = Command.Create("dotnet-compile",args)
|
||||
.ForwardStdOut()
|
||||
.ForwardStdErr()
|
||||
.Execute();
|
||||
|
|
|
@ -83,8 +83,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
|
|||
|
||||
// Output
|
||||
var objOut = DetermineOutputFile(config);
|
||||
argsList.Add($"/Fo");
|
||||
argsList.Add($"{objOut}");
|
||||
argsList.Add($"/Fo{objOut}");
|
||||
|
||||
// Input File
|
||||
var inCppFile = DetermineInFile(config);
|
||||
|
|
|
@ -95,8 +95,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Native
|
|||
|
||||
//Output
|
||||
var outFile = DetermineOutputFile(config);
|
||||
argsList.Add($"/out");
|
||||
argsList.Add($"{outFile}");
|
||||
argsList.Add($"/out:{outFile}");
|
||||
|
||||
// Constant Libs
|
||||
foreach (var lib in ConstantLinkLibs)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"emitEntryPoint": true
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1-*",
|
||||
"Microsoft.NETCore.Platforms": "1.0.1-rc2-23704",
|
||||
"Microsoft.DotNet.AppDep":"1.0.4-*"
|
||||
},
|
||||
"frameworks": {
|
||||
|
|
|
@ -13,10 +13,11 @@
|
|||
"dependencies": {
|
||||
"NuGet.CommandLine.XPlat": "3.4.0-beta-517",
|
||||
"Microsoft.NETCore.Platforms": "1.0.1-rc2-23704",
|
||||
"Microsoft.NETCore.TestHost": "1.0.0-rc2-23704",
|
||||
"NETStandard.Library": "1.0.0-rc2-23704",
|
||||
"System.Linq.Expressions": "4.0.11-rc2-23704",
|
||||
"Microsoft.DotNet.Cli.Utils": {"target":"project"},
|
||||
"Microsoft.DotNet.Compiler.Common": {"target":"project"},
|
||||
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
|
||||
"Microsoft.DotNet.Compiler.Common": "1.0.0-*",
|
||||
"Microsoft.Dnx.Runtime.CommandParsing.Sources": {
|
||||
"version": "1.0.0-*",
|
||||
"type": "build"
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library" : "1.0.0-rc2-23706",
|
||||
"Microsoft.NETCore.TestHost": "1.0.0-rc2-23706",
|
||||
"NETStandard.Library" : "1.0.0-rc2-23714",
|
||||
"Microsoft.NETCore.TestHost": "1.0.0-rc2-23714",
|
||||
|
||||
"xunit": "2.1.0",
|
||||
"xunit.console.netcore": "1.0.2-prerelease-00101",
|
||||
|
|
|
@ -5,13 +5,12 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library" : "1.0.0-rc2-23706",
|
||||
"NETStandard.Library" : "1.0.0-rc2-23714",
|
||||
|
||||
"xunit": "2.1.0",
|
||||
"xunit.console.netcore": "1.0.2-prerelease-00101",
|
||||
"xunit.netcore.extensions": "1.0.0-prerelease-*",
|
||||
"xunit.runner.utility": "2.1.0",
|
||||
"dotnet-test-xunit": "1.0.0-dev-*",
|
||||
|
||||
"Microsoft.DotNet.ProjectModel": {"target":"project"},
|
||||
"Microsoft.DotNet.Cli.Utils": {"target":"project"},
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
},
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23714",
|
||||
"NETStandard.Library": "1.0.0-rc2-23704",
|
||||
"dotnet-hello": { "version": "1.0.0", "target": "package" }
|
||||
},
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"testRunner": "must-be-specified-to-generate-deps",
|
||||
|
||||
"dependencies": {
|
||||
"NETStandard.Library": "1.0.0-rc2-23714",
|
||||
"NETStandard.Library": "1.0.0-rc2-23704",
|
||||
"dotnet-hello": {"version": "1.0.0", "target": "package"}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue