Skip to content

Commit d87d66c

Browse files
authored
[9] Replace Build.SourcesDirectory with System.DefaultWorkingDirectory (#16045)
2 parents e298236 + d8a610b commit d87d66c

30 files changed

+79
-75
lines changed

Documentation/ArcadeSdk.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ The following task restores tools that are only available from internal feeds.
663663
feedsToUse: config
664664
restoreSolution: 'eng\common\internal\Tools.csproj'
665665
nugetConfigPath: 'NuGet.config'
666-
restoreDirectory: '$(Build.SourcesDirectory)\.packages'
666+
restoreDirectory: '$(System.DefaultWorkingDirectory)\.packages'
667667
```
668668
669669
[The tools](https://github.com/dotnet/arcade/blob/master/eng/common/internal/Tools.csproj) are restored conditionally based on which Arcade SDK features the repository uses (these are specified via `UsingToolXxx` properties).
@@ -706,7 +706,7 @@ The Build Pipeline needs to link the following variable group:
706706
- task: PublishBuildArtifacts@1
707707
displayName: Publish Logs
708708
inputs:
709-
PathtoPublish: '$(Build.SourcesDirectory)\artifacts\log\$(BuildConfiguration)'
709+
PathtoPublish: '$(System.DefaultWorkingDirectory)\artifacts\log\$(BuildConfiguration)'
710710
ArtifactName: '$(OperatingSystemName) $(BuildConfiguration)'
711711
continueOnError: true
712712
condition: not(succeeded())
@@ -848,7 +848,7 @@ The following build definition steps are required for successful generation of a
848848
inputs:
849849
dropServiceURI: 'https://devdiv.artifacts.visualstudio.com'
850850
buildNumber: 'ProfilingInputs/DevDiv/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)'
851-
sourcePath: '$(Build.SourcesDirectory)\artifacts\OptProf\$(BuildConfiguration)\Data'
851+
sourcePath: '$(System.DefaultWorkingDirectory)\artifacts\OptProf\$(BuildConfiguration)\Data'
852852
toLowerCase: false
853853
usePat: false
854854
displayName: 'OptProf - Publish to Artifact Services - ProfilingInputs'
@@ -861,7 +861,7 @@ The following build definition steps are required for successful generation of a
861861
vsMajorVersion: $(VisualStudio.MajorVersion)
862862
channelName: $(VisualStudio.ChannelName)
863863
manifests: $(VisualStudio.SetupManifestList)
864-
outputFolder: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(BuildConfiguration)\Insertion'
864+
outputFolder: '$(System.DefaultWorkingDirectory)\artifacts\VSSetup\$(BuildConfiguration)\Insertion'
865865
displayName: 'OptProf - Build VS bootstrapper'
866866
condition: succeeded()
867867

Documentation/AzureDevOps/PhaseToJobSchemaChange.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ phases:
188188
- task: PublishBuildArtifacts@1
189189
displayName: Publish Logs to VSTS
190190
inputs:
191-
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
191+
PathtoPublish: '$(System.DefaultWorkingDirectory)/artifacts/log/$(_BuildConfig)'
192192
PublishLocation: Container
193193
ArtifactName: $(Agent.Os)_$(Agent.JobName)
194194
continueOnError: true
@@ -276,7 +276,7 @@ phases:
276276
- task: PublishBuildArtifacts@1
277277
displayName: Publish Logs to VSTS
278278
inputs:
279-
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
279+
PathtoPublish: '$(System.DefaultWorkingDirectory)/artifacts/log/$(_BuildConfig)'
280280
PublishLocation: Container
281281
ArtifactName: $(Agent.Os)_$(Agent.JobName)
282282
continueOnError: true

Documentation/AzureDevOps/SendingJobsToHelix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The list of available Helix queues can be found on the [Helix homepage](https://
100100
# HelixConfiguration: '' -- any property that you would like to attached to a job
101101
# HelixPreCommands: '' -- any commands that you would like to run prior to running your job
102102
# HelixPostCommands: '' -- any commands that you would like to run after running your job
103-
XUnitProjects: $(Build.SourcesDirectory)/HelloTests/HelloTests.csproj # specify your xUnit projects (semicolon delimited) here!
103+
XUnitProjects: $(System.DefaultWorkingDirectory)/HelloTests/HelloTests.csproj # specify your xUnit projects (semicolon delimited) here!
104104
# XUnitWorkItemTimeout: '00:05:00' -- a timeout (specified as a System.TimeSpan string) for all work items created from XUnitProjects
105105
XUnitPublishTargetFramework: netcoreapp3.1 # specify your publish target framework here
106106
XUnitRuntimeTargetFramework: netcoreapp2.0 # specify the framework you want to use for the xUnit runner

Documentation/DependencyFlowOnboardingWithoutArcade.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ If you only have one Azure DevOps job that publishes assets, then you can add th
7878
azureSubscription: "Darc: Maestro Production"
7979
scriptType: ps
8080
scriptLocation: scriptPath
81-
scriptPath: $(Build.SourcesDirectory)/eng/common/sdk-task.ps1
81+
scriptPath: $(System.DefaultWorkingDirectory)/eng/common/sdk-task.ps1
8282
arguments: -task PublishBuildAssets
8383
-restore
8484
-msbuildEngine dotnet

Documentation/HowToAddPerfTestingToPipeline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Performance testing has been fully tested in coreclr. Coreclr, corefx and other
103103

104104
# Test job depends on the corresponding build job
105105
dependsOn: build_Windows_NT_x64_Release
106-
extraSetupParameters: -CoreRootDirectory $(Build.SourcesDirectory)\bin\tests\Windows_NT.x64.Release\Tests\Core_Root -Architecture x64
106+
extraSetupParameters: -CoreRootDirectory $(System.DefaultWorkingDirectory)\bin\tests\Windows_NT.x64.Release\Tests\Core_Root -Architecture x64
107107

108108
steps:
109109
# Download product build
@@ -121,7 +121,7 @@ Performance testing has been fully tested in coreclr. Coreclr, corefx and other
121121
inputs:
122122
sourceFolder: $(System.ArtifactsDirectory)/Windows_NT_x64_Release_build
123123
contents: '**'
124-
targetFolder: $(Build.SourcesDirectory)/bin/Product/Windows_NT.x64.Release
124+
targetFolder: $(System.DefaultWorkingDirectory)/bin/Product/Windows_NT.x64.Release
125125

126126
# Create Core_Root
127127
- script: build-test.cmd Release x64 skipmanaged skipnative

Documentation/OneLocBuild.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ The parameters that can be passed to the template are as follows:
182182
| **Parameter** | **Default Value** | **Notes** |
183183
|:-:|:-:|-|
184184
| `RepoType` | `'gitHub'` | Should be set to `'gitHub'` for GitHub-based repositories and `'azureDevOps'` for Azure DevOps-based ones. |
185-
| `SourcesDirectory` | `$(Build.SourcesDirectory)` | This is the root directory for your repository source code. |
185+
| `SourcesDirectory` | `$(System.DefaultWorkingDirectory)` | This is the root directory for your repository source code. |
186186
| `CreatePr` | `true` | When set to `true`, instructs the OneLocBuild task to make a PR back to the source repository containing the localized files. |
187187
| `AutoCompletePr` | `false` | When set to `true`, instructs the OneLocBuild task to autocomplete the created PR. Requires permissions to bypass any checks on the main branch. |
188188
| `ReusePr` | `true` | When set to `true`, instructs the OneLocBuild task to update an existing PR (if one exists) rather than open a new one to reduce PR noise. |

Documentation/Projects/Build Analysis/BuildRetryOnboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Ex. \eng\BuildConfiguration\build-configuration.json
2121
```
2222
- task: PublishPipelineArtifact@1
2323
inputs:
24-
targetPath: $(Build.SourcesDirectory)\eng\BuildConfiguration
24+
targetPath: $(System.DefaultWorkingDirectory)\eng\BuildConfiguration
2525
artifactName: BuildConfiguration
2626
```
2727

Documentation/SBOMGenerationGuidance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Arcade configurations. The template allows customization of behavior via the fol
7676
- `ManifestDirPath`: Determines where in the build agent the SBOM will be generated to, defaults to
7777
`$(Build.ArtifactStagingDirectory)/sbom`
7878
- `BuildDropPath` : Determines the directory that the SBOM tooling will use to find build outputs.
79-
Defaults to $`(Build.SourcesDirectory)/artifacts` to match Arcade's convention.
79+
Defaults to $`(System.DefaultWorkingDirectory)/artifacts` to match Arcade's convention.
8080
- `sbomContinueOnError`: By default the tasks are set up to not break the build and instead continue
8181
on error if anything goes wrong in the generation process.
8282

@@ -244,7 +244,7 @@ for your release builds:
244244
```
245245

246246
It means that your build outputs might not match with the expected location for Arcade:
247-
`$(Build.SourcesDirectory)/Artifacts`. In this case you should modify the `BuildDropPath`
247+
`$(System.DefaultWorkingDirectory)/Artifacts`. In this case you should modify the `BuildDropPath`
248248
parameter of the template to point to your build's output directory.
249249

250250
- For any other problems with the tasks or templates, you can reach out to the [.NET Engineering

azure-pipelines-pr.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ stages:
165165
/p:DotNetSymbolServerTokenSymWeb=DryRunPTA
166166
/p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/'
167167
/p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/'
168-
/p:SymbolPublishingExclusionsFile='$(Build.SourcesDirectory)/eng/SymbolPublishingExclusionsFile.txt'
168+
/p:SymbolPublishingExclusionsFile='$(System.DefaultWorkingDirectory)/eng/SymbolPublishingExclusionsFile.txt'
169169
/p:Configuration=Release
170170
/p:PublishToMSDL=false
171171
- powershell: eng\common\build.ps1
@@ -175,8 +175,8 @@ stages:
175175
-restore
176176
-test
177177
-warnAsError $false
178-
-projects $(Build.SourcesDirectory)\tests\UnitTests.proj
179-
/bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\Helix.binlog
178+
-projects $(System.DefaultWorkingDirectory)\tests\UnitTests.proj
179+
/bl:$(System.DefaultWorkingDirectory)\artifacts\log\$(_BuildConfig)\Helix.binlog
180180
/p:RestoreUsingNuGetTargets=false
181181
displayName: Run Helix Tests
182182
env:
@@ -205,8 +205,8 @@ stages:
205205
--restore
206206
--test
207207
--warnAsError false
208-
--projects $(Build.SourcesDirectory)/tests/UnitTests.proj
209-
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/Helix.binlog
208+
--projects $(System.DefaultWorkingDirectory)/tests/UnitTests.proj
209+
/bl:$(System.DefaultWorkingDirectory)/artifacts/log/$(_BuildConfig)/Helix.binlog
210210
/p:RestoreUsingNuGetTargets=false
211211
displayName: Run Helix Tests
212212
env:
@@ -250,8 +250,8 @@ stages:
250250
-restore
251251
-test
252252
-warnAsError false
253-
-projects $(Build.SourcesDirectory)/tests/XHarness.Apple.SimulatorTests.proj
254-
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/XHarness.Apple.Simulator.Tests.binlog
253+
-projects $(System.DefaultWorkingDirectory)/tests/XHarness.Apple.SimulatorTests.proj
254+
/bl:$(System.DefaultWorkingDirectory)/artifacts/log/$(_BuildConfig)/XHarness.Apple.Simulator.Tests.binlog
255255
/p:RestoreUsingNuGetTargets=false
256256
displayName: XHarness Apple Simulator Helix Testing
257257
env:
@@ -280,8 +280,8 @@ stages:
280280
-restore
281281
-test
282282
-warnAsError false
283-
-projects $(Build.SourcesDirectory)/tests/XHarness.Apple.DeviceTests.proj
284-
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/Helix.XHarness.Apple.Device.Tests.binlog
283+
-projects $(System.DefaultWorkingDirectory)/tests/XHarness.Apple.DeviceTests.proj
284+
/bl:$(System.DefaultWorkingDirectory)/artifacts/log/$(_BuildConfig)/Helix.XHarness.Apple.Device.Tests.binlog
285285
/p:RestoreUsingNuGetTargets=false
286286
displayName: XHarness Apple Device Helix Testing
287287
env:
@@ -310,8 +310,8 @@ stages:
310310
-restore
311311
-test
312312
-warnAsError false
313-
-projects $(Build.SourcesDirectory)/tests/XHarness.Android.SimulatorTests.proj
314-
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/Helix.XHarness.Android.Simulator.Tests.binlog
313+
-projects $(System.DefaultWorkingDirectory)/tests/XHarness.Android.SimulatorTests.proj
314+
/bl:$(System.DefaultWorkingDirectory)/artifacts/log/$(_BuildConfig)/Helix.XHarness.Android.Simulator.Tests.binlog
315315
/p:RestoreUsingNuGetTargets=false
316316
displayName: XHarness Android Helix Testing (Linux)
317317
env:
@@ -339,8 +339,8 @@ stages:
339339
-restore
340340
-test
341341
-warnAsError $false
342-
-projects $(Build.SourcesDirectory)\tests\XHarness.Android.DeviceTests.proj
343-
/bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\Helix.XHarness.Android.Device.Tests.binlog
342+
-projects $(System.DefaultWorkingDirectory)\tests\XHarness.Android.DeviceTests.proj
343+
/bl:$(System.DefaultWorkingDirectory)\artifacts\log\$(_BuildConfig)\Helix.XHarness.Android.Device.Tests.binlog
344344
/p:RestoreUsingNuGetTargets=false
345345
displayName: XHarness Android Helix Testing (Windows)
346346
env:

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@ extends:
126126
-TsaRepositoryName "Arcade"
127127
-TsaCodebaseName "Arcade"
128128
-TsaPublish $True
129-
-PoliCheckAdditionalRunConfigParams @("UserExclusionPath < $(Build.SourcesDirectory)/eng/PoliCheckExclusions.xml")'
129+
-PoliCheckAdditionalRunConfigParams @("UserExclusionPath < $(System.DefaultWorkingDirectory)/eng/PoliCheckExclusions.xml")'

0 commit comments

Comments
 (0)