Merge pull request #7522 from dsplaisted/fix-incremental-build

Rearrange output folders
This commit is contained in:
Daniel Plaisted 2017-09-01 19:53:31 -07:00 committed by GitHub
commit c266e398cf
134 changed files with 330 additions and 682 deletions

1
.gitignore vendored
View file

@ -96,6 +96,7 @@ dlldata.c
# DNX
project.lock.json
artifacts/
bin/
*_i.c
*_p.c

61
Directory.Build.props Normal file
View file

@ -0,0 +1,61 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Projects which don't import dir.props:
build\RestoreDependency.proj
build\Signing.proj
build\package\Installer.DEB.proj
build\sdks\sdks.csproj
build\templates\templates.csproj
build\test\RunTest.proj
build_projects\Microsoft.DotNet.Cli.Build.SelfTest\InvokeWithStage2.proj
build_projects\update-dependencies\update-dependencies.csproj
tools\TestAssetsDependencies\TestAssetsDependencies.csproj
-->
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<NuGetPackagesDir>$(NUGET_PACKAGES)</NuGetPackagesDir>
<NuGetPackagesDir Condition=" '$(NuGetPackagesDir)' == '' ">$(RepoRoot)/.nuget/packages</NuGetPackagesDir>
<CLIBuildDll>$(RepoRoot)/build_projects/dotnet-cli-build/bin/dotnet-cli-build.dll</CLIBuildDll>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
<CliTargetFramework>netcoreapp2.1</CliTargetFramework>
</PropertyGroup>
<Import Project="build/InitRepo.props" />
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(GitCommitInfoProps)" />
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(HostInfoProps)" />
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(BuildInfoProps)" />
<Import Project="build/BranchInfo.props" />
<Import Project="build/BundledTools.props" />
<Import Project="build/BundledSdks.props" />
<Import Project="build/BundledTemplates.props" />
<Import Project="build/DependencyVersions.props" />
<Import Project="build/Version.props" />
<Import Project="build/Branding.props" />
<Import Project="build/DerivedHostMachineInfo.props" />
<Import Project="build/FileExtensions.props" />
<Import Project="build/InputDirectories.props" />
<Import Project="build/MSBuildExtensions.props" />
<Import Project="build/SetupPreviousStage.props" />
<Import Project="build/OutputDirectories.props" />
<Import Project="build/BuildDefaults.props" />
<Import Project="build/VersionBadge.props" />
<Import Project="build/BundledRuntimes.props" />
<Import Project="build/CrossGen.props" />
<Import Project="build/BackwardsCompatibilityRuntimes.props" />
<Import Project="build/AzureInfo.props" />
<Import Project="build/InstallerInfo.props" />
<Import Project="build/GenerateResxSource.targets" />
</Project>

View file

@ -54,7 +54,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4
build\RestoreDependency.proj = build\RestoreDependency.proj
build\sdks\sdks.csproj = build\sdks\sdks.csproj
build\Signing.proj = build\Signing.proj
build\Stage0.props = build\Stage0.props
build\SetupPreviousStage.props = build\SetupPreviousStage.props
build\Test.targets = build\Test.targets
build\Version.props = build\Version.props
build\VersionBadge.props = build\VersionBadge.props

View file

@ -6,6 +6,7 @@
<OutputType>Exe</OutputType>
<AssetTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">$(AssetTargetFallback);portable-net45+win8;dnxcore50</AssetTargetFallback>
<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64</RuntimeIdentifiers>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -4,6 +4,7 @@
<AssemblyName>AppWithRedirectsAndConfig</AssemblyName>
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -4,6 +4,7 @@
<AssemblyName>AppWithRedirectsNoConfig</AssemblyName>
<OutputType>Exe</OutputType>
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -3,6 +3,7 @@
<TargetFrameworks>netstandard1.6;net451</TargetFrameworks>
<OutputType>Library</OutputType>
<AssetTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.6' ">$(AssetTargetFallback);portable-net45+win8;dnxcore50;netcoreapp2.1</AssetTargetFallback>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -0,0 +1,3 @@
<Project>
<!-- Empty Directory.Build.props file to prevent test asset projects from picking up the repo's Directory.Build.props' -->
</Project>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="testpackages" value="../../artifacts/testpackages/packages" />
</packageSources>
</configuration>

View file

@ -4,6 +4,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<OutputType>Exe</OutputType>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<OutputType>Exe</OutputType>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages/packages" />
</packageSources>
</configuration>

View file

@ -7,6 +7,7 @@
<AssemblyName>AppWithDirectDep</AssemblyName>
<OutputType>Exe</OutputType>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages/packages" />
</packageSources>
</configuration>

View file

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<OutputType>Exe</OutputType>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<OutputType>Exe</OutputType>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -4,6 +4,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net451;netcoreapp2.1</TargetFrameworks>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<OutputType>Exe</OutputType>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -8,6 +8,7 @@
<OutputType>Exe</OutputType>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<AssetTargetFallback>$(AssetTargetFallback);dnxcore50;portable-net45+win8</AssetTargetFallback>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -5,6 +5,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeIdentifiers>win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64</RuntimeIdentifiers>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Local" value="Packages" />
</packageSources>
</configuration>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -4,6 +4,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<RestoreAdditionalProjectSources Condition="'$(TEST_PACKAGES)' != ''">$(TEST_PACKAGES)</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,3 +0,0 @@
{
"projects": [ ".", "../../src" ]
}

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="BuildTheWholeCli" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="Directory.Build.props" />
<ItemGroup>
<DotnetCliBuildFrameworkInputs Include="build_projects/**/*.cs" Exclude="build_projects/**/obj/**/*.cs" />
@ -20,7 +20,7 @@
DependsOnTargets="MSBuildWorkaroundTarget;
RestoreDotnetCliBuildFramework">
<Exec Command="$(DotnetStage0) publish --no-restore -o $(DotnetCliBuildDirectory)/bin --framework $(CliTargetFramework) /p:GeneratePropsFile=$(GeneratePropsFile)"
<Exec Command="$(PreviousStageDotnet) publish --no-restore -o $(DotnetCliBuildDirectory)/bin --framework $(CliTargetFramework) /p:GeneratePropsFile=$(GeneratePropsFile)"
WorkingDirectory="$(DotnetCliBuildDirectory)"/>
</Target>
@ -39,7 +39,7 @@
<ExtraRestoreArgs Condition="'$(OS)' != 'Windows_NT'">$(ExtraRestoreArgs) --disable-parallel</ExtraRestoreArgs>
</PropertyGroup>
<Exec Command="$(DotnetStage0) restore $(ExtraRestoreArgs)"
<Exec Command="$(PreviousStageDotnet) restore $(ExtraRestoreArgs)"
WorkingDirectory="$(DotnetCliBuildDirectory)"/>
</Target>

