Skip to content

Move obj and bin directories into repo root #10063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
May 15, 2019
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3c3561a
Move obj and bin directories into repo root
natemcmaster May 7, 2019
6a12e2a
fixup! Move obj and bin directories into repo root
natemcmaster May 8, 2019
c8a554d
fixup! Move obj and bin directories into repo root
natemcmaster May 8, 2019
7c211da
fixup! Move obj and bin directories into repo root
natemcmaster May 8, 2019
a1034a4
Merge branch 'master' into obj-bin
natemcmaster May 9, 2019
ab087df
Fix Microsoft.AspNetCore.Identity.Test
natemcmaster May 9, 2019
f93c3e2
Workaround test failures caused by changing output directory
natemcmaster May 10, 2019
99438a5
More workarounds for obj/bin dir move
natemcmaster May 10, 2019
a7ce724
Add more workarounds
natemcmaster May 10, 2019
7c5f497
fixup! Add more workarounds
natemcmaster May 10, 2019
f21d58c
fixup! fixup! Add more workarounds
natemcmaster May 10, 2019
0b62097
fixup! fixup! fixup! Add more workarounds
natemcmaster May 10, 2019
74f62da
Mark InputDateInteractsWithEditContext_NullableDateTimeOffset as flaky
natemcmaster May 10, 2019
aa7719b
Fix signalr functional tests
natemcmaster May 10, 2019
5323709
Remove --
natemcmaster May 11, 2019
586c772
PR feedback
natemcmaster May 14, 2019
9c822ec
Merge branch 'master' into obj-bin
natemcmaster May 14, 2019
a0650a2
More workarounds for IIS
natemcmaster May 14, 2019
3cadb5e
More workarounds for IIS tests
natemcmaster May 14, 2019
58c165d
fixup! More workarounds for IIS tests
natemcmaster May 14, 2019
b492882
Merge branch 'master' into obj-bin
natemcmaster May 15, 2019
ef39232
Merge branch 'master' into obj-bin
natemcmaster May 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azure/pipelines/tools/SetupTestEnvironment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function Shutdown-Dumps()

New-ItemProperty $werHive -Name "DontShowUI" -Value 0 -PropertyType "DWORD" -Force;

