Skip to content

Commit e3395b2

Browse files
committed
Use Repository Root path for all the things
The new Output paths point to... Build : `build\{bin,obj}` Pack : `packages` Publish : `publish` Restore : `build\ext` Test : `build\TestResults` with-in the repository root directory.
1 parent cf281c0 commit e3395b2

9 files changed

+55
-6
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
*.userosscache
99
*.sln.docstates
1010

11+
# Working folders
12+
[Bb]uild/
13+
[Pp]ublish/
14+
[Pp]ackages/
15+
1116
# Build results
1217
[Bb]in/
1318
[Oo]bj/

Directory.Build.props

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<Project>
22

3+
<Import Project="Directory.Solution.props" />
4+
35
<PropertyGroup>
46
<RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory>
57
<BuildToolsDirectory>$(RepositoryDirectory)eng\</BuildToolsDirectory>

Directory.Solution.props

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<RestoreUseStaticGraphEvaluation>True</RestoreUseStaticGraphEvaluation>
5+
</PropertyGroup>
6+
7+
</Project>

azure-pipelines.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
displayName: Publish test results
7171
inputs:
7272
testResultsFormat: VSTest
73-
testResultsFiles: '**/TestResults/VSTestResults*.trx'
73+
testResultsFiles: build/*/TestResults/VSTestResults*.trx
7474
condition: always()
7575

7676
# Pack solution
@@ -83,10 +83,10 @@ jobs:
8383
env:
8484
SignClientUser: $(SignClientUser)
8585
SignClientSecret: $(SignClientSecret)
86-
ArtifactDirectory: bin/nupkg
86+
ArtifactDirectory: packages
8787
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), ne(variables['SignClientUser'], ''), ne(variables['SignClientSecret'], ''))
8888

8989
# Publish build artifacts
90-
- publish: bin/nupkg
90+
- publish: packages
9191
artifact: Packages
9292
displayName: Publish package artifacts

eng/Toolkit.Common.props

+31
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,22 @@
2828
<AssemblySignPublicKey>$([System.IO.File]::ReadAllText($(AssemblySignPublicKeyFile)))</AssemblySignPublicKey>
2929
</PropertyGroup>
3030

31+
<PropertyGroup Label="Outputs.Initial">
32+
<!-- Build Outputs -->
33+
<BuildDir>$(RepositoryDirectory)build\</BuildDir>
34+
<!-- Publish Outputs -->
35+
<PublishDir>$(RepositoryDirectory)publish\</PublishDir>
36+
<!-- Restore Outputs-->
37+
<MSBuildProjectExtensionsPath>$(BuildDir)ext\</MSBuildProjectExtensionsPath>
38+
<!-- Pack Outputs -->
39+
<NuSpecOutputPath>$(RepositoryDirectory)build\</NuSpecOutputPath>
40+
<PackageOutputPath>$(RepositoryDirectory)packages\</PackageOutputPath>
41+
</PropertyGroup>
42+
43+
<PropertyGroup Label="Project">
44+
<ProjectDirName>$(MSBuildProjectName.Replace('CommunityToolkit.', ''))</ProjectDirName>
45+
</PropertyGroup>
46+
3147
<!-- Identify projects targeting multiple Roslyn versions and add defaults -->
3248
<PropertyGroup Condition="$(MSBuildProjectName.Contains('.Roslyn'))">
3349
<IsCompilerTargeting>True</IsCompilerTargeting>
@@ -39,4 +55,19 @@
3955
<!-- Use custom build logic for projects targeting multiple version of the Roslyn Compiler -->
4056
<Import Project="Toolkit.CompilerTargeting.props" Condition="'$(IsCompilerTargeting)' == 'true'" />
4157

58+
<PropertyGroup Label="Outputs.Final">
59+
<!-- Build Outputs -->
60+
<BuildDir>$(BuildDir)$(ProjectDirName)\</BuildDir>
61+
<BaseOutputPath>$(BuildDir)bin\</BaseOutputPath>
62+
<BaseIntermediateOutputPath>$(BuildDir)obj\</BaseIntermediateOutputPath>
63+
<!-- Restore Outputs-->
64+
<MSBuildProjectExtensionsPath>$(BuildDir)ext\</MSBuildProjectExtensionsPath>
65+
<MSBuildProjectExtensionsPath Condition="'$(TargetCompiler)' != ''">$(MSBuildProjectExtensionsPath)$(TargetCompiler)\</MSBuildProjectExtensionsPath>
66+
<RestoreOutputPath>$(MSBuildProjectExtensionsPath)</RestoreOutputPath>
67+
<!-- Publish Outputs -->
68+
<PublishDir>$(PublishDir)$(ProjectDirName)\</PublishDir>
69+
<!-- Test Outputs -->
70+
<VSTestResultsDirectory>$(BuildDir)TestResults\</VSTestResultsDirectory>
71+
</PropertyGroup>
72+
4273
</Project>

eng/Toolkit.Common.targets

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
<PackageTags Condition="'$(PackageTags)' == ''">$(CommonTags)</PackageTags>
2020
</PropertyGroup>
2121

22+
<!-- Exclude files and folders from build and publish across all projects -->
23+
<PropertyGroup>
24+
<DefaultItemExcludes>$(BuildDir)**;$(PublishDir)**;$(DefaultItemExcludes)</DefaultItemExcludes>
25+
</PropertyGroup>
26+
2227
<ItemGroup Condition="'$(IsPackable)' == 'true'">
2328
<PackageFile Include="$(BuildToolsDirectory)Icon.png" />
2429
<PackageFile Include="$(RepositoryDirectory)License.md" />

eng/Toolkit.CompilerTargeting.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
<PropertyGroup>
5757
<!-- Currently 'project.assets.json' and 'project.nuget.cache' doesn't have unique file-names based on project name like other restore assets do -->
58-
<MSBuildProjectExtensionsPath Condition="'$(TargetCompiler)' != ''">$([System.IO.Path]::Combine('obj', '$(TargetCompiler)'))</MSBuildProjectExtensionsPath>
58+
<ProjectDirName Condition="'$(ProjectDirName)' != ''">$(ProjectDirName.Replace('.$(TargetCompilerIdentifier)$(_ShortCompilerVersion)', ''))</ProjectDirName>
5959
</PropertyGroup>
6060

6161
<!-- We also override output paths to separate compiler version specific assets but only after .NET SDK appends 'TargetFramework' -->

eng/Toolkit.CompilerTargeting.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<VSTestResultsDirectory>$([System.IO.Path]::Combine('$(BaseOutputPath)', 'TestResults'))</VSTestResultsDirectory>
4+
<VSTestResultsDirectory Condition="'$(BuildDir)' == ''">$([System.IO.Path]::Combine('$(BaseOutputPath)', 'TestResults'))</VSTestResultsDirectory>
55
</PropertyGroup>
66

77
<!-- Append the Compiler moniker (i.e., roslyn4.0) to 'TargetFramework' in the output paths -->

src/Directory.Build.props

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<IsPackable>true</IsPackable>
88
<IsPublishable>true</IsPublishable>
99
<GenerateDocumentationFile>true</GenerateDocumentationFile>
10-
<PackageOutputPath>$(RepositoryDirectory)bin\nupkg</PackageOutputPath>
1110
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
1211
</PropertyGroup>
1312

0 commit comments

Comments
 (0)