View file

@ -23,7 +23,7 @@
<Target Name="EnsureTemplateRestored"
Condition="!Exists('$(TemplateNuPkgPath)/$(TemplatePackageName.ToLower()).nuspec')">
<DotNetRestore ToolPath="$(Stage0Directory)"
<DotNetRestore ToolPath="$(PreviousStageDirectory)"
ProjectPath="$(MSBuildThisFileDirectory)/templates/templates.csproj"
AdditionalParameters="/p:TemplatePackageName=$(TemplatePackageName) /p:TemplatePackageVersion=$(TemplatePackageVersion)" />
</Target>

View file

@ -1,6 +1,6 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<GeneratedPropsDir>$(RepoRoot)/artifacts/obj</GeneratedPropsDir>
<GeneratedPropsDir>$(RepoRoot)/bin/obj</GeneratedPropsDir>
<GitCommitInfoProps>$(GeneratedPropsDir)/GitCommitInfo.props</GitCommitInfoProps>
<HostInfoProps>$(GeneratedPropsDir)/HostInfo.props</HostInfoProps>
<BuildInfoProps>$(GeneratedPropsDir)/BuildInfo.props</BuildInfoProps>

View file

@ -75,7 +75,7 @@
NuGetPackagesDir=$(NuGetPackagesDir);
DependencyPackageName=%(ExtensionPackageToRestore.Identity);
DependencyPackageVersion=%(ExtensionPackageToRestore.Version);
Stage0Directory=$(Stage0Directory)
PreviousStageDirectory=$(PreviousStageDirectory)
</Properties>
</ExtensionRestore>
</ItemGroup>

View file

@ -1,9 +1,6 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="DependencyVersions.props" />
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)/..</RepoRoot>
<NuGetPackagesDir>$(NUGET_PACKAGES)</NuGetPackagesDir>
<NuGetPackagesDir Condition=" '$(NuGetPackagesDir)' == '' ">$(RepoRoot)/.nuget/packages</NuGetPackagesDir>
<MicroBuildPropsAndTargetsPath>$(NuGetPackagesDir)/microbuild.core/$(MicroBuildVersion)/build/</MicroBuildPropsAndTargetsPath>

View file

