diff --git a/build/Microsoft.DotNet.Cli.Test.targets b/build/Microsoft.DotNet.Cli.Test.targets index e21ea029f..3ac5f31b7 100644 --- a/build/Microsoft.DotNet.Cli.Test.targets +++ b/build/Microsoft.DotNet.Cli.Test.targets @@ -3,6 +3,9 @@ + + + - - - / \ $(CommitCount) - $(BaseOutputDirectory)/tests - $(TestOutputDir)/packagesBuild - $(TestOutputDir)/packages - $(TestOutputDir)/artifacts - $(TestOutputDir)/results - $(RepoRoot)/test - $(DotnetStage2) + $(BaseOutputDirectory)/tests/ + $(TestOutputDir)/packagesBuild/ + $(TestOutputDir)/packages/ + $(TestOutputDir)/artifacts/ + $(TestOutputDir)/results/ + $(RepoRoot)/test/ + $(Stage2Directory) - + - + - - + + + + + + + + + + - + - + + @@ -133,7 +149,11 @@ - + - + + @@ -154,25 +177,28 @@ - - - --version-suffix %(TestPackageProject.VersionSuffix) - + Inputs="%(TestPackageProject.PackInputs)" + Outputs="%(TestPackageProject.PackOutputs)"> - + - - %(TestPackageProjectFrameworks.Identity) - + Inputs="%(TestPackageProject.BuildInputs)" + Outputs="%(TestPackageProject.BuildOutputs)"> - + - + + - + - + + %(Name) + + + + %(BuildOutputs) + $(TestPackagesDir)%(NuPkgName).%(VersionPrefix)%(VersionSuffix).nupkg + + + + + + + + %(TestPackageProject.OutputPath)%(TestPackageProject.Name).dll + + + + + + + %(TestPackageProjectFrameworks.Identity) + + + + + $(CurrentBuildFramework) + %(OutputPath)$(CurrentBuildFramework)/ + + + + + + + %(BaseTestPackageProject.ProjectPath) + + + + + @(__TestPackageProjectInputs) + + + + + + + <__TestPackageProjectInputs Include="%(BaseTestPackageProject.BuildInputIncludeFilter)" + Exclude="%(BaseTestPackageProject.BuildInputExcludeFilter)"> + %(BaseTestPackageProject.ProjectPath) + + + + + + + PackageWithFakeNativeDep False True + 1.0.0 $(TestPackageBuildVersionSuffix) True net45 - - + + dotnet-dependency-context-test True True + 1.0.0-rc- $(TestPackageBuildVersionSuffix) True netcoreapp1.0 - - + + dotnet-dependency-tool-invoker True True + 1.0.0-rc- $(TestPackageBuildVersionSuffix) True netcoreapp1.0 - - + + dotnet-desktop-and-portable True True + 1.0.0-rc- $(TestPackageBuildVersionSuffix) True net451;netcoreapp1.0 - - + dotnet-desktop-binding-redirects True $(DesktopAvailable) + 1.0.0-rc- $(TestPackageBuildVersionSuffix) True net451 - - + + dotnet-hello True True + 1.0.0 True netcoreapp1.0 - - + + dotnet-hello True True + 2.0.0 True netcoreapp1.0 - - + + dotnet-portable True True + 1.0.0 True netcoreapp1.0 - - - ToolWithOutputName + + + dotnet-tool-with-output-name + ToolWithOutputName True True + 1.0.0 True netcoreapp1.0 - - + + Microsoft.DotNet.Cli.Utils True True + 1.0.0-preview3- $(TestPackageBuildVersionSuffix) False net451;netstandard1.6 - - + + Microsoft.DotNet.ProjectModel True True + 1.0.0-rc4- $(TestPackageBuildVersionSuffix) False net451;netstandard1.6 - - + + Microsoft.DotNet.ProjectModel.Loader True True + 1.0.0-preview3- $(TestPackageBuildVersionSuffix) False netstandard1.6 - - + + Microsoft.DotNet.ProjectModel.Workspaces True True + 1.0.0-preview3- $(TestPackageBuildVersionSuffix) False netstandard1.6 - - + + Microsoft.DotNet.InternalAbstractions True True + 1.0.1-beta- $(TestPackageBuildVersionSuffix) False net451;netstandard1.3 - - + + Microsoft.Extensions.DependencyModel True True + 1.0.1-beta- $(TestPackageBuildVersionSuffix) False net451;netstandard1.6 - - + + Microsoft.Extensions.Testing.Abstractions True True + 1.0.0-preview3- $(TestPackageBuildVersionSuffix) False net451;netstandard1.6 - - + + Microsoft.DotNet.Compiler.Common True True + 1.0.0-preview3- $(TestPackageBuildVersionSuffix) False netstandard1.6 - - + + Microsoft.DotNet.Files True True + 1.0.0-preview3- $(TestPackageBuildVersionSuffix) False netstandard1.6 - - + + dotnet-compile-fsc True True + 1.0.0-preview3- $(TestPackageBuildVersionSuffix) True netcoreapp1.0 - - + - - + + + + $(RepoRoot)%(Identity)/ + $(TestPackagesBuildDir)%(Identity)/bin/$(Configuration)/ + + + + %(ProjectDir)project.json + %(ProjectDir)**/*.* + %(ProjectDir)bin/**/*.*;%(ProjectDir)obj/**/*.* + + + + + %(Name) + + \ No newline at end of file diff --git a/build_projects/dotnet-cli-build/DotNetBuild.cs b/build_projects/dotnet-cli-build/DotNetBuild.cs new file mode 100644 index 000000000..291186f7e --- /dev/null +++ b/build_projects/dotnet-cli-build/DotNetBuild.cs @@ -0,0 +1,66 @@ +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Microsoft.DotNet.Cli.Build +{ + public class DotNetBuild : DotNetTool + { + protected override string Command + { + get { return "build"; } + } + + protected override string Args + { + get { return $"{GetProjectPath()} {GetConfiguration()} {GetFramework()} {GetBuildBasePath()}"; } + } + + public string BuildBasePath { get; set; } + + public string Configuration { get; set; } + + public string Framework { get; set; } + + public string ProjectPath { get; set; } + + private string GetBuildBasePath() + { + if (!string.IsNullOrEmpty(BuildBasePath)) + { + return $"--build-base-path {BuildBasePath}"; + } + + return null; + } + + private string GetConfiguration() + { + if (!string.IsNullOrEmpty(Configuration)) + { + return $"--configuration {Configuration}"; + } + + return null; + } + + private string GetFramework() + { + if (!string.IsNullOrEmpty(Framework)) + { + return $"--framework {Framework}"; + } + + return null; + } + + private string GetProjectPath() + { + if (!string.IsNullOrEmpty(ProjectPath)) + { + return $"{ProjectPath}"; + } + + return null; + } + } +} diff --git a/build_projects/dotnet-cli-build/DotNetPack.cs b/build_projects/dotnet-cli-build/DotNetPack.cs new file mode 100644 index 000000000..ddc9c6676 --- /dev/null +++ b/build_projects/dotnet-cli-build/DotNetPack.cs @@ -0,0 +1,90 @@ +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Microsoft.DotNet.Cli.Build +{ + public class DotNetPack : DotNetTool + { + protected override string Command + { + get { return "pack"; } + } + + protected override string Args + { + get { return $"{GetProjectPath()} {GetConfiguration()} {GetNoBuild()} {GetBuildBasePath()} {GetOutput()} {GetVersionSuffix()}"; } + } + + public string Configuration { get; set; } + + public bool NoBuild { get; set; } + + public string BuildBasePath { get; set; } + + public string Output { get; set; } + + public string ProjectPath { get; set; } + + public string VersionSuffix { get; set; } + + private string GetConfiguration() + { + if (!string.IsNullOrEmpty(Configuration)) + { + return $"--configuration {Configuration}"; + } + + return null; + } + + private string GetNoBuild() + { + if (NoBuild) + { + return $"--no-build"; + } + + return null; + } + + private string GetBuildBasePath() + { + if (!string.IsNullOrEmpty(BuildBasePath)) + { + return $"--build-base-path {BuildBasePath}"; + } + + return null; + } + + private string GetOutput() + { + if (!string.IsNullOrEmpty(Output)) + { + return $"--output {Output}"; + } + + return null; + } + + private string GetProjectPath() + { + if (!string.IsNullOrEmpty(ProjectPath)) + { + return $"{ProjectPath}"; + } + + return null; + } + + private string GetVersionSuffix() + { + if (!string.IsNullOrEmpty(VersionSuffix)) + { + return $"--version-suffix {VersionSuffix}"; + } + + return null; + } + } +} diff --git a/build_projects/dotnet-cli-build/DotNetRestore.cs b/build_projects/dotnet-cli-build/DotNetRestore.cs new file mode 100644 index 000000000..59e1ffabd --- /dev/null +++ b/build_projects/dotnet-cli-build/DotNetRestore.cs @@ -0,0 +1,42 @@ +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Microsoft.DotNet.Cli.Build +{ + public class DotNetRestore : DotNetTool + { + protected override string Command + { + get { return "restore"; } + } + + protected override string Args + { + get { return $"{GetVerbosity()} {GetFallbackSource()}"; } + } + + public string FallbackSource { get; set; } + + public string Verbosity { get; set; } + + private string GetFallbackSource() + { + if (!string.IsNullOrEmpty(FallbackSource)) + { + return $"--fallbacksource {FallbackSource}"; + } + + return null; + } + + private string GetVerbosity() + { + if (!string.IsNullOrEmpty(Verbosity)) + { + return $"--verbosity {Verbosity}"; + } + + return null; + } + } +} diff --git a/build_projects/dotnet-cli-build/DotNetTest.cs b/build_projects/dotnet-cli-build/DotNetTest.cs new file mode 100644 index 000000000..48c6d8030 --- /dev/null +++ b/build_projects/dotnet-cli-build/DotNetTest.cs @@ -0,0 +1,54 @@ +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Microsoft.DotNet.Cli.Build +{ + public class DotNetTest : DotNetTool + { + protected override string Command + { + get { return "test"; } + } + + protected override string Args + { + get { return $"{GetConfiguration()} {GetXml()} {GetNoTrait()}"; } + } + + public string Configuration { get; set; } + + public string Xml { get; set; } + + public string NoTrait { get; set; } + + private string GetConfiguration() + { + if (!string.IsNullOrEmpty(Configuration)) + { + return $"--configuration {Configuration}"; + } + + return null; + } + + private string GetNoTrait() + { + if (!string.IsNullOrEmpty(Configuration)) + { + return $"-notrait {NoTrait}"; + } + + return null; + } + + private string GetXml() + { + if (!string.IsNullOrEmpty(Xml)) + { + return $"-xml {Xml}"; + } + + return null; + } + } +} diff --git a/build_projects/dotnet-cli-build/DotNetTool.cs b/build_projects/dotnet-cli-build/DotNetTool.cs index 4a27b8bfa..a3dda0a63 100644 --- a/build_projects/dotnet-cli-build/DotNetTool.cs +++ b/build_projects/dotnet-cli-build/DotNetTool.cs @@ -55,78 +55,4 @@ namespace Microsoft.DotNet.Cli.Build base.LogToolCommand($"{GetWorkingDirectory()}> {message}"); } } - - public class DotNetRestore : DotNetTool - { - protected override string Command - { - get { return "restore"; } - } - - protected override string Args - { - get { return $"{GetVerbosity()}"; } - } - - public string Verbosity { get; set; } - - private string GetVerbosity() - { - if (!string.IsNullOrEmpty(Verbosity)) - { - return $"--verbosity {Verbosity}"; - } - - return null; - } - } - - public class DotNetTest : DotNetTool - { - protected override string Command - { - get { return "test"; } - } - - protected override string Args - { - get { return $"{GetConfiguration()} {GetXml()} {GetNoTrait()}"; } - } - - public string Configuration { get; set; } - - public string Xml { get; set; } - - public string NoTrait { get; set; } - - private string GetConfiguration() - { - if (!string.IsNullOrEmpty(Configuration)) - { - return $"--configuration {Configuration}"; - } - - return null; - } - - private string GetNoTrait() - { - if (!string.IsNullOrEmpty(Configuration)) - { - return $"-notrait {NoTrait}"; - } - - return null; - } - - private string GetXml() - { - if (!string.IsNullOrEmpty(Xml)) - { - return $"-xml {Xml}"; - } - - return null; - } - } }