Skip to content
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

Make SmokeTests use repo infrastructure #19290

Merged
merged 79 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 76 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
a3a75bd
Make SmokeTests use repo infrastructure
ViktorHofer Apr 3, 2024
15501b2
PR feedback
ViktorHofer Apr 3, 2024
29a19a4
Fixes
ViktorHofer Apr 3, 2024
1b35086
More PR feedback
ViktorHofer Apr 3, 2024
1f6c7e9
Better calculate SdkTarballPath and SourceBuiltSdkVersion
ViktorHofer Apr 3, 2024
a8ae19c
Clean-up
ViktorHofer Apr 3, 2024
1b96515
Merge branch 'main' into RefactorSmokeTests
ViktorHofer Apr 3, 2024
45cdca3
Add restore flag
ViktorHofer Apr 4, 2024
c1b59a7
Merge branch 'RefactorSmokeTests' of https://github.com/dotnet/instal…
ViktorHofer Apr 4, 2024
812c3d9
Fix bugs
ViktorHofer Apr 4, 2024
025bfe6
Fix SDK version
ViktorHofer Apr 4, 2024
b1b8fc9
YML updates
ViktorHofer Apr 4, 2024
9552f76
nit
ViktorHofer Apr 4, 2024
6263ca4
Merge branch 'main' into RefactorSmokeTests
ViktorHofer Apr 4, 2024
ba97bfa
Update Config.cs
ViktorHofer Apr 4, 2024
0169f88
Update build.ps1
ViktorHofer Apr 4, 2024
0d06bd5
More fixes and clean-up
ViktorHofer Apr 4, 2024
594b289
More fixes and clean-up
ViktorHofer Apr 4, 2024
458085f
Updates to smoketest dependency and revert most of DetermineSourceBui…
ViktorHofer Apr 4, 2024
53c3f02
Fix missing Project tag
ViktorHofer Apr 4, 2024
d4727b9
Revert the non desirable changes in instaler.proj
ViktorHofer Apr 4, 2024
33709bd
Missed one
ViktorHofer Apr 4, 2024
4e1ecae
One more
ViktorHofer Apr 4, 2024
0709b16
Improve condition in smoketests
ViktorHofer Apr 4, 2024
d8de1bd
Fix windows script
ViktorHofer Apr 4, 2024
a509077
Fix missing \
ViktorHofer Apr 4, 2024
5af6d28
Add verbosity
ViktorHofer Apr 4, 2024
8ee8c9f
Allow to override nuget cache and don't incrementally re-build VMR fo…
ViktorHofer Apr 4, 2024
486fed2
Comment indentation in YML
ViktorHofer Apr 4, 2024
d8b6ace
Update sdk-diff-tests.yml
ViktorHofer Apr 4, 2024
531c354
Restore tasks correctly and avoid locking issues
ViktorHofer Apr 4, 2024
ded55a3
Merge branch 'RefactorSmokeTests' of https://github.com/dotnet/instal…
ViktorHofer Apr 4, 2024
6cc17e1
Don't set NUGET_PACKAGES
ViktorHofer Apr 4, 2024
3b79346
Fix unbound variable
ViktorHofer Apr 4, 2024
38ad0a8
Merge remote-tracking branch 'origin/main' into RefactorSmokeTests
ViktorHofer Apr 4, 2024
f385b51
Update Microsoft.DotNet.UnifiedBuild.Tests.csproj
ViktorHofer Apr 4, 2024
bdfacca
Update vmr-build.yml
ViktorHofer Apr 4, 2024
3a6300f
Update Directory.Build.props
ViktorHofer Apr 4, 2024
d0666dc
Update Directory.Build.props
ViktorHofer Apr 4, 2024
987bd49
Update Directory.Build.props
ViktorHofer Apr 4, 2024
239ef21
Update README.md
ViktorHofer Apr 4, 2024
a8a4eb3
Fix NuGetPackageRoot
ViktorHofer Apr 4, 2024
1d15c16
Merge branch 'RefactorSmokeTests' of https://github.com/dotnet/instal…
ViktorHofer Apr 4, 2024
5001dfa
Really fix NuGetPackageRoot
ViktorHofer Apr 4, 2024
fb35970
Pass NUGET_PACKAGES to nuget-client
ViktorHofer Apr 4, 2024
d00d93d
Ignore smoke-tests package cache
ViktorHofer Apr 5, 2024
3f92629
Fix test invocation
ViktorHofer Apr 5, 2024
5109ea5
Fix binlog switch
ViktorHofer Apr 5, 2024
2322341
Add testNoBuild and fixes
ViktorHofer Apr 5, 2024
9644e02
Update build.ps1
ViktorHofer Apr 5, 2024
4757b02
Fix variable name
ViktorHofer Apr 5, 2024
ff44007
Update Microsoft.DotNet.SourceBuild.SmokeTests.csproj
ViktorHofer Apr 5, 2024
658c597
Set IsTestProject early enough
ViktorHofer Apr 5, 2024
6212fbc
Merge branch 'main' into RefactorSmokeTests
ViktorHofer Apr 5, 2024
711270c
Use IsUnitTestProject instead
ViktorHofer Apr 5, 2024
40176db
PR feedback
ViktorHofer Apr 5, 2024
52f69fc
Respect externally provided LogDirectory in tests
ViktorHofer Apr 5, 2024
540487f
Update artifacts logs lookup in YML
ViktorHofer Apr 5, 2024
1ed428d
Use TestResultsDir and improve paths
ViktorHofer Apr 5, 2024
db4436e
Fix test execution and introduce TestUtilities project
ViktorHofer Apr 6, 2024
73c57a4
Merge remote-tracking branch 'origin/main' into RefactorSmokeTests
ViktorHofer Apr 6, 2024
a0873f6
More test fixes
ViktorHofer Apr 6, 2024
dc42e60
Simplify TestExtensions
ViktorHofer Apr 6, 2024
e5b83be
Entry-point fixes
ViktorHofer Apr 6, 2024
4a6ddca
Fix NuGetPackagesRoot and log filename
ViktorHofer Apr 6, 2024
3d69206
Add dotnet-eng online feed for smoke tests
ViktorHofer Apr 6, 2024
e0c777b
Don't use dotnet-eng or repo infra for smoke tests
ViktorHofer Apr 6, 2024
74c74a3
Upload artifacts also in failure case
ViktorHofer Apr 7, 2024
e83b6b8
Throw in case of not found tar artifact
ViktorHofer Apr 7, 2024
95c0a32
Downgrade version to 8.0.0 to avoid breaking change
ViktorHofer Apr 7, 2024
6eedd6b
Merge branch 'main' into RefactorSmokeTests
ViktorHofer Apr 8, 2024
911b11c
Include trx files in artifacts log publish
ViktorHofer Apr 8, 2024
3a9a7ba
Update vmr-build.yml
ViktorHofer Apr 8, 2024
ed0a320
Update SourceBuiltArtifactsTests.cs
ViktorHofer Apr 8, 2024
830d0ef
Remove --test-no-build/-testNoBuild switch
ViktorHofer Apr 8, 2024
3380d9f
Update xunit namespace to TestUtilities
ViktorHofer Apr 8, 2024
2f75f98
Fix build error in TestUtilities
ViktorHofer Apr 8, 2024
0c6058e
Fix compliation error and revert artifacts change
ViktorHofer Apr 8, 2024
9976f8a
revert unnecessary changes in SourceBuiltArtifactsTests
ViktorHofer Apr 8, 2024
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
40 changes: 24 additions & 16 deletions eng/pipelines/templates/jobs/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ jobs:
call $(sourcesPath)\build.cmd -ci -cleanWhileBuilding -prepareMachine /p:TargetOS=${{ parameters.targetOS }} /p:TargetArchitecture=${{ parameters.targetArchitecture }} ${{ parameters.extraProperties }}
displayName: Build