@ -1,23 +1,34 @@
<Project>
<PropertyGroup>
<BaseOutputDirectory>$(RepoRoot)/artifacts/$(Rid)</BaseOutputDirectory>
<OutputDirectory>$(BaseOutputDirectory)/stage2</OutputDirectory>
<Stage2WithBackwardsCompatibleRuntimesOutputDirectory>$(BaseOutputDirectory)/stage2WithBackwardsCompatibleRuntimes</Stage2WithBackwardsCompatibleRuntimesOutputDirectory>
<CliBuildStage Condition="'$(CliBuildStage)' == '' And '$(CliOuterBuildStage)' != ''">$([MSBuild]::Add($(CliOuterBuildStage), '1'))</CliBuildStage>
<CliBuildStage Condition="'$(CliBuildStage)' == ''">2</CliBuildStage>
<!-- BaseOutputDirectory is the root output path for this stage and RID
BaseOutputPath is the project-specific output folder that each project builds into.
This is not confusing at all. -->
<BaseOutputDirectory>$(RepoRoot)/bin/$(CliBuildStage)/$(Rid)</BaseOutputDirectory>
<BaseOutputPath>$([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/bin/$(MSBuildProjectName)'))</BaseOutputPath>
<BaseIntermediateOutputPath>$([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/obj/$(MSBuildProjectName)'))</BaseIntermediateOutputPath>
<OutputDirectory>$(BaseOutputDirectory)/dotnet</OutputDirectory>
<Stage2WithBackwardsCompatibleRuntimesOutputDirectory>$(BaseOutputDirectory)/dotnetWithBackwardsCompatibleRuntimes</Stage2WithBackwardsCompatibleRuntimesOutputDirectory>
<SdkOutputDirectory>$(OutputDirectory)/sdk/$(SdkVersion)</SdkOutputDirectory>
<SymbolsDirectory>$(BaseOutputDirectory)/stage2symbols</SymbolsDirectory>
<SymbolsDirectory>$(BaseOutputDirectory)/symbols</SymbolsDirectory>
<RoslynDirectory>$(SdkOutputDirectory)/Roslyn</RoslynDirectory>
<FSharpDirectory>$(SdkOutputDirectory)/FSharp</FSharpDirectory>
<CompilationDirectory>$(BaseOutputDirectory)/stage2compilation</CompilationDirectory>
<CompilationDirectory>$(BaseOutputDirectory)/compilation</CompilationDirectory>
<IntermediateDirectory>$(BaseOutputDirectory)/intermediate</IntermediateDirectory>
<PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory>
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
<!-- The 'AspNetRuntimePackageStorePublishDirectory' needs to be very short due to path length constraints on Win8.1 -->
<AspNetRuntimePackageStorePublishDirectory>$(BaseOutputDirectory)/AspRT</AspNetRuntimePackageStorePublishDirectory>
<BackwardsCompatibleSharedFrameworksPublishDirectory>$(IntermediateDirectory)/backwardsCompatibleSharedFrameworksPublish</BackwardsCompatibleSharedFrameworksPublishDirectory>
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
<TestOutputDir>$(BaseOutputDirectory)/test/</TestOutputDir>
<DotnetInOutputDirectory>$(OutputDirectory)/dotnet$(ExeExtension)</DotnetInOutputDirectory>
<GeneratedMSBuildExtensionsDirectory>$(IntermediateDirectory)/GeneratedMSBuildExtensions</GeneratedMSBuildExtensionsDirectory>
<MSBuildExtensionsLayoutDirectory>$(IntermediateDirectory)/MSBuildExtensionsLayout</MSBuildExtensionsLayoutDirectory>
<SdkResolverOutputDirectory>$(MSBuildExtensionsLayoutDirectory)/MSBuildSdkResolver</SdkResolverOutputDirectory>
<NextStagePropsPath>$(BaseOutputDirectory)/PreviousStage.props</NextStagePropsPath>
</PropertyGroup>
</Project>

View file

@ -4,7 +4,7 @@
<Import Project="prepare/CheckPrereqs.targets" />
<Target Name="Prepare"
DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestoreSrcPackages;RestoreToolsPackages" />
DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestoreSrcPackages;RestoreToolsPackages;IsolateArtifactsFromDirectoryBuildFiles;CreatePropsForNextStage" />
<Target Name="Init"
DependsOnTargets="PrintBuildInfo;
@ -54,7 +54,7 @@
<CallTarget Targets="CleanSrcLockFiles" />
<DotNetRestore ToolPath="$(Stage0Directory)"
<DotNetRestore ToolPath="$(PreviousStageDirectory)"
ProjectPath="&quot;%(RestoreSrcPackagesInput.FullPath)&quot;" />
</Target>
@ -79,7 +79,7 @@
<CallTarget Targets="CleanToolsLockFiles" />
<DotNetRestore ToolPath="$(Stage0Directory)"
<DotNetRestore ToolPath="$(PreviousStageDirectory)"
ProjectPath="&quot;%(RestoreToolsPackagesInput.FullPath)&quot;"
AdditionalParameters="/p:UsePortableLinuxSharedFramework=$(UsePortableLinuxSharedFramework)" />
@ -98,4 +98,38 @@
</ItemGroup>
</Target>
<Target Name="IsolateArtifactsFromDirectoryBuildFiles">
<Copy SourceFiles="$(RepoRoot)TestAssets\Directory.Build.props"
DestinationFolder ="$(RepoRoot)bin"
SkipUnchangedFiles="true" />
</Target>
<Target Name="CreatePropsForNextStage">
<PropertyGroup>
<NextStagePropsContent>
&lt;Project&gt;
&lt;PropertyGroup&gt;
&lt;PreviousStageDirectory&gt;$(OutputDirectory)&lt;/PreviousStageDirectory&gt;
&lt;PreviousStageDotnet&gt;$(DotnetInOutputDirectory)&lt;/PreviousStageDotnet&gt;
&lt;CliOuterBuildStage&gt;$(CliBuildStage)&lt;/CliOuterBuildStage&gt;
&lt;/PropertyGroup&gt;
&lt;/Project&gt;
</NextStagePropsContent>
<ExistingNextStagePropsContent Condition=" Exists('$(NextStagePropsPath)') ">
$([System.IO.File]::ReadAllText($(NextStagePropsPath)))
</ExistingNextStagePropsContent>
<ShouldOverwriteNextStagePropsFile>false</ShouldOverwriteNextStagePropsFile>
<ShouldOverwriteNextStagePropsFile
Condition=" '$(ExistingNextStagePropsContent.Trim())' != '$(NextStagePropsContent.Trim())' ">true</ShouldOverwriteNextStagePropsFile>
</PropertyGroup>
<WriteLinesToFile File="$(NextStagePropsPath)"
Lines="$(NextStagePropsContent)"
Condition=" '$(ShouldOverwriteNextStagePropsFile)' == 'true' "
Overwrite="true" />
</Target>
</Project>

View file

@ -33,7 +33,7 @@
<Target Name="EnsureDependencyRestored"
Condition="!Exists('$(DependencyNuPkgPath)/$(DependencyPackageName.ToLower()).nuspec')">
<DotNetRestore ToolPath="$(Stage0Directory)"
<DotNetRestore ToolPath="$(PreviousStageDirectory)"
ProjectPath="$(MSBuildThisFileDirectory)/sdks/sdks.csproj"
AdditionalParameters="/p:DependencyPackageName=$(DependencyPackageName) /p:DependencyPackageVersion=$(DependencyPackageVersion)" />
</Target>

View file

@ -0,0 +1,13 @@
<Project>
<PropertyGroup Condition="'$(PreviousStageProps)' == ''">
<PreviousStageDirectory>$(RepoRoot)/.dotnet_stage0/$(Architecture)</PreviousStageDirectory>
<PreviousStageDotnet>$(PreviousStageDirectory)/dotnet$(ExeExtension)</PreviousStageDotnet>
</PropertyGroup>
<Import Project="$(PreviousStageProps)" Condition="'$(PreviousStageProps)' != ''" />
<PropertyGroup>
<IsDesktopAvailable>False</IsDesktopAvailable>
<IsDesktopAvailable Condition=" '$(OSName)' == 'win' ">True</IsDesktopAvailable>
</PropertyGroup>
</Project>

View file

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project InitialTargets="SetSigningProperties" DefaultTargets="SignFiles" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
<Import Project="MicroBuild.props" />
<Import Project="$(MicroBuildPropsAndTargetsPath)MicroBuild.Core.props" />
<Import Project="InitRepo.props" />
<Import Project="$(BuildInfoProps)" />
<!-- This will be overridden if we're building with MicroBuild. -->
<Target Name="SignFiles">
@ -13,10 +12,6 @@
<Target Name="SetSigningProperties">
<Error Condition="'$(Rid)' == ''" Text="Missing required property 'Rid'." />
<PropertyGroup>
<BaseOutputDirectory Condition="'$(BaseOutputDirectory)' == ''">$(RepoRoot)/artifacts/$(Rid)</BaseOutputDirectory>
<OutputDirectory Condition="'$(OutputDirectory)' == ''">$(BaseOutputDirectory)/stage2</OutputDirectory>
<CompilationDirectory Condition="'$(CompilationDirectory)' == ''">$(BaseOutputDirectory)/stage2compilation</CompilationDirectory>
<PackagesDirectory Condition="'$(PackagesDirectory)' == ''">$(BaseOutputDirectory)/packages</PackagesDirectory>
<SdkResolverOutputDirectory>$(BaseOutputDirectory)/intermediate/MSBuildExtensionsLayout/MSBuildSdkResolver</SdkResolverOutputDirectory>
<!-- The OutDir and IntermediateOutputPath properties are required by MicroBuild. MicroBuild only
@ -62,12 +57,9 @@
<Target Name="SignNuPkgContents" DependsOnTargets="GetSignNuPkgContentsFiles;SignFiles" />
<Target Name="GetSignNuPkgContentsFiles">
<PropertyGroup>
<OutDir>$(RepoRoot)/src/Microsoft.DotNet.Cli.Utils</OutDir>
</PropertyGroup>
<ItemGroup>
<!-- NuPkg contents -->
<FilesToSign Include="$(OutDir)/bin/**/Microsoft.DotNet.Cli.Utils.dll">
<FilesToSign Include="$(BaseOutputDirectory)/bin/Microsoft.DotNet.Cli.Utils/**/Microsoft.DotNet.Cli.Utils.dll">
<Authenticode>$(InternalCertificateId)</Authenticode>
</FilesToSign>
</ItemGroup>
@ -76,9 +68,6 @@
<Target Name="SignSdkResolverContents" DependsOnTargets="GetSignSdkResolverContentsFiles;SignFiles" />
<Target Name="GetSignSdkResolverContentsFiles">
<PropertyGroup>
<OutDir>$(SdkResolverOutputDirectory)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(SdkResolverOutputDirectory)/Microsoft.DotNet.MSBuildSdkResolver.dll">
<Authenticode>$(InternalCertificateId)</Authenticode>
@ -89,9 +78,6 @@
<Target Name="SignMsiAndCab" DependsOnTargets="GetSignMsiAndCabFiles;SignFiles" />
<Target Name="GetSignMsiAndCabFiles">
<PropertyGroup>
<OutDir>$(PackagesDirectory)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(PackagesDirectory)/**/*.msi">
<Authenticode>$(InternalCertificateId)</Authenticode>
@ -105,9 +91,6 @@
<Target Name="SignEngine" DependsOnTargets="GetSignEngineFiles;SignFiles" />
<Target Name="GetSignEngineFiles">
<PropertyGroup>
<OutDir>$(PackagesDirectory)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(PackagesDirectory)/**/*engine.exe">
<Authenticode>$(InternalCertificateId)</Authenticode>
@ -118,9 +101,6 @@
<Target Name="SignCliBundle" DependsOnTargets="GetSignCliBundleFiles;SignFiles" />
<Target Name="GetSignCliBundleFiles">
<PropertyGroup>
<OutDir>$(PackagesDirectory)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(PackagesDirectory)/**/*.exe">
<Authenticode>$(InternalCertificateId)</Authenticode>

View file

@ -1,9 +0,0 @@
<Project>
<PropertyGroup>
<Stage0Directory>$(RepoRoot)/.dotnet_stage0/$(Architecture)</Stage0Directory>
<Stage0PjDirectory>$(RepoRoot)/.dotnet_stage0PJ/$(Architecture)</Stage0PjDirectory>
<DotnetStage0>$(Stage0Directory)/dotnet$(ExeExtension)</DotnetStage0>
<IsDesktopAvailable>False</IsDesktopAvailable>
<IsDesktopAvailable Condition=" '$(OSName)' == 'win' ">True</IsDesktopAvailable>
</PropertyGroup>
</Project>

View file

@ -12,24 +12,21 @@
<TestResultXmlDir>$(TestOutputDir)/results/</TestResultXmlDir>
</PropertyGroup>
<ItemGroup>
<TestTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsDir)" />
</ItemGroup>
<PropertyGroup>
<RunTestEnvironmentVariables>@(TestTaskEnvironmentVariables)</RunTestEnvironmentVariables>
</PropertyGroup>
<Target Name="Test"
Condition=" '$(CLIBUILD_SKIP_TESTS)' != 'true' "
DependsOnTargets="TestsForBuildItself;BuildTests;">
<!-- Make ure the test packages directory exists so that it's not an error to have it as a package source -->
<MakeDir Directories="$(TestPackagesDir)" />
<ItemGroup>
<ProjectsToTest Include="build/test/RunTest.proj">
<Properties>
CLIBuildDll=$(CLIBuildDll);
Configuration=$(Configuration);
EnvironmentVariables=$(RunTestEnvironmentVariables);
TestArtifactsDir=$(TestArtifactsDir);
TestPackagesDir=$(TestPackagesDir);
PreviousStageProps=$(NextStagePropsPath);
TestProject=%(TestProjects.Identity);
TestResultXmlDir=$(TestResultXmlDir);
ToolPath=$(OutputDirectory);
@ -58,13 +55,15 @@
DependsOnTargets="PrepareTests;
CreateTestAssetPackageNuPkgs;">
<DotNetRestore ToolPath="$(OutputDirectory)"
ProjectPath="&quot;$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln&quot;" />
ProjectPath="&quot;$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln&quot;"
AdditionalParameters="/p:PreviousStageProps=$(NextStagePropsPath)" />
</Target>
<Target Name="BuildTests"
DependsOnTargets="RestoreTests;">
<DotNetBuild ToolPath="$(OutputDirectory)"
ProjectPath="&quot;$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln&quot;"
AdditionalParameters="/p:PreviousStageProps=$(NextStagePropsPath)"
MaxCpuCount="1" />
</Target>
@ -74,24 +73,26 @@
<DotNetRestore ToolPath="$(OutputDirectory)"
WorkingDirectory="$([System.IO.Directory]::GetParent('%(TestPackageProject.ProjectPath)'))"
ProjectPath="%(TestPackageProject.ProjectPath)" />
ProjectPath="%(TestPackageProject.ProjectPath)"
AdditionalParameters="/p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)"
/>
<!-- https://github.com/NuGet/Home/issues/4063 -->
<DotNetPack Output="$(TestPackagesDir)"
ProjectPath="%(TestPackageProject.ProjectPath)"
ToolPath="$(OutputDirectory)"
VersionSuffix="%(TestPackageProject.VersionSuffix)"
MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion)" />
MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion) /p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)" />
</Target>
<Target Name="TestsForBuildItself">
<DotNetMSBuild Arguments="/v:diag $(RepoRoot)/test/MsBuildScript.Tests/runtests.target"
ToolPath="$(Stage0Directory)" />
ToolPath="$(PreviousStageDirectory)" />
</Target>
<Target Name="EnsureStageSeparation">
<DotNetMSBuild Arguments="/v:diag $(RepoRoot)/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage0.proj /p:OutputDirectory=&quot;$(OutputDirectory)&quot;"
ToolPath="$(Stage0Directory)" />
ToolPath="$(PreviousStageDirectory)" />
</Target>
</Project>

