diff --git a/.gitignore b/.gitignore index 0a4f2519c8..8834240e88 100644 --- a/.gitignore +++ b/.gitignore @@ -279,3 +279,4 @@ testing-smoke/ # UpdateDependenciesAndSubmitPullRequest: if no upgrades are performed, the # sanity check fails when "git status" shows this file. msbuild.ProjectImports.zip +Build_*.ProjectImports.zip diff --git a/Directory.Build.props b/Directory.Build.props index 99d2e570e5..8247c3ee01 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -202,10 +202,13 @@ known-good known-good-tests - - - - + + + + $(BaseIntermediatePath)semaphores/ + + Condition="'$(OfflineBuild)' != 'true' and '$(ArchiveDownloadedPackages)' == 'true' and '$(OS)' != 'Windows_NT'" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(CompletedSemaphorePath)CopyAndDisassembleReferenceOnlyPackages.complete" > + + + Condition="'$(OfflineBuild)' != 'true' and '$(OS)' != 'Windows_NT' and '$(SkipDownloadingReferencePackages)' != 'true'" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(CompletedSemaphorePath)DownloadSourceBuildReferencePackages.complete" > 600 @@ -157,11 +163,15 @@ SourceUrl="$(ReferencePackagesTarballUrl)$(ReferencePackagesTarballName).$(PrivateSourceBuildReferencePackagesPackageVersion).tar.gz" DestinationFolder="$(ExternalTarballsDir)" TimeoutSeconds="$(DownloadSourceBuildReferencePackagesTimeoutSeconds)" /> + + + Condition="'$(OfflineBuild)' != 'true' and '$(OS)' != 'Windows_NT' and '$(SkipDownloadingPreviouslySourceBuiltPackages)' != 'true'" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(CompletedSemaphorePath)DownloadSourceBuiltArtifacts.complete" > 1500 @@ -170,6 +180,8 @@ SourceUrl="$(SourceBuiltArtifactsTarballUrl)$(SourceBuiltArtifactsTarballName).$(PrivateSourceBuiltArtifactsPackageVersion).tar.gz" DestinationFolder="$(ExternalTarballsDir)" TimeoutSeconds="$(DownloadSourceBuiltArtifactsTimeoutSeconds)" /> + + @@ -191,7 +203,9 @@ + Condition="'$(EnablePoison)' == 'true' and '$(OfflineBuild)' == 'true'" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(CompletedSemaphorePath)ReportPoisonUsage.complete" > @@ -199,15 +213,21 @@ HashCatalogFilePath="$(PoisonReportDataFile)" MarkerFileName="$(PoisonMarkerFile)" PoisonReportOutputFilePath="$(PoisonUsageReportFile)" /> + + - + + + diff --git a/build.sh b/build.sh index 640f6163ad..923aa5aba3 100755 --- a/build.sh +++ b/build.sh @@ -134,5 +134,5 @@ scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" if [ "$alternateTarget" == "true" ]; then "$CLIPATH/dotnet" $SDKPATH/MSBuild.dll "$scriptroot/build.proj" /bl:source-build-test.binlog /flp:v=diag /clp:v=m "$@" else - "$scriptroot/eng/common/build.sh" --restore --build -c Release --warnaserror false -bl /flp:v=diag "$@" + "$scriptroot/eng/common/build.sh" --restore --build -c Release --warnaserror false /bl:$scriptroot/artifacts/log/Debug/Build_$(date +"%m%d%H%M%S").binlog /flp:v=diag "$@" fi diff --git a/repos/Directory.Build.props b/repos/Directory.Build.props index 280ac79f19..0244f3e19d 100644 --- a/repos/Directory.Build.props +++ b/repos/Directory.Build.props @@ -32,6 +32,11 @@ $(LoggingDir)$(RepositoryName).log >> $(RepoConsoleLogFile) 2>&1 true + + + $(CompletedSemaphorePath)$(RepositoryName)/ diff --git a/repos/Directory.Build.targets b/repos/Directory.Build.targets index a2b8ba0c55..1538866d00 100644 --- a/repos/Directory.Build.targets +++ b/repos/Directory.Build.targets @@ -66,10 +66,14 @@ - - - - + + + + + git --work-tree=$(ProjectDirectory) apply --ignore-whitespace --whitespace=nowarn @@ -78,11 +82,15 @@ + + + Condition="'$(NuGetConfigFile)' != '' OR '@(NuGetConfigFiles)' != ''" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)UpdateNuGetConfig.complete"> @@ -123,11 +131,15 @@ NuGetConfigFile="%(NuGetConfigFiles.Identity)" SourceName="dotnet3.1-internal-transport" SourcePath="https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json" /> + + + Condition="'$(GlobalJsonFile)' != ''" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)UpdateGlobalJsonVersions.complete"> <_PossibleCliVersionJsonPath Include="sdk.version" /> <_PossibleCliVersionJsonPath Include="tools.dotnet" /> @@ -137,10 +149,14 @@ PathToAttribute="%(_PossibleCliVersionJsonPath.Identity)" NewAttributeValue="$(SDK_VERSION)" SkipUpdateIfMissingKey="true" /> + + + BeforeTargets="Build" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)CreateBuildOutputProps.complete"> <_PackageVersionPropsBackupPath>$(PackageVersionPropsPath).pre.$(RepositoryName).xml @@ -178,12 +194,15 @@ + + Condition="'@(ConflictingPackageInfos)' != ''" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)CheckSourceBuiltNupkgConflictUsages.complete"> <_ReportDir>$(ConflictingPackageReportDir)before-$(RepositoryName)/ <_ReportDataFile>$(_ReportDir)usage.xml @@ -200,10 +219,14 @@ + + + BeforeTargets="Build" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)CreateCombinedRestoreSourceAndVersionProps.complete"> <_DotNetRestoreSources Include="$(SourceBuiltPackagesPath)" /> <_DotNetRestoreSources Include="$(ReferencePackagesDir)" Condition="'$(OfflineBuild)' == 'true'"/> @@ -218,6 +241,8 @@ AdditionalAssetDirs="@(_AdditionalAssetDirs)" RestoreSources="@(_DotNetRestoreSources)" OutputPath="$(RestoreSourcePropsPath)" /> + + + BeforeTargets="Build" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)PreventDirectoryBuildPropsTargetsEscape.complete"> @@ -236,9 +263,14 @@ Lines="<Project />" File="$([MSBuild]::NormalizePath('$(ClonedSubmoduleDirectory)', '%(DirectoryBuildFilename.Identity)'))" Overwrite="True" /> + + - + @@ -248,6 +280,8 @@ + + @@ -271,7 +305,10 @@ - + @@ -283,6 +320,8 @@ EnvironmentVariables="@(EnvironmentVariables)" IgnoreStandardErrorWarningFormat="true" /> + + @@ -297,16 +336,22 @@ + DependsOnTargets="GatherBuiltPackages" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)CopyPackage.complete"> + + + DependsOnTargets="GatherBuiltPackages" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)RemoveBuiltPackagesFromCache.complete"> @@ -321,12 +366,16 @@ + + + Condition="'@(BuiltSdkPackageOverride)' != ''" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)ExtractToolPackage.complete"> <_ToolPackage Condition="'%(BuiltSdkPackageOverride.Version)' == ''" @@ -348,11 +397,15 @@ + + + Condition="'$(SkipEnsurePackagesCreated)' != 'true'" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)EnsurePackagesCreated.complete"> + + @@ -410,7 +465,9 @@ + DependsOnTargets="GetAllProjectDirectories" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)WritePrebuiltUsageData.complete"> @@ -456,7 +513,9 @@ IgnoredProjectAssetsJsonFiles="@(IgnoredProjectAssetsJsonFiles)" DataFile="$(PackageReportDataFile)" ProjectAssetsJsonArchiveFile="$(ProjectAssetsJsonArchiveFile)" /> - + + + @@ -471,7 +530,9 @@ - + false @@ -498,6 +559,8 @@ OutputReportFile="$(PackageReportDir)baseline-comparison.xml" AllowTestProjectUsage="$(AllowTestProjectUsage)" ContinueOnError="$(ContinueOnPrebuiltBaselineError)" /> + + diff --git a/repos/aspnetcore.proj b/repos/aspnetcore.proj index 56a7d52c93..b4bd5e9e3e 100644 --- a/repos/aspnetcore.proj +++ b/repos/aspnetcore.proj @@ -71,7 +71,10 @@ - + @@ -84,6 +87,8 @@ + + diff --git a/repos/core-sdk.proj b/repos/core-sdk.proj index 3cc8a5f9d9..f7b426177c 100644 --- a/repos/core-sdk.proj +++ b/repos/core-sdk.proj @@ -98,7 +98,10 @@ - + @@ -106,6 +109,8 @@ + + diff --git a/repos/core-setup.common.targets b/repos/core-setup.common.targets index 6c0ef2c68c..81c6ecebd5 100644 --- a/repos/core-setup.common.targets +++ b/repos/core-setup.common.targets @@ -5,7 +5,10 @@ - + @@ -15,9 +18,14 @@ + + - + <_builtRuntimePackages Include="$(SourceBuiltAssetsDir)*.symbols.nupkg" /> <_builtRuntimePackages> @@ -30,6 +38,8 @@ + + diff --git a/repos/coreclr-portable.proj b/repos/coreclr-portable.proj index 3973f21ebc..378547eae6 100644 --- a/repos/coreclr-portable.proj +++ b/repos/coreclr-portable.proj @@ -15,7 +15,9 @@ + AfterTargets="Package" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)CopyTools.complete"> $(ToolPackageExtractDir)coreclr-tools so @@ -34,6 +36,8 @@ + + diff --git a/repos/linker.proj b/repos/linker.proj index 9390d1e234..5ea5c5a341 100644 --- a/repos/linker.proj +++ b/repos/linker.proj @@ -33,7 +33,9 @@ + AfterTargets="Package" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)ExtractLinkerPackageToCache.complete"> $(PackagesOutput)/$(ILLinkTasksPackageId).$(OutputPackageVersion).nupkg $(ILLinkTasksPackageId.ToLowerInvariant()) @@ -44,7 +46,9 @@ - + + + diff --git a/repos/msbuild.proj b/repos/msbuild.proj index b9443f9a65..4fdcc909ca 100644 --- a/repos/msbuild.proj +++ b/repos/msbuild.proj @@ -81,7 +81,9 @@ + Condition="'$(OfflineBuild)' == 'true'" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(RepoCompletedSemaphorePath)ExtractCentralPackageVersionsSdkPackage.complete"> <_CentralVersionsToolPackage Include="$(ReferencePackagesDir)%(CentralPackageVersionsSdkOverride.Identity)*.nupkg" @@ -98,6 +100,8 @@ SourceArchive="@(_CentralVersionsToolPackage)" DestinationDirectory="$(CentralVersionsSdkDir)" OverwriteDestination="true" /> + + - + @@ -77,6 +80,8 @@ + + diff --git a/support/tarball/build.sh b/support/tarball/build.sh index 886b868470..60b6bedf07 100755 --- a/support/tarball/build.sh +++ b/support/tarball/build.sh @@ -142,10 +142,11 @@ export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 export NUGET_PACKAGES=$restoredPackagesDir/ -$CLI_ROOT/dotnet $CLI_ROOT/sdk/$SDK_VERSION/MSBuild.dll /bl:BuildXPlatTasks.binlog $SCRIPT_ROOT/tools-local/init-build.proj /t:PrepareOfflineLocalTools ${MSBUILD_ARGUMENTS[@]} "$@" +LogDateStamp=$(date +"%m%d%H%M%S") +$CLI_ROOT/dotnet $CLI_ROOT/sdk/$SDK_VERSION/MSBuild.dll /bl:$SCRIPT_ROOT/artifacts/log/Debug/BuildXPlatTasks_$LogDateStamp.binlog $SCRIPT_ROOT/tools-local/init-build.proj /t:PrepareOfflineLocalTools ${MSBUILD_ARGUMENTS[@]} "$@" echo "Rebuild reference assemblies" -$CLI_ROOT/dotnet $CLI_ROOT/sdk/$SDK_VERSION/MSBuild.dll /bl:initBuildReferenceAssemblies.binlog $SCRIPT_ROOT/tools-local/init-build.proj /t:BuildReferenceAssemblies ${MSBUILD_ARGUMENTS[@]} "$@" +$CLI_ROOT/dotnet $CLI_ROOT/sdk/$SDK_VERSION/MSBuild.dll /bl:$SCRIPT_ROOT/artifacts/log/Debug/initBuildReferenceAssemblies_$LogDateStamp.binlog $SCRIPT_ROOT/tools-local/init-build.proj /t:BuildReferenceAssemblies ${MSBUILD_ARGUMENTS[@]} "$@" -$CLI_ROOT/dotnet $CLI_ROOT/sdk/$SDK_VERSION/MSBuild.dll /bl:initWriteDynamicPropsToStaticPropsFiles.binlog $SCRIPT_ROOT/tools-local/init-build.proj /t:WriteDynamicPropsToStaticPropsFiles /p:GeneratingStaticPropertiesFile=true ${MSBUILD_ARGUMENTS[@]} "$@" -$CLI_ROOT/dotnet $CLI_ROOT/sdk/$SDK_VERSION/MSBuild.dll /bl:build.binlog $SCRIPT_ROOT/build.proj ${MSBUILD_ARGUMENTS[@]} "$@" +$CLI_ROOT/dotnet $CLI_ROOT/sdk/$SDK_VERSION/MSBuild.dll /bl:$SCRIPT_ROOT/artifacts/log/Debug/initWriteDynamicPropsToStaticPropsFiles_$LogDateStamp.binlog $SCRIPT_ROOT/tools-local/init-build.proj /t:WriteDynamicPropsToStaticPropsFiles /p:GeneratingStaticPropertiesFile=true ${MSBUILD_ARGUMENTS[@]} "$@" +$CLI_ROOT/dotnet $CLI_ROOT/sdk/$SDK_VERSION/MSBuild.dll /bl:$SCRIPT_ROOT/artifacts/log/Debug/Build_$LogDateStamp.binlog $SCRIPT_ROOT/build.proj ${MSBUILD_ARGUMENTS[@]} "$@" diff --git a/tools-local/init-build.proj b/tools-local/init-build.proj index 5109c03675..02dc6a4987 100644 --- a/tools-local/init-build.proj +++ b/tools-local/init-build.proj @@ -16,10 +16,6 @@ - - $(BaseIntermediatePath)/init-build-proj.complete - - @@ -28,12 +24,8 @@ $(ReferencePackagesDir)%3B$(PrebuiltPackagesPath) - + - - + + Condition="'$(OfflineBuild)' == 'true'" + Inputs="$(MSBuildProjectFullPath)" + Outputs="$(CompletedSemaphorePath)UnpackTarballs.complete" > + + - +