Update dotnet-build to produce portable layout

dotnet-build will produce a deps file for portable builds, and will now
create "runnable" outputs for RID-less targets

the outputs won't actually be runnable today because we need corehost
changes and to generate a deps.json file for corehost to use.
This commit is contained in:
Andrew Stanton-Nurse 2016-03-01 17:42:44 -08:00
parent 444e4f9fd7
commit 7cc90d9ad1
22 changed files with 334 additions and 99 deletions

View file

@ -11,23 +11,25 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public sealed class BuildCommand : TestCommand
{
private Project _project;
private string _projectPath;
private string _outputDirectory;
private string _buidBasePathDirectory;
private string _configuration;
private string _framework;
private string _versionSuffix;
private bool _noHost;
private bool _native;
private string _architecture;
private string _ilcArgs;
private string _ilcPath;
private string _appDepSDKPath;
private bool _nativeCppMode;
private string _cppCompilerFlags;
private bool _buildProfile;
private bool _noIncremental;
private bool _noDependencies;
private readonly string _projectPath;
private readonly string _outputDirectory;
private readonly string _buidBasePathDirectory;
private readonly string _configuration;
private readonly string _framework;
private readonly string _versionSuffix;
private readonly bool _noHost;
private readonly bool _native;
private readonly string _architecture;
private readonly string _ilcArgs;
private readonly string _ilcPath;
private readonly string _appDepSDKPath;
private readonly bool _nativeCppMode;
private readonly string _cppCompilerFlags;
private readonly bool _buildProfile;
private readonly bool _noIncremental;
private readonly bool _noDependencies;
private readonly string _runtime;
private readonly bool _forcePortable;
private string OutputOption
{
@ -39,6 +41,16 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
}
}
private string ForcePortableOption
{
get
{
return _forcePortable ?
"--portable" :
string.Empty;
}
}
private string BuildBasePathOption
{
get
@ -67,7 +79,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
$"--framework {_framework}";
}
}
private string VersionSuffixOption
{
get
@ -98,6 +110,16 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
}
}
private string RuntimeOption
{
get
{
return _runtime == string.Empty ?
"" :
$"--runtime {_runtime}";
}
}
private string ArchitectureOption
{
get
@ -194,6 +216,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
string buidBasePath="",
string configuration="",
string framework="",
string runtime="",
string versionSuffix="",
bool noHost=false,
bool native=false,
@ -205,7 +228,8 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
string cppCompilerFlags="",
bool buildProfile=true,
bool noIncremental=false,
bool noDependencies=false
bool noDependencies=false,
bool forcePortable=false
)
: base("dotnet")
{
@ -217,6 +241,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
_configuration = configuration;
_versionSuffix = versionSuffix;
_framework = framework;
_runtime = runtime;
_noHost = noHost;
_native = native;
_architecture = architecture;
@ -228,6 +253,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
_buildProfile = buildProfile;
_noIncremental = noIncremental;
_noDependencies = noDependencies;
_forcePortable = forcePortable;
}
public override CommandResult Execute(string args = "")
@ -251,7 +277,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
private string BuildArgs()
{
return $"{BuildProfile} {NoDependencies} {NoIncremental} \"{_projectPath}\" {OutputOption} {BuildBasePathOption} {ConfigurationOption} {FrameworkOption} {VersionSuffixOption} {NoHostOption} {NativeOption} {ArchitectureOption} {IlcArgsOption} {IlcPathOption} {AppDepSDKPathOption} {NativeCppModeOption} {CppCompilerFlagsOption}";
return $"{BuildProfile} {ForcePortableOption} {NoDependencies} {NoIncremental} \"{_projectPath}\" {OutputOption} {BuildBasePathOption} {ConfigurationOption} {FrameworkOption} {RuntimeOption} {VersionSuffixOption} {NoHostOption} {NativeOption} {ArchitectureOption} {IlcArgsOption} {IlcPathOption} {AppDepSDKPathOption} {NativeCppModeOption} {CppCompilerFlagsOption}";
}
}
}