View file

@ -64,7 +64,7 @@
Mode="u+x" />
<!-- Build SDK Deb package -->
<DotNetDebTool ToolPath="$(Stage0Directory)"
<DotNetDebTool ToolPath="$(PreviousStageDirectory)"
InputDirectory="$(LayoutDirectory)"
OutputDirectory="$(DotNetDebToolOutputDirectory)"
PackageName="$(SdkDebianPackageName)"
@ -156,22 +156,12 @@
<MakeDir Directories="$(DotNetDebToolOutputDirectory)" />
</Target>
<Target Name="PrepareDotnetDebTool"
DependsOnTargets="WriteDotnetDebToolProject">
<Target Name="PrepareDotnetDebTool">
<DotNetRestore ToolPath="$(Stage0Directory)"
<DotNetRestore ToolPath="$(PreviousStageDirectory)"
WorkingDirectory="$(DotnetDebToolDir)" />
</Target>
<Target Name="WriteDotnetDebToolProject"
Inputs="$(MSBuildThisFileDirectory)/$(DotnetDebToolConsumerProjectName)"
Outputs="$(DotnetDebToolDir)/$(DotnetDebToolConsumerProjectName)">
<Copy SourceFiles="$(MSBuildThisFileDirectory)/$(DotnetDebToolConsumerProjectName)"
DestinationFiles="$(DotnetDebToolDir)/$(DotnetDebToolConsumerProjectName)" />
</Target>
<Target Name="TestDebuild">
<Message Text="Don't remove this" />

View file