$cdb = "c:\Program Files (x86)\Windows Kits\10\Debuggers\x64\cdb.exe"
$cdb = "${env:ProgramFiles(x86)}\Windows Kits\10\Debuggers\x64\cdb.exe"
if (!(Test-Path $cdb))
{
$downloadedFile = [System.IO.Path]::GetTempFileName();
Expand Down
60 changes: 32 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
# Folders
artifacts/
bin/
obj/
.dotnet/
.nuget/
.packages/
.tools/
.vs/
.vscode/
*.suo
*.user
_ReSharper.*
*.DS_Store
*.userprefs
*.pidb
*.vspx
*.psess
*.binlog
*.log
artifacts/
StyleCop.Cache
node_modules/
*.snk
.nuget
.packages/
.r
.w
.deps
msbuild.ProjectImports.zip
.env
scripts/tmp/
.dotnet/
.tools/
src/**/global.json
launchSettings.json
BenchmarkDotNet.Artifacts/
korebuild-lock.txt
.gradle/
src/SignalR/clients/**/dist/
modules/

# Template config files for blazor templates is generated on-build
src/Components/**/.template.config/
# File extensions
*.aps
*.binlog
*.dll
*.DS_Store
*.exe
*.idb
*.lib
*.log
*.pch
*.pdb
*.pidb
*.psess
*.res
*.snk
*.suo
*.tlog
*.user
*.userprefs
*.vspx

# Specific files, typically generated by tools
launchSettings.json
msbuild.ProjectImports.zip
StyleCop.Cache
UpgradeLog.htm
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
<CreateDirectory Include="$(VisualStudioSetupOutputPath)" />
</ItemGroup>

<PropertyGroup Condition=" '$(OutputInRepoRoot)' == 'true' ">
<PropertyGroup>
<OutDirName Condition=" '$(OutDirName)' == '' ">$(MSBuildProjectName)</OutDirName>

<BaseOutputPath Condition=" '$(BaseOutputPath)' == '' ">$([System.IO.Path]::GetFullPath('$(ArtifactsBinDir)$(OutDirName)\'))</BaseOutputPath>
Expand Down
2 changes: 1 addition & 1 deletion build/repo.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<ProjectToExclude Include="
$(RepositoryRoot)src\Components\Blazor\BlazorExtension\src\Microsoft.VisualStudio.BlazorExtension.csproj;
$(RepositoryRoot)src\Servers\HttpSys\samples\TestClient\TestClient.csproj;
$(RepositoryRoot)src\Middleware\WebSockets\samples\TestServer\TestServer.csproj;
$(RepositoryRoot)src\Middleware\WebSockets\samples\TestServer\WebSockets.TestServer.csproj;
"
Condition=" '$(MSBuildRuntimeType)' == 'Core' " />

Expand Down
4 changes: 4 additions & 0 deletions build/tasks/RepoTasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@
</ItemGroup>

<Import Project="$(RepoTasksSdkPath)\Sdk.targets" Condition="'$(RepoTasksSdkPath)' != '' "/>

<ItemGroup>
<PackageReference Update="Newtonsoft.Json" PrivateAssets="" />
</ItemGroup>
</Project>
7 changes: 7 additions & 0 deletions docs/BuildErrors.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,10 @@ in a previous release of this assembly. See <./ReferenceResolution.md> for how t
> error BUILD002: Package references changed since the last release...

Similar to BUILD001, but this error is not suppressable. This error only appears in servicing builds, which should not change references between assemblies or packages.

### Error BUILD003

> error BUILD003: Multiple project files named 'Banana.csproj' exist. Project files should have a unique name to avoid conflicts in build output.

This repo uses a common output directory (artifacts/bin/$(ProjectName) and artifacts/obj/$(ProjectName)). To avoid confllicts in build output, each
project file should have a unique name.
6 changes: 6 additions & 0 deletions eng/Workarounds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@
BeforeTargets="PrepareForRazorComponentGenerate"
DependsOnTargets="GenerateSourceLinkFile" />

<!-- Workaround https://github.com/aspnet/websdk/pull/646. If merged, once we update to a websdk with this fix, we can move the setting below to Directory.Build.props. -->
<PropertyGroup>
<!-- Ignore warning about calling the Pack target on Web SDK projects. Our build scripts call /t:pack on everything in this repo. -->
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
</PropertyGroup>

</Project>
36 changes: 32 additions & 4 deletions eng/scripts/CodeCheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,25 @@ function LogError {
param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$message,
[string]$FilePath
[string]$FilePath,
[string]$Code
)
if ($env:TF_BUILD) {
$prefix = "##vso[task.logissue type=error"
if ($FilePath) {
$prefix = "${prefix};sourcepath=$FilePath"
}
if ($Code) {
$prefix = "${prefix};code=$Code"
}
Write-Host "${prefix}]${message}"
}
Write-Host -f Red "error: $message"
$script:errors += $message
$fullMessage = "error ${Code}: $message"
if ($FilePath) {
$fullMessage += " [$FilePath]"
}
Write-Host -f Red $fullMessage
$script:errors += $fullMessage
}

try {
Expand All @@ -38,6 +46,26 @@ try {
& $repoRoot/build.ps1 -ci -norestore /t:InstallDotNet
}

#
# Duplicate .csproj files can cause issues with a shared build output folder
#

$projectFileNames = New-Object 'System.Collections.Generic.HashSet[string]'

# Ignore duplicates in submodules. These should be isolated from the rest of the build.
# Ignore duplicates in the .ref folder. This is expected.
Get-ChildItem -Recurse "$repoRoot/src/*.*proj" `
| ? { $_.FullName -notmatch 'submodules' } `
| ? { (Split-Path -Leaf (Split-Path -Parent $_)) -ne 'ref' } `
| % {
$fileName = [io.path]::GetFileNameWithoutExtension($_)
if ($projectFileNames.Contains($fileName)) {
LogError -code 'BUILD003' -filepath $_ `
"Multiple project files named '$fileName' exist. Project files should have a unique name to avoid conflicts in build output."
}
$projectFileNames.Add($fileName) | Out-Null
}

#
# Versions.props and Version.Details.xml
#
Expand Down Expand Up @@ -171,7 +199,7 @@ finally {
Write-Host ""

foreach ($err in $errors) {
Write-Host -f Red "error : $err"
Write-Host -f Red $err
}

if ($errors) {
Expand Down
7 changes: 7 additions & 0 deletions eng/targets/CSharp.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
<Reference Include="xunit.runner.console" Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' AND '$(IsHelixJob)' == 'true' " />
</ItemGroup>

<ItemDefinitionGroup Condition=" '$(IsTestProject)' == 'true' ">
<Content>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemDefinitionGroup>

<Import Project="CSharp.ReferenceAssembly.props" Condition="'$(IsReferenceAssemblyProject)' == 'true'" />
<Import Project="Helix.props" Condition="'$(IsTestProject)' == 'true'" />

Expand Down
5 changes: 4 additions & 1 deletion eng/targets/Cpp.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<PropertyGroup>
<SignOutput Condition=" '$(SignType)' != '' ">true</SignOutput>
<IsPackable>false</IsPackable>
<IntDir>$(PlatformName)\$(Configuration)\</IntDir>

<!-- These are defined in Directory.Build.props. This maps the common MSBuild property name to equivalent C++ project properties. -->
<OutDir>$(OutputPath)</OutDir>
<IntDir>$(IntermediateOutputPath)</IntDir>
</PropertyGroup>

<Import Project="MicroBuild.Plugin.props" Condition="'$(MicroBuildSentinelFile)' == ''" />
Expand Down
1 change: 0 additions & 1 deletion eng/tools/XplatPackageSigner/XplatPackageSigner.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<Project DefaultTargets="Build" InitialTargets="CheckForRequiredProperties">
<PropertyGroup>
<SignType>$([MSBuild]::ValueOrDefault($(SignType),'real'))</SignType>
<OutputInRepoRoot>true</OutputInRepoRoot>
</PropertyGroup>

<Import Project="..\..\..\Directory.Build.props" />
Expand Down
2 changes: 1 addition & 1 deletion src/Analyzers/Analyzers/test/AnalyzerTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Task<Compilation> CreateCompilationAsync(string source)

private static string GetProjectDirectory()
{
// On helix we use the published test files
// On helix we use the published test files
if (SkipOnHelixAttribute.OnHelix())
{
return AppContext.BaseDirectory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
<TargetFramework>netcoreapp3.0</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<RootNamespace>Microsoft.AspNetCore.Analyzers</RootNamespace>

<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
<!-- https://github.com/aspnet/AspNetCore/issues/6549 -->
<BuildHelixPayload>false</BuildHelixPayload>
<BaseOutputPath />
<OutputPath />

</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<Target Name="PublishAssets" AfterTargets="Publish">
<ItemGroup>
<_PublishFiles Include="$(MSBuildThisFileDirectory)..\testassets\AzureAD.WebSite\bin\$(Configuration)\netcoreapp3.0\AzureAD.WebSite.deps.json" />
<_PublishFiles Include="$(ArtifactsBinDir)AzureAD.WebSite\$(Configuration)\netcoreapp3.0\AzureAD.WebSite.deps.json" />
</ItemGroup>
<Copy
SourceFiles="@(_PublishFiles)"
Expand All @@ -36,6 +36,6 @@
Overwrite="true"
Encoding="Unicode"/>
</Target>

<Import Project="$(MvcTestingTargets)" Condition="'$(MvcTestingTargets)' != ''" />
</Project>
2 changes: 1 addition & 1 deletion src/Components/Blazor/Templates/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# We only track the .template.config.src items in source control
# The .template.config files are generated on build
content/**/.template.config/
src/content/**/.template.config/
2 changes: 1 addition & 1 deletion src/Components/Components.sln
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComponentsApp.Server", "tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestContentPackage", "test\testassets\TestContentPackage\TestContentPackage.csproj", "{423CCF23-C0B4-4D21-896C-16DC98689DB5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestServer", "test\testassets\TestServer\TestServer.csproj", "{D6AEB328-EBC0-40B1-8936-301597883DFA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Components.TestServer", "test\testassets\TestServer\Components.TestServer.csproj", "{D6AEB328-EBC0-40B1-8936-301597883DFA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Antiforgery", "..\Antiforgery\src\Microsoft.AspNetCore.Antiforgery.csproj", "{6BA2DCAA-CB68-4AE2-BBBE-746A728D30E0}"
EndProject
Expand Down
9 changes: 6 additions & 3 deletions src/Components/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />

<PropertyGroup>
<!-- Workaround for https://github.com/aspnet/AspNetCore/issues/5486 which requires the bin and obj directory be in the project directory -->
<OutputInRepoRoot>false</OutputInRepoRoot>
<BaseIntermediateOutputPath />
<IntermediateOutputPath />
<BaseOutputPath />
<OutputPath />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor but why don't $(BaseIntermediateOutputPath) and $(IntermediateOutputPath) need to be cleared elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blazor build tools and targets are the only thing which expect the obj/ directory to exist in the project dir. See #5486. Everywhere else I tested this change, the projects and tests were okay with obj being moved to $repoRoot$/artifacts/obj/$projectName$

</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />

<PropertyGroup>
<PackageTags>aspnetcore;components</PackageTags>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
<SkipTests Condition="'$(SeleniumE2ETestsSupported)' != 'true'">true</SkipTests>
<!-- https://github.com/aspnet/AspNetCore/issues/6857 -->
<BuildHelixPayload>false</BuildHelixPayload>

<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
<BaseOutputPath />
<OutputPath />

</PropertyGroup>

<ItemGroup>
Expand All @@ -36,7 +41,7 @@
<ProjectReference Include="..\testassets\ComponentsApp.App\ComponentsApp.App.csproj" />
<ProjectReference Include="..\testassets\ComponentsApp.Server\ComponentsApp.Server.csproj" />
<ProjectReference Include="..\testassets\BasicTestApp\BasicTestApp.csproj" />
<ProjectReference Include="..\testassets\TestServer\TestServer.csproj" />
<ProjectReference Include="..\testassets\TestServer\Components.TestServer.csproj" />
</ItemGroup>

<!-- Shared testing infrastructure for running E2E tests using selenium -->
Expand Down
3 changes: 3 additions & 0 deletions src/Components/test/E2ETest/Tests/FormsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure;
using Microsoft.AspNetCore.Components.E2ETest.Infrastructure.ServerFixtures;
using Microsoft.AspNetCore.E2ETesting;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;
using System;
Expand Down Expand Up @@ -198,6 +200,7 @@ public void InputDateInteractsWithEditContext_NonNullableDateTime()
}

[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2511", FlakyOn.All)]
public void InputDateInteractsWithEditContext_NullableDateTimeOffset()
{
var appElement = MountTestComponent<TypicalValidationComponent>();
Expand Down
2 changes: 1 addition & 1 deletion src/DefaultBuilder/DefaultBuilder.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.0.0
MinimumVisualStudioVersion = 16.0.0.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleApp", "samples\SampleApp\SampleApp.csproj", "{C19108F8-667B-4CF9-B227-CDD2290224BC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DefaultBuilder.SampleApp", "samples\SampleApp\DefaultBuilder.SampleApp.csproj", "{C19108F8-667B-4CF9-B227-CDD2290224BC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Tests", "test\Microsoft.AspNetCore.Tests\Microsoft.AspNetCore.Tests.csproj", "{1CD49F15-D381-4C7E-8E12-A85E7753B110}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>

<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
<!-- https://github.com/aspnet/AspNetCore/issues/6549 -->
<BuildHelixPayload>false</BuildHelixPayload>
<BaseOutputPath />
<OutputPath />

</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<Project>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />

<PropertyGroup>
<OutputInRepoRoot>true</OutputInRepoRoot>
<!-- Tests do not work on Helix or when bin/ directory is not in project directory due to undeclared dependency on test content. -->
<BaseOutputPath />
<OutputPath />
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
</Project>
4 changes: 0 additions & 4 deletions src/Framework/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<Project>
<PropertyGroup>
<OutputInRepoRoot>true</OutputInRepoRoot>
</PropertyGroup>

<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />

<PropertyGroup>
Expand Down
7 changes: 0 additions & 7 deletions src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<Project>

<PropertyGroup>
<OutputInRepoRoot>true</OutputInRepoRoot>
<!-- Temporary flag to disable restoring this project against the artifacts/ folder. -->
<_DisableRestoreFromLocalPackages>true</_DisableRestoreFromLocalPackages>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
Expand Down
Loading