- ${{ if eq(parameters.runTests, 'True') }}:
- script: |
call $(sourcesPath)\build.cmd -ci -prepareMachine -test ${{ parameters.extraProperties }}
displayName: Run Tests

- ${{ else }}:
- ${{ if eq(parameters.buildSourceOnly, 'true') }}:
- script: |
Expand Down Expand Up @@ -356,14 +361,13 @@ jobs:
set -ex

dockerVolumeArgs="-v $(sourcesPath):/vmr"
dockerEnvArgs="-e SMOKE_TESTS_EXCLUDE_OMNISHARP=${{ parameters.excludeOmniSharpTests }} -e SMOKE_TESTS_WARN_SDK_CONTENT_DIFFS=true -e SMOKE_TESTS_RUNNING_IN_CI=true"
poisonArg=''

if [[ '${{ parameters.enablePoison }}' == 'True' ]]; then
poisonArg='--poison'
fi

docker run --rm $dockerVolumeArgs -w /vmr $dockerEnvArgs ${{ parameters.container }} ./build.sh --source-only $poisonArg --test $(additionalBuildArgs) /p:SmokeTestConsoleVerbosity=detailed
docker run --rm $dockerVolumeArgs -w /vmr ${{ parameters.container }} ./build.sh /bl:artifacts/log/Release/Test.binlog --source-only --test $poisonArg $(additionalBuildArgs) /p:SmokeTestsWarnOnSdkContentDiffs=true /p:SmokeTestsExcludeOmniSharpTests=${{ parameters.excludeOmniSharpTests }}
displayName: Run Tests