@ -8,8 +8,7 @@
<!-- dotnet deb-tool -->
<PropertyGroup>
<DotnetDebToolConsumerProjectName>dotnet-deb-tool-consumer.csproj</DotnetDebToolConsumerProjectName>
<DotnetDebToolDir>$(IntermediateDirectory)/$(DotnetDebToolConsumerProjectName)</DotnetDebToolDir>
<DotnetDebToolDir>$(MSBuildThisFileDirectory)/dotnet-deb-tool-consumer</DotnetDebToolDir>
<PackageTool>$(NuGetPackagesDir)/dotnet-deb-tool/$(DotnetDebToolVersion)/lib/netcoreapp2.0/tool/package_tool</PackageTool>
</PropertyGroup>
@ -111,6 +110,9 @@
<ItemGroup>
<TestSdkDebTaskEnvironmentVariables Include="PATH=$(DebianInstalledDirectory)$(PathListSeparator)$(PATH)" />
<TestSdkDebTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsDir)" />
<TestSdkDebTaskEnvironmentVariables Include="TEST_PACKAGES=$(TestPackagesDir)" />
<TestSdkDebTaskEnvironmentVariables Include="PreviousStageProps=$(NextStagePropsPath)" />
<!-- Consumed By Publish -->
<GeneratedInstallers Include="$(SdkInstallerFile)" />

View file

@ -199,7 +199,8 @@
<Exec Command ="powershell -NoProfile -NoLogo $(SdkTestMsiPowershellScript)
-InputMsi '$(SdkInstallerFile)'
-DotnetDir '$(Stage0Directory)'" />
-DotnetDir '$(PreviousStageDirectory)'
-TestDir '$(TestOutputDir)'" />
<WriteLinesToFile
File="$(SdkMsiTestedSentinel)"

View file

@ -24,7 +24,7 @@
<DotNetPack NoBuild="True"
Output="$(PackagesDirectory)"
ProjectPath="%(ProjectsToPack.Identity)/%(ProjectsToPack.ProjectName).csproj"
ToolPath="$(Stage0Directory)"
ToolPath="$(PreviousStageDirectory)"
VersionSuffix="$(VersionSuffix)"
Configuration="$(Configuration)" />
</Target>
@ -34,7 +34,7 @@
<MakeDir Directories="$(PackagingBuildBasePath)" />
<DotNetBuild ToolPath="$(Stage0Directory)"
<DotNetBuild ToolPath="$(PreviousStageDirectory)"
Configuration="$(Configuration)"
ProjectPath="%(ProjectsToPack.Identity)/%(ProjectsToPack.ProjectName).csproj" />
</Target>

View file

@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>

View file

@ -8,8 +8,8 @@
DependsOnTargets="CheckUbuntuAptGetDependencies;
CheckCentOsYumDependencies;">
<Message Text="Using Stage0 version:" />
<Exec Command="$(DotnetStage0) --version" />
<Message Text="Using previous stage version:" />
<Exec Command="$(PreviousStageDotnet) --version" />
</Target>
<Target Name="CheckUbuntuAptGetDependencies"

View file

@ -1,6 +1,5 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
<Import Project="..\DependencyVersions.props" />
<PropertyGroup>
<OutputType>Library</OutputType>

View file

@ -11,7 +11,13 @@
<UsingTask TaskName="DotNetTest" AssemblyFile="$(CLIBuildDllPath)" />
<Target Name="RunTest">
<DotNetTest EnvironmentVariables="$(EnvironmentVariables)"
<ItemGroup>
<EnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsDir)" />
<EnvironmentVariables Include="TEST_PACKAGES=$(TestPackagesDir)" />
<EnvironmentVariables Include="PreviousStageProps=$(PreviousStageProps)" />
</ItemGroup>
<DotNetTest EnvironmentVariables="@(EnvironmentVariables)"
ToolPath="$(ToolPath)"
Configuration="$(Configuration)"
NoBuild="True"

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>

View file

@ -13,11 +13,13 @@ namespace Microsoft.DotNet.Cli.Build
public string Verbosity { get; set; }
public string AdditionalParameters { get; set; }
protected override string Args
{
get
{
return $"{GetVerbosityArg()} {GetMaxCpuCountArg()}";
return $"{GetVerbosityArg()} {GetMaxCpuCountArg()} {GetAdditionalParameters()}";
}
}
@ -40,5 +42,10 @@ namespace Microsoft.DotNet.Cli.Build
return null;
}
private string GetAdditionalParameters()
{
return AdditionalParameters;
}
}
}

View file

@ -12,13 +12,11 @@ namespace Microsoft.DotNet.Cli.Build
protected override string Args
{
get { return $"{base.Args} {GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {GetAdditionalParameters()}"; }
get { return $"{base.Args} {GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {AdditionalParameters}"; }
}
public string ConfigFile { get; set; }
public string AdditionalParameters { get; set; }
public string ProjectPath { get; set; }
public string Source { get; set; }
@ -88,10 +86,5 @@ namespace Microsoft.DotNet.Cli.Build
return null;
}
private string GetAdditionalParameters()
{
return AdditionalParameters;
}
}
}

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<Description>Build scripts for dotnet-cli</Description>
<VersionPrefix>1.0.0</VersionPrefix>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<Description>Build scripts for dotnet-cli</Description>

View file

@ -1,46 +1,4 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<NuGetPackagesDir>$(NUGET_PACKAGES)</NuGetPackagesDir>
<NuGetPackagesDir Condition=" '$(NuGetPackagesDir)' == '' ">$(RepoRoot)/.nuget/packages</NuGetPackagesDir>
<CLIBuildDll>$(RepoRoot)/build_projects/dotnet-cli-build/bin/dotnet-cli-build.dll</CLIBuildDll>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<DisableImplicitPackageTargetFallback>true</DisableImplicitPackageTargetFallback>
<CliTargetFramework>netcoreapp2.1</CliTargetFramework>
</PropertyGroup>
<Import Project="build/InitRepo.props" />
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(GitCommitInfoProps)" />
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(HostInfoProps)" />
<Import Condition=" '$(GeneratePropsFile)' != 'true' " Project="$(BuildInfoProps)" />
<Import Project="build/BranchInfo.props" />
<Import Project="build/BundledTools.props" />
<Import Project="build/BundledSdks.props" />
<Import Project="build/BundledTemplates.props" />
<Import Project="build/DependencyVersions.props" />
<Import Project="build/Version.props" />
<Import Project="build/Branding.props" />
<Import Project="build/DerivedHostMachineInfo.props" />
<Import Project="build/FileExtensions.props" />
<Import Project="build/InputDirectories.props" />
<Import Project="build/MSBuildExtensions.props" />
<Import Project="build/OutputDirectories.props" />
<Import Project="build/BuildDefaults.props" />
<Import Project="build/Stage0.props" />
<Import Project="build/VersionBadge.props" />
<Import Project="build/BundledRuntimes.props" />
<Import Project="build/CrossGen.props" />
<Import Project="build/BackwardsCompatibilityRuntimes.props" />
<Import Project="build/AzureInfo.props" />
<Import Project="build/InstallerInfo.props" />
<Import Project="build/GenerateResxSource.targets" />
<Project>
<!-- Projects which don't import the common targets can import this dir.props file in order to get the common repo build logic -->
<Import Project="Directory.Build.props" />
</Project>

