add support for portable application layout
This commit is contained in:
parent
cef64895c8
commit
d08e83d5db
38 changed files with 371 additions and 192 deletions
|
@ -44,7 +44,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
|
||||
[Target(nameof(SetupTestPackages), nameof(SetupTestProjects))]
|
||||
public static BuildTargetResult SetupTests(BuildTargetContext c) => c.Success();
|
||||
|
||||
|
||||
[Target(nameof(RestoreTestAssetPackages), nameof(BuildTestAssetPackages))]
|
||||
public static BuildTargetResult SetupTestPackages(BuildTargetContext c) => c.Success();
|
||||
|
||||
|
@ -64,7 +64,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
|
||||
[Target]
|
||||
public static BuildTargetResult RestoreTestAssetProjects(BuildTargetContext c)
|
||||
{
|
||||
|
@ -74,16 +74,16 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
CleanNuGetTempCache();
|
||||
|
||||
var dotnet = DotNetCli.Stage2;
|
||||
|
||||
|
||||
dotnet.Restore("--fallbacksource", Dirs.TestPackages)
|
||||
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestProjects"))
|
||||
.Execute().EnsureSuccessful();
|
||||
|
||||
|
||||
// The 'ProjectModelServer' directory contains intentionally-unresolved dependencies, so don't check for success. Also, suppress the output
|
||||
dotnet.Restore()
|
||||
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectModelServer", "DthTestProjects"))
|
||||
.Execute();
|
||||
|
||||
|
||||
dotnet.Restore()
|
||||
.WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "ProjectModelServer", "DthUpdateSearchPathSample"))
|
||||
.Execute();
|
||||
|
@ -94,6 +94,8 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
[Target(nameof(CleanTestPackages))]
|
||||
public static BuildTargetResult BuildTestAssetPackages(BuildTargetContext c)
|
||||
{
|
||||
CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestPackages"));
|
||||
|
||||
var dotnet = DotNetCli.Stage2;
|
||||
|
||||
Rmdir(Dirs.TestPackages);
|
||||
|
@ -108,21 +110,23 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
}
|
||||
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
|
||||
[Target]
|
||||
public static BuildTargetResult CleanTestPackages(BuildTargetContext c)
|
||||
{
|
||||
Rmdir(Path.Combine(Dirs.NuGetPackages, "dotnet-hello"));
|
||||
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
[Target]
|
||||
public static BuildTargetResult BuildTestAssetProjects(BuildTargetContext c)
|
||||
{
|
||||
CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestProjects"));
|
||||
|
||||
var dotnet = DotNetCli.Stage2;
|
||||
var nobuildFileName = ".noautobuild";
|
||||
string testProjectsRoot = Path.Combine(c.BuildContext.BuildDirectory, "TestAssets", "TestProjects");
|
||||
|
@ -137,7 +141,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
}
|
||||
|
||||
|
||||
return c.Success();
|
||||
}
|
||||
|
||||
|
@ -246,7 +250,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
return new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
|
||||
c.Verbose("Start Collecting Visual Studio Environment Variables");
|
||||
|
||||
var vsvarsPath = Path.GetFullPath(Path.Combine(Environment.GetEnvironmentVariable("VS140COMNTOOLS"), "..", "..", "VC"));
|
||||
|
@ -273,14 +277,14 @@ set");
|
|||
File.Delete(temp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
result.EnsureSuccessful();
|
||||
|
||||
|
||||
var vars = new Dictionary<string, string>();
|
||||
foreach (var line in result.StdOut.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
|
||||
{
|
||||
var splat = line.Split(new[] { '=' }, 2);
|
||||
|
||||
|
||||
if (splat.Length == 2)
|
||||
{
|
||||
c.Verbose($"Adding variable '{line}'");
|
||||
|
@ -291,9 +295,8 @@ set");
|
|||
c.Info($"Skipping VS Env Variable. Unknown format: '{line}'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
c.Verbose("Finish Collecting Visual Studio Environment Variables");
|
||||
|
||||
return vars;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue