Skip to content

Commit

Permalink
Use Repository Root path for all the things
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Nirmal4G committed Jan 17, 2023
1 parent 9b508f8 commit 4986041
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
*.userosscache
*.sln.docstates

# Working folders
[Bb]uild/
[Pp]ublish/
[Pp]ackages/

# Build results
[Bb]in/
[Oo]bj/
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<Project>

<Import Project="Directory.Solution.props" />

<PropertyGroup>
<RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory>
<BuildToolsDirectory>$(RepositoryDirectory)eng\</BuildToolsDirectory>
Expand Down
7 changes: 7 additions & 0 deletions Directory.Solution.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>

<PropertyGroup>
<RestoreUseStaticGraphEvaluation>True</RestoreUseStaticGraphEvaluation>
</PropertyGroup>

</Project>
6 changes: 3 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
displayName: Publish test results
inputs:
testResultsFormat: VSTest
testResultsFiles: '**/TestResults/VSTestResults*.trx'
testResultsFiles: build/*/TestResults/VSTestResults*.trx
condition: always()

# Pack solution
Expand All @@ -83,10 +83,10 @@ jobs:
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
ArtifactDirectory: bin/nupkg
ArtifactDirectory: packages
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), ne(variables['SignClientUser'], ''), ne(variables['SignClientSecret'], ''))

# Publish build artifacts
- publish: bin/nupkg
- publish: packages
artifact: Packages
displayName: Publish package artifacts
31 changes: 31 additions & 0 deletions eng/Toolkit.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@
<AssemblySignPublicKey>$([System.IO.File]::ReadAllText($(AssemblySignPublicKeyFile)))</AssemblySignPublicKey>
</PropertyGroup>

<PropertyGroup Label="Outputs.Initial">
<!-- Build Outputs -->
<BuildDir>$(RepositoryDirectory)build\</BuildDir>
<!-- Publish Outputs -->
<PublishDir>$(RepositoryDirectory)publish\</PublishDir>
<!-- Restore Outputs-->
<MSBuildProjectExtensionsPath>$(BuildDir)ext\</MSBuildProjectExtensionsPath>
<!-- Pack Outputs -->
<NuSpecOutputPath>$(RepositoryDirectory)build\</NuSpecOutputPath>
<PackageOutputPath>$(RepositoryDirectory)packages\</PackageOutputPath>
</PropertyGroup>

<PropertyGroup Label="Project">
<ProjectDirName>$(MSBuildProjectName.Replace('CommunityToolkit.', ''))</ProjectDirName>
</PropertyGroup>

<!-- Identify projects targeting multiple Roslyn versions and add defaults -->
<PropertyGroup Condition="$(MSBuildProjectName.Contains('.Roslyn'))">
<IsCompilerTargeting>True</IsCompilerTargeting>
Expand All @@ -39,4 +55,19 @@
<!-- Use custom build logic for projects targeting multiple version of the Roslyn Compiler -->
<Import Project="Toolkit.CompilerTargeting.props" Condition="'$(IsCompilerTargeting)' == 'true'" />

<PropertyGroup Label="Outputs.Final">
<!-- Build Outputs -->
<BuildDir>$(BuildDir)$(ProjectDirName)\</BuildDir>
<BaseOutputPath>$(BuildDir)bin\</BaseOutputPath>
<BaseIntermediateOutputPath>$(BuildDir)obj\</BaseIntermediateOutputPath>
<!-- Restore Outputs-->
<MSBuildProjectExtensionsPath>$(BuildDir)ext\</MSBuildProjectExtensionsPath>
<MSBuildProjectExtensionsPath Condition="'$(TargetCompiler)' != ''">$(MSBuildProjectExtensionsPath)$(TargetCompiler)\</MSBuildProjectExtensionsPath>
<RestoreOutputPath>$(MSBuildProjectExtensionsPath)</RestoreOutputPath>
<!-- Publish Outputs -->
<PublishDir>$(PublishDir)$(ProjectDirName)\</PublishDir>
<!-- Test Outputs -->
<VSTestResultsDirectory>$(BuildDir)TestResults\</VSTestResultsDirectory>
</PropertyGroup>

</Project>
5 changes: 5 additions & 0 deletions eng/Toolkit.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
<PackageTags Condition="'$(PackageTags)' == ''">$(CommonTags)</PackageTags>
</PropertyGroup>

<!-- Exclude files and folders from build and publish across all projects -->
<PropertyGroup>
<DefaultItemExcludes>$(BuildDir)**;$(PublishDir)**;$(DefaultItemExcludes)</DefaultItemExcludes>
</PropertyGroup>

<ItemGroup Condition="'$(IsPackable)' == 'true'">
<PackageFile Include="$(BuildToolsDirectory)Icon.png" />
<PackageFile Include="$(RepositoryDirectory)License.md" />
Expand Down
2 changes: 1 addition & 1 deletion eng/Toolkit.CompilerTargeting.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

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

<!-- We also override output paths to separate compiler version specific assets but only after .NET SDK appends 'TargetFramework' -->
Expand Down
2 changes: 1 addition & 1 deletion eng/Toolkit.CompilerTargeting.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

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

<!-- Append the Compiler moniker (i.e., roslyn4.0) to 'TargetFramework' in the output paths -->
Expand Down
1 change: 0 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<IsPackable>true</IsPackable>
<IsPublishable>true</IsPublishable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageOutputPath>$(RepositoryDirectory)bin\nupkg</PackageOutputPath>
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
</PropertyGroup>

Expand Down

0 comments on commit 4986041

Please sign in to comment.