View file

@ -53,18 +53,6 @@ if (!(Test-Path $env:DOTNET_INSTALL_DIR))
mkdir $env:DOTNET_INSTALL_DIR | Out-Null
}
# We also need to pull down a project.json based CLI that is used by some tests
# so create another directory for that.
if (!$env:DOTNET_INSTALL_DIR_PJ)
{
$env:DOTNET_INSTALL_DIR_PJ="$RepoRoot\.dotnet_stage0PJ\$Architecture"
}
if (!(Test-Path $env:DOTNET_INSTALL_DIR_PJ))
{
mkdir $env:DOTNET_INSTALL_DIR_PJ | Out-Null
}
# Disable first run since we want to control all package sources
@ -88,14 +76,6 @@ if ($LastExitCode -ne 0)
exit $LastExitCode
}
Write-Output "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177"
Invoke-Expression "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177"
if ($LastExitCode -ne 0)
{
Write-Output "The .NET CLI installation failed with exit code $LastExitCode"
exit $LastExitCode
}
# Put the stage0 on the path
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"

View file

@ -139,11 +139,6 @@ args=($temp)
[ -z "$DOTNET_INSTALL_DIR" ] && export DOTNET_INSTALL_DIR=$REPOROOT/.dotnet_stage0/$ARCHITECTURE
[ -d "$DOTNET_INSTALL_DIR" ] || mkdir -p $DOTNET_INSTALL_DIR
# We also need to pull down a project.json based CLI that is used by some tests
# so create another directory for that.
[ -z "$DOTNET_INSTALL_DIR_PJ" ] && export DOTNET_INSTALL_DIR_PJ=$REPOROOT/.dotnet_stage0PJ/$ARCHITECTURE
[ -d "$DOTNET_INSTALL_DIR_PJ" ] || mkdir -p $DOTNET_INSTALL_DIR_PJ
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
# Enable verbose VS Test Console logging
@ -163,14 +158,6 @@ if [ $EXIT_CODE != 0 ]; then
exit $EXIT_CODE
fi
# Install a project.json based CLI for use by tests
(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "master" --install-dir "$DOTNET_INSTALL_DIR_PJ" --architecture "$ARCHITECTURE" --version "1.0.0-preview2-1-003177")
EXIT_CODE=$?
if [ $EXIT_CODE != 0 ]; then
echo "run-build: Error: installing project-json based cli failed with exit code $EXIT_CODE." >&2
exit $EXIT_CODE
fi
# Put stage 0 on the PATH (for this shell only)
PATH="$DOTNET_INSTALL_DIR:$PATH"

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<Description>Archive and compression types.</Description>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<Description>SLN file reader/writer</Description>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<Version>$(SdkVersion)</Version>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<Description>Abstractions for making code that uses file system and environment testable.</Description>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<Version>$(SdkVersion)</Version>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<Description>Microsoft.DotNet.TestFramework Class Library</Description>

View file

@ -15,13 +15,15 @@ namespace Microsoft.DotNet.TestFramework
public string AssetName { get; private set; }
public FileInfo DotnetExeFile { get; private set; }
public FileInfo DotnetExeFile => _testAssets.DotnetCsprojExe;
public string ProjectFilePattern { get; private set; }
public string ProjectFilePattern => "*.csproj";
public DirectoryInfo Root { get; private set; }
internal TestAssetInfo(DirectoryInfo root, string assetName, FileInfo dotnetExeFile, string projectFilePattern)
private TestAssets _testAssets { get; }
internal TestAssetInfo(DirectoryInfo root, string assetName, TestAssets testAssets)
{
if (root == null)
{
@ -33,23 +35,16 @@ namespace Microsoft.DotNet.TestFramework
throw new ArgumentException("Argument cannot be null or whitespace", nameof(assetName));
}
if (dotnetExeFile == null)
if (testAssets == null)
{
throw new ArgumentNullException(nameof(dotnetExeFile));
}
if (string.IsNullOrWhiteSpace(projectFilePattern))
{
throw new ArgumentException("Argument cannot be null or whitespace", nameof(projectFilePattern));
throw new ArgumentNullException(nameof(testAssets));
}
Root = root;
AssetName = assetName;
DotnetExeFile = dotnetExeFile;
ProjectFilePattern = projectFilePattern;
_testAssets = testAssets;
}
public TestAssetInstance CreateInstance([CallerMemberName] string callingMethod = "", string identifier = "")
@ -71,12 +66,7 @@ namespace Microsoft.DotNet.TestFramework
private DirectoryInfo GetTestDestinationDirectory(string callingMethod, string identifier)
{
#if NET451
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
#else
string baseDirectory = AppContext.BaseDirectory;
#endif
return new DirectoryInfo(Path.Combine(baseDirectory, callingMethod + identifier, AssetName));
return _testAssets.CreateTestDirectory(AssetName, callingMethod, identifier);
}
private void ThrowIfTestAssetDoesNotExist()

View file

@ -51,7 +51,14 @@ namespace Microsoft.DotNet.TestFramework
if (Root.Exists)
{
Root.Delete(recursive: true);
try
{
Root.Delete(recursive: true);
}
catch (IOException ex)
{
throw new InvalidOperationException("Unable to delete directory: " + Root.FullName, ex);
}
}
Root.Create();

View file