- ${{ if eq(parameters.targetOS, 'windows') }}:
Expand All @@ -383,14 +387,14 @@ jobs:

cd "$(sourcesPath)"

CopyWithRelativeFolders "artifacts/" $targetFolder "*.binlog"
CopyWithRelativeFolders "artifacts/" $targetFolder "*.log"
CopyWithRelativeFolders "artifacts/" $targetFolder "*.diff"
CopyWithRelativeFolders "artifacts/log/" $targetFolder "*.binlog"
CopyWithRelativeFolders "artifacts/log/" $targetFolder "*.log"
CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "*.binlog"
CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "*.diff"
CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "Updated*.txt"
CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "*.trx"
CopyWithRelativeFolders "src/" $targetFolder "*.binlog"
CopyWithRelativeFolders "src/" $targetFolder "*.log"
CopyWithRelativeFolders "test/" $targetFolder "*.binlog"
CopyWithRelativeFolders "test/" $targetFolder "Updated*.diff"
CopyWithRelativeFolders "test/" $targetFolder "Updated*.txt"
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved

# check if we have assets to publish
if (Test-Path "artifacts/assets/Release/*") {
Expand All @@ -410,18 +414,20 @@ jobs:
mkdir -p ${targetFolder}

cd "$(sourcesPath)"
find artifacts/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
find artifacts/ -type f -name "*.log" -exec rsync -R {} -t ${targetFolder} \;
find artifacts/ -type f -name "*.diff" -exec rsync -R {} -t ${targetFolder} \;
find artifacts/log/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
find artifacts/log/ -type f -name "*.log" -exec rsync -R {} -t ${targetFolder} \;
find artifacts/TestResults/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
find artifacts/TestResults/ -type f -name "*.diff" -exec rsync -R {} -t ${targetFolder} \;
find artifacts/TestResults/ -type f -name "Updated*.txt" -exec rsync -R {} -t ${targetFolder} \;
find artifacts/TestResults/ -type f -name "*.trx" -exec rsync -R {} -t ${targetFolder} \;

if [[ "${{ parameters.buildSourceOnly }}" == "True" ]]; then
find artifacts/prebuilt-report/ -exec rsync -R {} -t ${targetFolder} \;
find artifacts/log/binary-report/ -exec rsync -R {} -t ${targetFolder} \;
fi

find src/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
find src/ -type f -name "*.log" -exec rsync -R {} -t ${targetFolder} \;
find test/ -type f -name "*.binlog" -exec rsync -R {} -t ${targetFolder} \;
find test/ -type f -name "Updated*.diff" -exec rsync -R {} -t ${targetFolder} \;
find test/ -type f -name "Updated*.txt" -exec rsync -R {} -t ${targetFolder} \;

# check if we have assets to publish
if [ -n "$(ls -A 'artifacts/assets/Release/')" ]; then
Expand All @@ -446,11 +452,11 @@ jobs:
continueOnError: true
inputs:
testRunner: vSTest
testResultsFiles: 'test/**/*.trx'
testResultsFiles: 'artifacts/TestResults/Release/*.trx'
searchFolder: $(sourcesPath)
mergeTestResults: true
publishRunAttachments: true
testRunTitle: SourceBuild_SmokeTests_$(Agent.JobName)
testRunTitle: Tests_$(Agent.JobName)

- task: CopyFiles@2
inputs:
Expand All @@ -460,6 +466,7 @@ jobs:
assets/**
TargetFolder: $(Build.ArtifactStagingDirectory)/publishing
displayName: Copy artifacts to Artifact Staging Directory
condition: succeededOrFailed()

# When building from source, the Private.SourceBuilt.Artifacts archive already contains the nuget packages
- ${{ if ne(parameters.buildSourceOnly, 'true') }}:
Expand All @@ -468,6 +475,7 @@ jobs:
SourceFolder: $(sourcesPath)/artifacts/packages
TargetFolder: $(Build.ArtifactStagingDirectory)/publishing/packages
displayName: Copy packages to Artifact Staging Directory
condition: succeededOrFailed()

- ${{ if or(ne(variables['System.TeamProject'], 'internal'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- publish: $(Build.ArtifactStagingDirectory)/publishing
Expand Down
3 changes: 0 additions & 3 deletions src/SourceBuild/content/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@
/artifacts
/prereqs/packages
/src/nuget-client/NuGet.config
/test/Microsoft.DotNet.SourceBuild.SmokeTests/bin
/test/Microsoft.DotNet.SourceBuild.SmokeTests/obj
/test/Microsoft.DotNet.SourceBuild.SmokeTests/TestResults
*.binlog
12 changes: 8 additions & 4 deletions src/SourceBuild/content/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,18 @@
<TargetRid Condition="'$(ShortStack)' == 'true' and '$(TargetOS)' == 'windows'">win-$(TargetArchitecture)</TargetRid>
</PropertyGroup>

<!-- Set NuGetPackageRoot before Arcade SDK sets it. -->
<PropertyGroup>
<!-- Set RestorePackagesPath so that we don't accidentally pull some packages from the global location. -->
<RestorePackagesPath Condition="'$(RestorePackagesPath)' == ''">$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', '.packages'))</RestorePackagesPath>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == ''">$(RestorePackagesPath)</NuGetPackageRoot>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" Condition="'$(SkipArcadeSdkImport)' != 'true'" />

<!-- Init basic Arcade props, if the project importing this file doesn't use Arcade.
Keep in sync with props/targets in the Arcade.Sdk. -->
<PropertyGroup Condition="'$(SkipArcadeSdkImport)' == 'true'">
<!-- RepoLayout.props -->
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' != ''">$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)'))</NuGetPackageRoot>
<NuGetPackageRoot Condition="'$(NuGetPackageRoot)' == '' and '$(NUGET_PACKAGES)' != ''">$([MSBuild]::NormalizeDirectory('$(NUGET_PACKAGES)'))</NuGetPackageRoot>

<RepoRoot Condition="'$(RepoRoot)' == ''">$([MSBuild]::NormalizeDirectory('$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'global.json'))'))</RepoRoot>

<!-- Respect environment variable for the .NET install directory if set; otherwise, use the repo default location -->
Expand Down Expand Up @@ -212,6 +215,7 @@
<PoisonMarkerFile>.prebuilt.xml</PoisonMarkerFile>
<PoisonReportDataFile>$(PackageReportDir)poison-catalog.xml</PoisonReportDataFile>
<PoisonedReportFile>$(PackageReportDir)poisoned.txt</PoisonedReportFile>
<PoisonUsageReportFile>$(PackageReportDir)poison-usage.xml</PoisonUsageReportFile>
</PropertyGroup>

</Project>
10 changes: 6 additions & 4 deletions src/SourceBuild/content/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@
<PropertyGroup>
<SdkFilenamePrefix>dotnet-sdk-</SdkFilenamePrefix>
</PropertyGroup>

<ItemGroup>
<SdkTarballItem Include="$(ArtifactsAssetsDir)Sdk/**/$(SdkFilenamePrefix)*$(ArchiveExtension)" />
</ItemGroup>

<!--
Extract SDK version from SDK tarball filename.
Keep in sync with dotnet-sdk's archive location and filename.

Example:
dotnet-sdk-9.0.100-alpha.1.24057.1-fedora.38-x64.tar.gz
dotnet-sdk-<SdkVersion>-<TargetRid><ArchiveExtension>
artifacts\assets\<config>\Sdk\9.0.100-alpha.1.24057.1\dotnet-sdk-9.0.100-alpha.1.24057.1-fedora.38-x64.tar.gz
artifacts\assets\<config>\Sdk\<SdkVersion>\dotnet-sdk-<SdkVersion>-<TargetRid><ArchiveExtension>
-->
<PropertyGroup>
<SdkFilename>%(SdkTarballItem.Filename)%(SdkTarballItem.Extension)</SdkFilename>
<SdkTarballPath>%(SdkTarballItem.Identity)</SdkTarballPath>
<SdkTarballPath Condition="'$(SdkTarballPath)' == ''">%(SdkTarballItem.Identity)</SdkTarballPath>
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<SourceBuiltSdkVersion>$(SdkFilename.Replace('$(SdkFilenamePrefix)','').Replace('-$(TargetRid)$(ArchiveExtension)',''))</SourceBuiltSdkVersion>
</PropertyGroup>
</Target>

</Project>
</Project>
4 changes: 4 additions & 0 deletions src/SourceBuild/content/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
<PackageVersion Include="Microsoft.Extensions.FileSystemGlobbing" Version="$(MicrosoftExtensionsFileSystemGlobbingVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="$(MicrosoftExtensionsLoggingConsoleVersion)" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsLoggingVersion)" />
<!-- External dependencies -->
<PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageVersion Include="xunit.extensibility.core" Version="$(XUnitVersion)" />
<PackageVersion Include="xunit.extensibility.execution" Version="$(XUnitVersion)" />
</ItemGroup>

</Project>
30 changes: 10 additions & 20 deletions src/SourceBuild/content/build.proj
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Project Sdk="Microsoft.Build.Traversal">

<PropertyGroup>
<!-- Fake, to satisfy the SDK. -->
<TargetFramework>netstandard2.0</TargetFramework>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(ToolsDir)init-build.proj" BuildInParallel="false" />
<ProjectReference Include="$(RepoProjectsDir)$(RootRepo).proj" BuildInParallel="false" />
</ItemGroup>

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

<Target Name="Build">
<Target Name="PrintInfo" BeforeTargets="Build">
<PropertyGroup>
<BuildModeInfoText Condition="'$(DotNetBuildSourceOnly)' == 'true'">source-build</BuildModeInfoText>
<BuildModeInfoText Condition="'$(DotNetBuildSourceOnly)' != 'true'">non-source-build</BuildModeInfoText>
</PropertyGroup>

<Message Text="Build Mode: $(BuildModeInfoText)" Importance="high" />
<Message Text="Build Environment: $(TargetArchitecture) $(Configuration) $(TargetOS) $(TargetRid)" Importance="high" />

<MSBuild Projects="$(ToolsDir)init-build.proj;
$(RepoProjectsDir)$(RootRepo).proj"
Targets="Build"
BuildInParallel="false"
StopOnFirstFailure="true" />
</Target>

<!-- Create a merge manifest from the individual repository manifest files. -->
<UsingTask TaskName="Microsoft.DotNet.UnifiedBuild.Tasks.MergeAssetManifests" AssemblyFile="$(MicrosoftDotNetUnifiedBuildTasksAssembly)" />
<UsingTask TaskName="Microsoft.DotNet.UnifiedBuild.Tasks.MergeAssetManifests" AssemblyFile="$(MicrosoftDotNetUnifiedBuildTasksAssembly)" TaskFactory="TaskHostFactory" />
<Target Name="MergeAssetManifests" AfterTargets="Build">
<PropertyGroup>
<PropertyGroup>
<MergedAssetManifestOutputPath>$(ArtifactsDir)VerticalManifest.xml</MergedAssetManifestOutputPath>
</PropertyGroup>

Expand All @@ -48,8 +38,8 @@
<!-- Intentionally below the import to appear at the end. -->
<Target Name="LogBuildOutputFolders"
AfterTargets="Build">
<Message Importance="high" Text="Shipping packages are located in '$(ArtifactsShippingPackagesDir)'." />
<Message Importance="high" Text="Shipping assets are located in '$(ArtifactsAssetsDir)'." />
<Message Importance="high" Text="Shipping packages are located in '$(ArtifactsShippingPackagesDir)'." />
<Message Importance="high" Text="Shipping assets are located in '$(ArtifactsAssetsDir)'." />
</Target>

</Project>
48 changes: 30 additions & 18 deletions src/SourceBuild/content/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ usage()
echo "Actions:"
echo " --clean Clean the solution"
echo " --help Print help and exit (short: -h)"
echo " --test Run smoke tests (short: -t)"
echo " --test Run tests (short: -t)"
echo ""

echo "Source-only settings:"
Expand All @@ -33,7 +33,7 @@ usage()
echo ""

echo "Advanced settings:"
echo " --build-tests Build repository tests. May not be supported with --source-only"
echo " --build-repo-tests Build repository tests. May not be supported with --source-only"
echo " --ci Set when running on CI server"
echo " --clean-while-building Cleans each repo after building (reduces disk space usage, short: -cwb)"
echo " --excludeCIBinarylog Don't output binary log (short: -nobl)"
Expand All @@ -56,10 +56,7 @@ while [[ -h "$source" ]]; do
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"

# Set the NUGET_PACKAGES dir so that we don't accidentally pull some packages from the global location,
# They should be pulled from the local feeds.
packagesRestoredDir="$scriptroot/.packages/"
export NUGET_PACKAGES=$packagesRestoredDir/

# Common settings
binary_log=false
Expand Down Expand Up @@ -112,8 +109,6 @@ while [[ $# > 0 ]]; do
exit 0
;;
-test|-t)
export NUGET_PACKAGES=$NUGET_PACKAGES/smoke-tests
properties="$properties /t:RunSmokeTest"
test=true
;;

Expand Down Expand Up @@ -180,7 +175,6 @@ while [[ $# > 0 ]]; do
-use-mono-runtime)
properties="$properties /p:SourceBuildUseMonoRuntime=true"
;;

*)
properties="$properties $1"
;;
Expand All @@ -195,19 +189,37 @@ if [[ "$ci" == true ]]; then
fi
fi

# Never use the global nuget cache folder
use_global_nuget_cache=false

. "$scriptroot/eng/common/tools.sh"

project="$scriptroot/build.proj"
targets="/t:Build"

# This repo uses the VSTest integration instead of the Arcade Test target
if [[ "$test" == true ]]; then
project="$scriptroot/test/tests.proj"
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved
targets="$targets;VSTest"
fi

function Build {
if [[ "$sourceOnly" != "true" ]]; then

InitializeToolset

# Manually unset NUGET_PACKAGES as InitializeToolset sets it unconditionally.
# The env var shouldn't be set so that the RestorePackagesPath msbuild property is respected.
unset NUGET_PACKAGES

local bl=""
if [[ "$binary_log" == true ]]; then
bl="/bl:\"$log_dir/Build.binlog\""
fi

MSBuild "$scriptroot/build.proj" \
MSBuild --restore \
$project \
$targets \
$bl \
/p:Configuration=$configuration \
$properties
Expand All @@ -220,22 +232,22 @@ function Build {
properties="$properties /p:ContinuousIntegrationBuild=true"
fi

"$CLI_ROOT/dotnet" build-server shutdown

if [ "$test" == "true" ]; then
"$CLI_ROOT/dotnet" msbuild "$scriptroot/build.proj" -bl:"$scriptroot/artifacts/log/$configuration/BuildTests.binlog" -flp:"LogFile=$scriptroot/artifacts/log/$configuration/BuildTests.log" -clp:v=m $properties
else
if [ "$test" != "true" ]; then
"$CLI_ROOT/dotnet" build-server shutdown
"$CLI_ROOT/dotnet" msbuild "$scriptroot/eng/tools/init-build.proj" -bl:"$scriptroot/artifacts/log/$configuration/BuildMSBuildSdkResolver.binlog" -flp:LogFile="$scriptroot/artifacts/log/$configuration/BuildMSBuildSdkResolver.log" /t:ExtractToolsetPackages,BuildMSBuildSdkResolver $properties

# kill off the MSBuild server so that on future invocations we pick up our custom SDK Resolver
"$CLI_ROOT/dotnet" build-server shutdown
fi

# Point MSBuild to the custom SDK resolvers folder, so it will pick up our custom SDK Resolver
export MSBUILDADDITIONALSDKRESOLVERSFOLDER="$scriptroot/artifacts/toolset/VSSdkResolvers/"
# Point MSBuild to the custom SDK resolvers folder, so it will pick up our custom SDK Resolver
export MSBUILDADDITIONALSDKRESOLVERSFOLDER="$scriptroot/artifacts/toolset/VSSdkResolvers/"

"$CLI_ROOT/dotnet" msbuild "$scriptroot/build.proj" -bl:"$scriptroot/artifacts/log/$configuration/Build.binlog" -flp:"LogFile=$scriptroot/artifacts/log/$configuration/Build.log" $properties
local bl=""
if [[ "$binary_log" == true ]]; then
bl="/bl:\"$log_dir/Build.binlog\""
MichaelSimons marked this conversation as resolved.
Show resolved Hide resolved
fi

"$CLI_ROOT/dotnet" msbuild --restore "$project" $bl $targets $properties
fi
}

Expand Down
16 changes: 9 additions & 7 deletions src/SourceBuild/content/eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@
-->
<PrivateSourceBuiltSdkVersion>9.0.100-preview.4.24179.1</PrivateSourceBuiltSdkVersion>
<PrivateSourceBuiltArtifactsVersion>9.0.100-preview.4.24179.1</PrivateSourceBuiltArtifactsVersion>
<!-- msbuild -->
<MicrosoftBuildVersion>17.8.3</MicrosoftBuildVersion>
<!-- runtime -->
<MicrosoftExtensionsFileSystemGlobbingVersion>9.0.0-preview.2.24128.5</MicrosoftExtensionsFileSystemGlobbingVersion>
<MicrosoftExtensionsLoggingConsoleVersion>9.0.0-preview.2.24128.5</MicrosoftExtensionsLoggingConsoleVersion>
<MicrosoftExtensionsLoggingVersion>9.0.0-preview.2.24128.5</MicrosoftExtensionsLoggingVersion>
<!-- command-line-api -->
<!-- command-line-api dependencies -->
<SystemCommandLineVersion>2.0.0-beta4.24126.1</SystemCommandLineVersion>
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved
<!-- msbuild dependencies -->
<MicrosoftBuildVersion>17.8.3</MicrosoftBuildVersion>
<!-- runtime dependencies -->
<MicrosoftExtensionsFileSystemGlobbingVersion>8.0.0</MicrosoftExtensionsFileSystemGlobbingVersion>
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved
<MicrosoftExtensionsLoggingConsoleVersion>8.0.0</MicrosoftExtensionsLoggingConsoleVersion>
<MicrosoftExtensionsLoggingVersion>8.0.0</MicrosoftExtensionsLoggingVersion>
<!-- external dependencies -->
<NewtonsoftJsonVersion>13.0.3</NewtonsoftJsonVersion>
</PropertyGroup>
</Project>
Loading
Loading