@ -17,13 +17,11 @@ namespace Microsoft.DotNet.TestFramework
private FileInfo _dotnetCsprojExe;
private FileInfo _dotnetProjectJsonExe;
private string _testWorkingFolder;
private const string ProjectJsonSearchPattern = "project.json";
public FileInfo DotnetCsprojExe => _dotnetCsprojExe;
private const string CsprojSearchPattern = "*.csproj";
public TestAssets(DirectoryInfo assetsRoot, FileInfo dotnetCsprojExe, FileInfo dotnetProjectJsonExe)
public TestAssets(DirectoryInfo assetsRoot, FileInfo dotnetCsprojExe, string testWorkingFolder)
{
if (assetsRoot == null)
{
@ -35,11 +33,6 @@ namespace Microsoft.DotNet.TestFramework
throw new ArgumentNullException(nameof(dotnetCsprojExe));
}
if (dotnetProjectJsonExe == null)
{
throw new ArgumentNullException(nameof(dotnetProjectJsonExe));
}
if (!assetsRoot.Exists)
{
throw new DirectoryNotFoundException($"Directory not found at '{assetsRoot}'");
@ -50,16 +43,10 @@ namespace Microsoft.DotNet.TestFramework
throw new FileNotFoundException("Csproj dotnet executable must exist", dotnetCsprojExe.FullName);
}
if (!dotnetProjectJsonExe.Exists)
{
throw new FileNotFoundException("project.json dotnet executable must exist", dotnetProjectJsonExe.FullName);
}
_root = assetsRoot;
_dotnetCsprojExe = dotnetCsprojExe;
_dotnetProjectJsonExe = dotnetProjectJsonExe;
_testWorkingFolder = testWorkingFolder;
}
public TestAssetInfo Get(string name)
@ -74,24 +61,7 @@ namespace Microsoft.DotNet.TestFramework
return new TestAssetInfo(
assetDirectory,
name,
_dotnetCsprojExe,
CsprojSearchPattern);
}
public TestAssetInfo GetProjectJson(string name)
{
return GetProjectJson(TestAssetKinds.TestProjects, name);
}
public TestAssetInfo GetProjectJson(string kind, string name)
{
var assetDirectory = new DirectoryInfo(Path.Combine(_root.FullName, kind, name));
return new TestAssetInfo(
assetDirectory,
name,
_dotnetProjectJsonExe,
ProjectJsonSearchPattern);
this);
}
public DirectoryInfo CreateTestDirectory(string testProjectName = "temp", [CallerMemberName] string callingMethod = "", string identifier = "")
@ -112,7 +82,10 @@ namespace Microsoft.DotNet.TestFramework
#else
string baseDirectory = AppContext.BaseDirectory;
#endif
return Path.Combine(baseDirectory, callingMethod + identifier, testProjectName);
// Find the name of the assembly the test comes from based on the the base directory and how the output path has been constructed
string testAssemblyName = new DirectoryInfo(baseDirectory).Parent.Parent.Name;
return Path.Combine(_testWorkingFolder, testAssemblyName, callingMethod + identifier, testProjectName);
}
}
}

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<Version>$(SdkVersion)</Version>
<TargetFramework>$(CliTargetFramework)</TargetFramework>

View file

@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.tasks))\dir.tasks" />
<Import Project="$(RepoRoot)/build/compile/LzmaArchive.targets" />
<Import Project="$(RepoRoot)/build/MSBuildExtensions.targets" />
@ -74,7 +73,7 @@
<Target Name="PublishRoslyn"
BeforeTargets="Publish">
<DotNetPublish ToolPath="$(Stage0Directory)"
<DotNetPublish ToolPath="$(PreviousStageDirectory)"
Configuration="$(Configuration)"
ProjectPath="$(SrcDirectory)/tool_roslyn/tool_roslyn.csproj" />
</Target>
@ -82,7 +81,7 @@
<Target Name="PublishFSharp"
BeforeTargets="Publish">
<DotNetPublish ToolPath="$(Stage0Directory)"
<DotNetPublish ToolPath="$(PreviousStageDirectory)"
Configuration="$(Configuration)"
ProjectPath="$(SrcDirectory)/tool_fsharp/tool_fsc.csproj" />
</Target>
@ -160,7 +159,7 @@
SdkLayoutDirectory=$(SdkOutputDirectory)/Sdks/%(BundledSdk.Identity);
DependencyPackageName=%(BundledSdk.Identity);
DependencyPackageVersion=%(BundledSdk.Version);
Stage0Directory=$(Stage0Directory)
PreviousStageDirectory=$(PreviousStageDirectory)
</Properties>
</SdksToBundle>
</ItemGroup>
@ -179,7 +178,7 @@
TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates;
TemplatePackageName=%(BundledTemplate.Identity);
TemplatePackageVersion=%(BundledTemplate.Version);
Stage0Directory=$(Stage0Directory)
PreviousStageDirectory=$(PreviousStageDirectory)
</Properties>
</TemplatesToBundle>
</ItemGroup>

View file

@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.tasks))\dir.tasks" />
<PropertyGroup>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>

View file

@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.tasks" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.tasks))\dir.tasks" />
<PropertyGroup>
<VersionPrefix>$(CliVersionPrefix)</VersionPrefix>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
@ -24,7 +23,8 @@
<Target Name="PrecompileScript"
BeforeTargets="Build"
Condition=" '$(IsCrossTargetingBuild)' != 'true' ">
<Exec Command="$(DotnetInOutputDirectory) publish ../ArgumentsReflector/ArgumentsReflector.csproj --output $(MSBuildThisFileDirectory)/$(OutputPath)" />
<Exec Command="$(PreviousStageDotnet) publish ../ArgumentsReflector/ArgumentsReflector.csproj --output $(OutputPath)" />
</Target>
</Project>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>

View file

@ -1,5 +1,5 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>

View file

@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>

View file

@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>

View file

@ -3,7 +3,8 @@
param(
[string]$InputMsi,
[string]$DotnetDir
[string]$DotnetDir,
[string]$TestDir
)
. "$PSScriptRoot\..\..\scripts\common\_common.ps1"
@ -37,7 +38,7 @@ if(!(Test-Path $inputMsi))
$testName = "Microsoft.DotNet.Cli.Msi.Tests"
$testProj="$PSScriptRoot\$testName\$testName.csproj"
$testBin="$RepoRoot\artifacts\tests\$testName"
$testBin="$TestDir\$testName"
pushd "$DotnetDir"

View file

@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>

View file

@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>

View file

@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>

View file

@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<!-- https://github.com/dotnet/cli/issues/6672: Re-enable net461 as a TFM for tests. -->
<TargetFrameworks>$(CliTargetFramework)</TargetFrameworks>

View file

@ -1,183 +0,0 @@
// 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.
using System.IO;
using Microsoft.DotNet.Cli.Utils;
using NuGet.Frameworks;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public sealed class BuildPJCommand : TestCommand
{
private bool _captureOutput;
private string _configuration;
private NuGetFramework _framework;
private string _runtime;
private bool _noDependencies;
private DirectoryInfo _outputPath;
private FileInfo _projectFile;
private DirectoryInfo _workingDirectory;
public BuildPJCommand()
: base(new RepoDirectoriesProvider().PjDotnet)
{
}
public override CommandResult Execute(string args = "")
{
args = $"build {GetNoDependencies()} {GetProjectFile()} {GetOutputPath()} {GetConfiguration()} {GetFramework()} {GetRuntime()} {args}";
if (_workingDirectory != null)
{
this.WithWorkingDirectory(_workingDirectory.FullName);
}
if (_captureOutput)
{
return base.ExecuteWithCapturedOutput(args);
}
else
{
return base.Execute(args);
}
}
public override CommandResult ExecuteWithCapturedOutput(string args = "")
{
WithCapturedOutput();
return Execute(args);
}
public BuildPJCommand WithCapturedOutput()
{
_captureOutput = true;
return this;
}
public BuildPJCommand WithConfiguration(string configuration)
{
_configuration = configuration;
return this;
}
public BuildPJCommand WithFramework(NuGetFramework framework)
{
_framework = framework;
return this;
}
public BuildPJCommand WithRuntime(string runtime)
{
_runtime = runtime;
return this;
}
public BuildPJCommand WithNoDependencies()
{
_noDependencies = true;
return this;
}
public BuildPJCommand WithOutputPath(DirectoryInfo outputPath)
{
_outputPath = outputPath;
return this;
}
public BuildPJCommand WithProjectDirectory(DirectoryInfo projectDirectory)
{
_workingDirectory = projectDirectory;
return this;
}
public BuildPJCommand WithProjectFile(FileInfo projectFile)
{
_projectFile = projectFile;
return this;
}
public BuildPJCommand WithWorkingDirectory(DirectoryInfo workingDirectory)
{
_workingDirectory = workingDirectory;
return this;
}
private string GetConfiguration()
{
if (_configuration == null)
{
return null;
}
return $"--configuration {_configuration}";
}
private string GetFramework()
{
if (_framework == null)
{
return null;
}
return $"--framework {_framework.GetShortFolderName()}";
}
private string GetRuntime()
{
if (_runtime == null)
{
return null;
}
return $"--runtime {_runtime}";
}
private string GetNoDependencies()
{
if (!_noDependencies)
{
return null;
}
return "--no-dependencies";
}
private string GetOutputPath()
{
if (_outputPath == null)
{
return null;
}
return $"\"{_outputPath.FullName}\"";
}
private string GetProjectFile()
{
if (_projectFile == null)
{
return null;
}
return $"\"{_projectFile.FullName}\"";
}
}
}

View file

@ -1,28 +0,0 @@
// 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.
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public sealed class RestoreProjectJsonCommand : TestCommand
{
public RestoreProjectJsonCommand()
: base(new RepoDirectoriesProvider().PjDotnet)
{
}
public override CommandResult Execute(string args="")
{
args = $"restore {args}";
return base.Execute(args);
}
public override CommandResult ExecuteWithCapturedOutput(string args = "")
{
args = $"restore {args}";
return base.ExecuteWithCapturedOutput(args);
}
}
}

View file

@ -238,6 +238,9 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
psi.Environment[item.Key] = item.Value;
#endif
}
// Flow the TEST_PACKAGES environment variable to the child process
psi.Environment["TEST_PACKAGES"] = System.Environment.GetEnvironmentVariable("TEST_PACKAGES");
}
private void AddWorkingDirectoryTo(ProcessStartInfo psi)

View file

@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<Description>Microsoft.DotNet.Tools.Tests.Utilities Class Library</Description>
<TargetFramework>netstandard1.5</TargetFramework>

View file

@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
private string _stage2Sdk;
private string _stage2WithBackwardsCompatibleRuntimesDirectory;
private string _testPackages;
private string _pjDotnet;
private string _testWorkingFolder;
public static string RepoRoot
{
@ -63,7 +63,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
{
if (string.IsNullOrEmpty(s_buildRid))
{
var buildInfoPath = Path.Combine(RepoRoot, "artifacts", "obj", "BuildInfo.props");
var buildInfoPath = Path.Combine(RepoRoot, "bin", "obj", "BuildInfo.props");
var root = XDocument.Load(buildInfoPath).Root;
var ns = root.Name.Namespace;
@ -86,38 +86,46 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public string Artifacts => _artifacts;
public string BuiltDotnet => _builtDotnet;
public string NugetPackages => _nugetPackages;
public string PjDotnet => _pjDotnet;
public string Stage2Sdk => _stage2Sdk;
public string Stage2WithBackwardsCompatibleRuntimesDirectory => _stage2WithBackwardsCompatibleRuntimesDirectory;
public string TestPackages => _testPackages;
public string TestWorkingFolder => _testWorkingFolder;
public RepoDirectoriesProvider(
string artifacts = null,
string builtDotnet = null,
string nugetPackages = null,
string corehostPackages = null,
string corehostDummyPackages = null,
string pjDotnet = null)
string corehostDummyPackages = null)
{
_artifacts = artifacts ?? Path.Combine(RepoRoot, "artifacts", BuildRid);
// Ideally this wouldn't be hardcoded, so that you could use stage n to build stage n + 1, and then use stage n + 1 to run tests
int previousStage = 2;
_artifacts = artifacts ?? Path.Combine(RepoRoot,
"bin",
previousStage.ToString(),
BuildRid);
_builtDotnet = builtDotnet ?? Path.Combine(_artifacts, "intermediate", "sharedFrameworkPublish");
_nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages");
_pjDotnet = pjDotnet ?? GetPjDotnetPath();
_stage2Sdk = Directory
.EnumerateDirectories(Path.Combine(_artifacts, "stage2", "sdk"))
.EnumerateDirectories(Path.Combine(_artifacts, "dotnet", "sdk"))
.First(d => !d.Contains("NuGetFallbackFolder"));
_stage2WithBackwardsCompatibleRuntimesDirectory =
Path.Combine(_artifacts, "stage2WithBackwardsCompatibleRuntimes");
_testPackages = Path.Combine(RepoRoot, "artifacts", "testpackages", "packages");
}
Path.Combine(_artifacts, "dotnetWithBackwardsCompatibleRuntimes");
private string GetPjDotnetPath()
{
return new DirectoryInfo(Path.Combine(RepoRoot, ".dotnet_stage0PJ"))
.GetDirectories().First()
.GetFiles("dotnet*").First()
.FullName;
_testPackages = Environment.GetEnvironmentVariable("TEST_PACKAGES");
if (string.IsNullOrEmpty(_testPackages))
{
throw new InvalidOperationException("TEST_PACKAGES environment variable not set");
}
_testWorkingFolder = Path.Combine(RepoRoot,
"bin",
(previousStage + 1).ToString(),
BuildRid,
"test");
}
}
}

View file

@ -53,7 +53,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
s_testAssets = new TestAssets(
new DirectoryInfo(assetsRoot),
new FileInfo(new Muxer().MuxerPath),
new FileInfo(new RepoDirectoriesProvider().PjDotnet));
new RepoDirectoriesProvider().TestWorkingFolder);
}
return s_testAssets;

View file

@ -1,6 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
<RuntimeFrameworkVersion>$(CLI_SharedFrameworkVersion)</RuntimeFrameworkVersion>

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="test-packages" value="../../artifacts/testpackages" />
</packageSources>
</configuration>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>
@ -7,6 +6,7 @@
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AssemblyName>binding-redirects.Tests</AssemblyName>
<AssetTargetFallback>$(AssetTargetFallback);dotnet5.4;portable-net451+win8</AssetTargetFallback>
<RestoreAdditionalProjectSources>$(TestOutputDir)/packages</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View file

@ -1,5 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<TargetFramework>$(CliTargetFramework)</TargetFramework>

Some files were not shown because too many files have changed in this diff Show more