2024-01-06 00:43:24 +01:00
<Project>
2021-06-24 16:36:04 -05:00
2024-01-11 20:10:28 +01:00
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..))" />
2024-01-20 01:10:25 -08:00
<PropertyGroup Condition="'$(UseInnerClone)' == 'true'">
<BuildArgs>$(BuildArgs) /p:UseInnerClone=true</BuildArgs>
<BuildArgs>$(BuildArgs) /p:CopySrcInsteadOfClone=true</BuildArgs>
<BuildArgs>$(BuildArgs) /p:CopyWipIntoInnerSourceBuildRepo=true</BuildArgs>
</PropertyGroup>
2024-02-08 23:14:42 -08:00
<PropertyGroup>
<!-- Force use of dotnet msbuild (ignoring global.json contents) unless BuildWithDesktopMSBuild is explicitly set in the repo project. -->
<BuildArgs Condition="'$(BuildOS)' == 'windows' and '$(BuildWithDesktopMSBuild)' != 'true'">$(BuildArgs) $(FlagParameterPrefix)msbuildEngine dotnet</BuildArgs>
</PropertyGroup>
2024-01-11 20:10:28 +01:00
<PropertyGroup>
<BuildCommand Condition="'$(BuildCommand)' == '' and '$(IsUtilityProject)' != 'true'">$(BuildScript) $(BuildActions) $(BuildArgs)</BuildCommand>
<!-- The default PackageVersionPropsFlowType behavior (DependenciesOnly) triggers logic that looks for a
Version.Details.xml file. Setting the type to AllPackages will skip that logic. -->
<PackageVersionPropsFlowType Condition="'$(IsUtilityProject)' == 'true'">AllPackages</PackageVersionPropsFlowType>
<!-- MinimalConsoleLogOutput determines if the repository build should be logged to a separate file or directly to the console. -->
<RepoConsoleLogFile>$(ArtifactsLogDir)$(RepositoryName).log</RepoConsoleLogFile>
<MinimalConsoleLogOutput Condition="'$(MinimalConsoleLogOutput)' == '' and '$(ContinuousIntegrationBuild)' == 'true'">true</MinimalConsoleLogOutput>
<PackageReportDataFile>$(PackageReportDir)prebuilt-usage.xml</PackageReportDataFile>
<ProjectAssetsJsonArchiveFile>$(PackageReportDir)all-project-assets-json-files.zip</ProjectAssetsJsonArchiveFile>
<ProdConManifestFile>$(PackageReportDir)prodcon-build.xml</ProdConManifestFile>
2024-01-16 19:40:26 -08:00
<RepoManifestFile>$([MSBuild]::NormalizePath('$(ProjectDirectory)', 'artifacts', 'RepoManifest.xml'))</RepoManifestFile>
2024-02-13 16:19:33 +01:00
<IntermediateSymbolsRepoDir>$(IntermediateSymbolsRootDir)$(RepositoryName)</IntermediateSymbolsRepoDir>
2024-01-11 20:10:28 +01:00
</PropertyGroup>
2024-01-24 23:39:59 +01:00
<!-- Exclude repositories that currently don't build when not building source-only. -->
2024-01-26 11:27:18 +01:00
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' != 'true'">
2024-01-24 23:39:59 +01:00
<RepositoryReference Remove="roslyn" />
<RepositoryReference Remove="msbuild" />
2024-02-10 01:39:12 +00:00
<RepositoryReference Remove="sdk" />
2024-01-24 23:39:59 +01:00
<RepositoryReference Remove="aspnetcore" />
<RepositoryReference Remove="razor" />
<RepositoryReference Remove="deployment-tools" />
<RepositoryReference Remove="format" />
<RepositoryReference Remove="nuget-client" />
2024-02-09 11:47:52 +01:00
<RepositoryReference Remove="test-templates" />
2024-01-24 23:39:59 +01:00
<RepositoryReference Remove="fsharp" />
<RepositoryReference Remove="vstest" />
<RepositoryReference Remove="aspire" />
<RepositoryReference Remove="installer" />
</ItemGroup>
2021-06-24 16:36:04 -05:00
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="AddSourceToNuGetConfig" />
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="RemoveInternetSourcesFromNuGetConfig" />
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="UpdateJson" />
2022-05-13 14:52:42 -05:00
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="UpdateNuGetConfigPackageSourcesMappings" />
2021-06-24 16:36:04 -05:00
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="ValidateUsageAgainstBaseline" />
2023-01-17 09:45:40 -08:00
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="WritePackageVersionsProps" />
2021-06-24 16:36:04 -05:00
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="WritePackageUsageData" />
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="WriteUsageReports" />
2023-11-17 07:26:10 -06:00
2024-02-02 16:49:07 -08:00
<Target Name="CopyNuGetConfig"
Condition="'$(NuGetConfigFile)' != ''"
Inputs="$(MSBuildProjectFullPath);$(OriginalNuGetConfigFile)"
Outputs="$(NuGetConfigFile)">
<MakeDir Directories="$([System.IO.Path]::GetDirectoryName('$(NuGetConfigFile)'))" />
<Copy
SourceFiles="$(OriginalNuGetConfigFile)"
DestinationFiles="$(NuGetConfigFile)">
<Output TaskParameter="CopiedFiles" ItemName="FileWrites" />
</Copy>
</Target>
2021-06-24 16:36:04 -05:00
<Target Name="UpdateNuGetConfig"
2024-02-02 16:49:07 -08:00
DependsOnTargets="CopyNuGetConfig"
Condition="'$(NuGetConfigFile)' != ''"
2021-06-24 16:36:04 -05:00
Inputs="$(MSBuildProjectFullPath)"
2024-01-11 20:10:28 +01:00
Outputs="$(BaseIntermediateOutputPath)UpdateNuGetConfig.complete">
2022-05-13 14:52:42 -05:00
<PropertyGroup>
2024-02-13 16:19:33 +01:00
<!-- Feed for the shipping live built packages -->
<SourceBuiltShippingNuGetSourceName>source-built</SourceBuiltShippingNuGetSourceName>
<!-- Feed for the non-shipping live built packages -->
<SourceBuiltNonShippingNuGetSourceName>source-built-transport</SourceBuiltNonShippingNuGetSourceName>
<SourceBuildSources>$(SourceBuiltShippingNuGetSourceName);$(SourceBuiltNonShippingNuGetSourceName)</SourceBuildSources>
<!-- Dev innerloop opt-in feed: /p:ExtraRestoreSourcePath=... -->
2022-05-13 14:52:42 -05:00
<ExtraSourcesNuGetSourceName>ExtraSources</ExtraSourcesNuGetSourceName>
<SourceBuildSources Condition="'$(ExtraRestoreSourcePath)' != ''">$(SourceBuildSources);$(ExtraSourcesNuGetSourceName)</SourceBuildSources>
</PropertyGroup>
2024-01-11 20:10:28 +01:00
2024-01-26 11:27:18 +01:00
<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
2024-01-11 20:10:28 +01:00
<PrebuiltNuGetSourceName>prebuilt</PrebuiltNuGetSourceName>
<PreviouslySourceBuiltNuGetSourceName>previously-source-built</PreviouslySourceBuiltNuGetSourceName>
<ReferencePackagesNuGetSourceName>reference-packages</ReferencePackagesNuGetSourceName>
<SourceBuildSources>$(SourceBuildSources);$(PrebuiltNuGetSourceName);$(PreviouslySourceBuiltNuGetSourceName);$(ReferencePackagesNuGetSourceName)</SourceBuildSources>
</PropertyGroup>
2022-05-13 14:52:42 -05:00
2024-01-26 12:53:41 -08:00
<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' != 'true'">
<!-- When not building source-only, repositories lagging behind on the .NET SDK (e.g. tooling repos)
that need to utilize a VS-aligned version for development purposes may not have the latest product
daily build feed in their NuGet.config. This means that when a newer globally-specified .NET SDK
attempts to restore shared framework packages, they will not be found. Work around this by
ensuring that repos have the supporting SDK feed. Note that this is not required when the SDK
in use is a released SDK.
Currently we are using a preview .NET 9 SDK and not all repos are using the Net 9 SDK
If either of these are not true, set below to false.
-->
<AddNetSdkSupportingFeed>true</AddNetSdkSupportingFeed>
<NetSdkSupportingFeedName>net-sdk-supporting-feed</NetSdkSupportingFeedName>
<NetSdkSupportingFeed>https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json</NetSdkSupportingFeed>
</PropertyGroup>
2021-07-09 16:42:42 -05:00
<RemoveInternetSourcesFromNuGetConfig
2024-02-02 16:49:07 -08:00
NuGetConfigFile="$(NuGetConfigFile)"
2024-01-26 13:38:54 -08:00
BuildWithOnlineFeeds="$(DotNetBuildWithOnlineFeeds)"
2024-01-11 20:10:28 +01:00
KeepFeedPrefixes="@(KeepFeedPrefixes)"
2024-01-26 11:27:18 +01:00
Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
2021-06-24 16:36:04 -05:00
2024-02-02 16:49:07 -08:00
<AddSourceToNuGetConfig NuGetConfigFile="$(NuGetConfigFile)"
2022-05-13 14:52:42 -05:00
SourceName="$(PrebuiltNuGetSourceName)"
2021-06-24 16:36:04 -05:00
SourcePath="$(PrebuiltPackagesPath)"
2024-01-26 11:27:18 +01:00
Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
2021-06-24 16:36:04 -05:00
2024-02-02 16:49:07 -08:00
<AddSourceToNuGetConfig NuGetConfigFile="$(NuGetConfigFile)"
2022-05-13 14:52:42 -05:00
SourceName="$(PreviouslySourceBuiltNuGetSourceName)"
2021-06-24 16:36:04 -05:00
SourcePath="$(PrebuiltSourceBuiltPackagesPath)"
2024-01-26 11:27:18 +01:00
Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
2021-06-24 16:36:04 -05:00
2024-02-02 16:49:07 -08:00
<AddSourceToNuGetConfig NuGetConfigFile="$(NuGetConfigFile)"
2022-05-13 14:52:42 -05:00
SourceName="$(ReferencePackagesNuGetSourceName)"
2021-06-24 16:36:04 -05:00
SourcePath="$(ReferencePackagesDir)"
2024-01-26 11:27:18 +01:00
Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
2021-06-24 16:36:04 -05:00
2024-02-02 16:49:07 -08:00
<AddSourceToNuGetConfig NuGetConfigFile="$(NuGetConfigFile)"
2024-02-13 16:19:33 +01:00
SourceName="$(SourceBuiltShippingNuGetSourceName)"
SourcePath="$(ArtifactsShippingPackagesDir)" />
<AddSourceToNuGetConfig NuGetConfigFile="$(NuGetConfigFile)"
SourceName="$(SourceBuiltNonShippingNuGetSourceName)"
SourcePath="$(ArtifactsNonShippingPackagesDir)" />
2021-06-24 16:36:04 -05:00
2024-02-02 16:49:07 -08:00
<AddSourceToNuGetConfig NuGetConfigFile="$(NuGetConfigFile)"
2022-05-13 14:52:42 -05:00
SourceName="$(ExtraSourcesNuGetSourceName)"
2021-06-24 16:36:04 -05:00
SourcePath="$(ExtraRestoreSourcePath)"
Condition="'$(ExtraRestoreSourcePath)' != ''" />
2024-01-26 12:53:41 -08:00
<!-- See root Directory.Build.props for value. -->
2024-02-02 16:49:07 -08:00
<AddSourceToNuGetConfig NuGetConfigFile="$(NuGetConfigFile)"
2024-01-26 12:53:41 -08:00
SourceName="$(NetSdkSupportingFeedName)"
SourcePath="$(NetSdkSupportingFeed)"
Condition="'$(AddNetSdkSupportingFeed)' == 'true'" />
2022-05-13 14:52:42 -05:00
<UpdateNuGetConfigPackageSourcesMappings
2024-02-02 16:49:07 -08:00
NuGetConfigFile="$(NuGetConfigFile)"
2024-01-26 13:38:54 -08:00
BuildWithOnlineFeeds="$(DotNetBuildWithOnlineFeeds)"
2022-05-13 14:52:42 -05:00
SourceBuildSources="$(SourceBuildSources)" />
2024-01-11 20:10:28 +01:00
<MakeDir Directories="$(BaseIntermediateOutputPath)" />
<Touch Files="$(BaseIntermediateOutputPath)UpdateNuGetConfig.complete" AlwaysCreate="true">
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
</Touch>
2021-06-24 16:36:04 -05:00
</Target>
2024-01-11 20:10:28 +01:00
<!-- Update the SDK version in the repo's global.json file.
This guarantees that all repositories build with the VMR's SDK version. -->
2021-06-24 16:36:04 -05:00
<Target Name="UpdateGlobalJsonVersions"
Condition="'$(GlobalJsonFile)' != ''"
2024-01-11 20:10:28 +01:00
Inputs="$(MSBuildProjectFullPath);$(MSBuildThisFileFullPath)"
Outputs="$(BaseIntermediateOutputPath)UpdateGlobalJsonVersions.complete">
2021-06-24 16:36:04 -05:00
<ItemGroup>
2024-01-11 20:10:28 +01:00
<_PossibleCliVersionJsonPath Include="sdk:version" />
<_PossibleCliVersionJsonPath Include="tools:dotnet" />
2021-06-24 16:36:04 -05:00
</ItemGroup>
<UpdateJson JsonFilePath="$(GlobalJsonFile)"
PathToAttribute="%(_PossibleCliVersionJsonPath.Identity)"
2024-01-11 20:10:28 +01:00
NewAttributeValue="$(NETCoreSdkVersion)"
SkipUpdateIfMissingKey="true" />
<!-- VB PoC, remove the global runtimes until https://github.com/dotnet/arcade/issues/14283 is resolved. -->
<UpdateJson JsonFilePath="$(GlobalJsonFile)"
PathToAttribute="tools:runtimes"
2021-06-24 16:36:04 -05:00
SkipUpdateIfMissingKey="true" />
2024-01-11 20:10:28 +01:00
<MakeDir Directories="$(BaseIntermediateOutputPath)" />
<Touch Files="$(BaseIntermediateOutputPath)UpdateGlobalJsonVersions.complete" AlwaysCreate="true">
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
</Touch>
</Target>
<!-- TODO: Remove when all repos use a consistent set of eng/common files: https://github.com/dotnet/source-build/issues/3710. -->
<Target Name="UpdateEngCommonFiles"
2024-02-02 18:38:41 +01:00
Condition="'$(UpdateEngCommonFiles)' == 'true' or '$(DotNetBuildSourceOnly)' != 'true'">
2024-01-11 20:10:28 +01:00
<ItemGroup>
2024-01-16 15:29:50 +01:00
<OrchestratorEngCommonFile Include="$(RepositoryEngineeringDir)common\**\*" />
2024-01-11 20:10:28 +01:00
</ItemGroup>
2024-01-16 15:29:50 +01:00
<Copy SourceFiles="@(OrchestratorEngCommonFile)"
2024-01-11 20:10:28 +01:00
DestinationFolder="$(ProjectDirectory)eng\common\%(RecursiveDir)"
SkipUnchangedFiles="true" />
2021-06-24 16:36:04 -05:00
</Target>
2023-01-17 09:45:40 -08:00
<!-- Before a repository builds, set up the version property files that override the repo's defaults.
There are 3 files generated -->
<Target Name="CreateBuildInputProps"
2021-06-24 16:36:04 -05:00
Inputs="$(MSBuildProjectFullPath)"
2024-01-11 20:10:28 +01:00
Outputs="$(BaseIntermediateOutputPath)CreateBuildInputProps.complete">
2021-06-24 16:36:04 -05:00
<ItemGroup>
2024-02-13 16:19:33 +01:00
<_CurrentSourceBuiltPackages Include="$(ArtifactsPackagesDir)**\*.nupkg"
Condition="!$([System.String]::Copy('%(Identity)').EndsWith('.symbols.nupkg'))" />
2024-01-08 15:22:15 +01:00
<_PreviouslyBuiltSourceBuiltPackages Include="$(PrebuiltSourceBuiltPackagesPath)*.nupkg" />
2021-06-24 16:36:04 -05:00
</ItemGroup>
2023-01-17 09:45:40 -08:00
<Error Condition="'$(PackageVersionPropsFlowType)' != 'AllPackages' and '$(PackageVersionPropsFlowType)' != 'DependenciesOnly'"
Text="Invalid PackageVersionPropsFlowType '$(PackageVersionPropsFlowType)'. Must be 'AllPackages' or 'DependenciesOnly'." />
<PropertyGroup>
<_VersionDetailsXml Condition="'$(PackageVersionPropsFlowType)' == 'DependenciesOnly'">$(ProjectDirectory)/eng/Version.Details.xml</_VersionDetailsXml>
</PropertyGroup>
<!-- Write the build input properties, then save off a copy that will be used for generating usage reports later -->
<WritePackageVersionsProps NuGetPackages="@(_CurrentSourceBuiltPackages)"
2023-02-07 08:03:21 -08:00
ExtraProperties="@(ExtraPackageVersionPropsPackageInfo)"
VersionPropsFlowType="$(PackageVersionPropsFlowType)"
VersionDetails="$(_VersionDetailsXml)"
OutputPath="$(CurrentSourceBuiltPackageVersionPropsPath)" />
2021-06-24 16:36:04 -05:00
2023-01-17 09:45:40 -08:00
<!-- Create previously source-built inputs info -->
<WritePackageVersionsProps NuGetPackages="@(_PreviouslyBuiltSourceBuiltPackages)"
2023-02-07 08:03:21 -08:00
VersionPropsFlowType="$(PackageVersionPropsFlowType)"
VersionDetails="$(_VersionDetailsXml)"
OutputPath="$(PreviouslySourceBuiltPackageVersionPropsPath)" />
<!-- Write a full package version props (unfiltered) that will be used to track which repo creates a package.
Because not all repos implement the repo API (e.g. some are external), it's difficult to consistently gather
a list of packages from the output of each repo. This may be an area for improvement later.
Instead, we rely on the package version props file that is built up
before each build. If the full list of packages grows by package A, B and C between repo Y and Z, then Y produced
A B and C.
A key element of this algorith is that we must write the full package version props and not the filtered version. -->
<WritePackageVersionsProps NuGetPackages="@(_CurrentSourceBuiltPackages)"
VersionPropsFlowType="AllPackages"
OutputPath="$(SnapshotPackageVersionPropsPath)" />
2021-06-24 16:36:04 -05:00
2023-01-17 09:45:40 -08:00
<!-- Write a single file that contains imports for both the current and previously built packages -->
<PropertyGroup>
<PackageVersionsPropsContents>
2024-01-11 20:10:28 +01:00
<![CDATA[
<Project>
2023-01-17 09:45:40 -08:00
<Import Project="$(PreviouslySourceBuiltPackageVersionPropsPath)" />
<Import Project="$(CurrentSourceBuiltPackageVersionPropsPath)" />
</Project>
]]>
</PackageVersionsPropsContents>
</PropertyGroup>
<WriteLinesToFile File="$(PackageVersionPropsPath)"
Lines="$(PackageVersionsPropsContents)"
Overwrite="true" />
<Message Importance="High" Text="$(RepositoryName) using package version properties saved at $(CurrentSourceBuiltPackageVersionPropsPath) and $(PreviouslySourceBuiltPackageVersionPropsPath)" />
2021-06-24 16:36:04 -05:00
2024-01-11 20:10:28 +01:00
<MakeDir Directories="$(BaseIntermediateOutputPath)" />
<Touch Files="$(BaseIntermediateOutputPath)CreateBuildInputProps.complete" AlwaysCreate="true">
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
</Touch>
</Target>
<!-- SkipRepoReferences is a developer innerloop switch to skip building dependencies. -->
<Target Name="BuildRepoReferences"
Condition="'@(RepositoryReference)' != '' and '$(SkipRepoReferences)' != 'true'">
<Message Importance="High" Text="Building dependencies [@(RepositoryReference)] needed by '$(RepositoryName)'." />
<ItemGroup>
<_DependentProject Include="@(RepositoryReference -> '%(Identity).proj')" />
</ItemGroup>
<MSBuild Projects="@(_DependentProject)"
Targets="Build"
BuildInParallel="$(BuildInParallel)"
StopOnFirstFailure="true" />
2021-06-24 16:36:04 -05:00
</Target>
2024-02-13 16:19:33 +01:00
<Target Name="SetSourceBuiltSdkOverrides"
Condition="'@(SourceBuiltSdkOverride)' != ''">
<ItemGroup>
<!-- Set the environment variables for MSBuild to look for our additional SDK Resolvers and or our resolver to find our source-built SDKs. -->
<EnvironmentVariables Include="MSBUILDADDITIONALSDKRESOLVERSFOLDER=$(VSMSBuildSdkResolversDir)" />
<EnvironmentVariables Include="SOURCE_BUILT_SDK_ID_%(SourceBuiltSdkOverride.Group)=%(SourceBuiltSdkOverride.Identity)" />
<EnvironmentVariables Include="SOURCE_BUILT_SDK_VERSION_%(SourceBuiltSdkOverride.Group)=%(SourceBuiltSdkOverride.Version)" />
<EnvironmentVariables Condition="'%(SourceBuiltSdkOverride.Location)' != ''" Include="SOURCE_BUILT_SDK_DIR_%(SourceBuiltSdkOverride.Group)=%(SourceBuiltSdkOverride.Location)/" />
<EnvironmentVariables Condition="'%(SourceBuiltSdkOverride.Location)' == ''" Include="SOURCE_BUILT_SDK_DIR_%(SourceBuiltSdkOverride.Group)=$(SourceBuiltSdksDir)%(SourceBuiltSdkOverride.Identity)/" />
</ItemGroup>
</Target>
2024-02-02 18:38:41 +01:00
<Target Name="RepoBuild"
2021-06-24 16:36:04 -05:00
Inputs="$(MSBuildProjectFullPath)"
2024-02-02 18:38:41 +01:00
Outputs="$(BaseIntermediateOutputPath)Build.complete"
Condition="'$(BuildCommand)' != ''"
DependsOnTargets="BuildRepoReferences;
UpdateNuGetConfig;
UpdateGlobalJsonVersions;
UpdateEngCommonFiles;
2024-02-13 16:19:33 +01:00
CreateBuildInputProps;
2024-02-02 18:38:41 +01:00
SetSourceBuiltSdkOverrides">
2024-01-11 20:10:28 +01:00
<Exec Command="$(DotnetTool) build-server shutdown" />
2023-02-09 07:34:07 -06:00
2024-01-11 20:10:28 +01:00
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Building $(RepositoryName)" />
2024-02-02 18:38:41 +01:00
<Message Importance="High" Text="Running command:" />
<Message Importance="High" Text=" $(BuildCommand)" />
<Message Importance="High" Text=" Log: $(RepoConsoleLogFile)" Condition="'$(MinimalConsoleLogOutput)' == 'true'" />
<Message Importance="High" Text=" With Environment Variables:"/>
<Message Importance="High" Text=" %(EnvironmentVariables.Identity)" />
2021-06-24 16:36:04 -05:00
2024-01-11 20:10:28 +01:00
<Message Text="DirSize Before Building $(RepositoryName)" Importance="High"
Condition=" '$(CleanWhileBuilding)' == 'true' and '$(BuildOS)' != 'windows'" />
<Exec Command="df -h $(RepoRoot)"
Condition=" '$(CleanWhileBuilding)' == 'true' and '$(BuildOS)' != 'windows'" />
2021-06-24 16:36:04 -05:00
<PropertyGroup>
2024-01-11 20:10:28 +01:00
<FullCommand>$(BuildCommand)</FullCommand>
<FullCommand Condition="'$(LogVerbosityOptOut)' != 'true'">$(FullCommand) /v:$(LogVerbosity)</FullCommand>
<FullCommand Condition="'$(MinimalConsoleLogOutput)' == 'true'">$(FullCommand) >> $(RepoConsoleLogFile) 2>&1</FullCommand>
2021-06-24 16:36:04 -05:00
</PropertyGroup>
2024-01-11 20:10:28 +01:00
<MakeDir Directories="$([System.IO.Path]::GetDirectoryName('$(RepoConsoleLogFile)'));
2024-02-13 16:19:33 +01:00
$(ArtifactsShippingPackagesDir);
$(ArtifactsNonShippingPackagesDir);
$(ArtifactsAssetsDir)" />
2024-01-11 20:10:28 +01:00
<!-- Create directories for extra debugging. -->
<MakeDir Directories="$(MSBuildDebugPathTargetDir);
$(RoslynDebugPathTargetDir);
$(AspNetRazorBuildServerLogDir)"
Condition="'$(EnableExtraDebugging)' == 'true'" />
2021-06-24 16:36:04 -05:00
<Exec Command="$(FullCommand)"
WorkingDirectory="$(ProjectDirectory)"
2024-02-02 18:38:41 +01:00
EnvironmentVariables="@(EnvironmentVariables)" />
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Building $(RepositoryName)...done" />
<MakeDir Directories="$(BaseIntermediateOutputPath)" />
<Touch Files="$(BaseIntermediateOutputPath)Build.complete" AlwaysCreate="true">
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
</Touch>
<!-- Propagate errors to the output when using the minimal console log feature. -->
<OnError ExecuteTargets="LogRepoBuildError" Condition="'$(MinimalConsoleLogOutput)' == 'true'" />
2021-06-24 16:36:04 -05:00
</Target>
2024-02-02 18:38:41 +01:00
<Target Name="LogRepoBuildError">
2024-01-11 20:10:28 +01:00
<Message Importance="High" Text="$([System.IO.File]::ReadAllText('$(RepoConsoleLogFile)'))" Condition="Exists('$(RepoConsoleLogFile)') and '$(MinimalConsoleLogOutput)' == 'true'" />
2021-06-24 16:36:04 -05:00
<Message Importance="High" Text="'$(RepositoryName)' failed during build." />
2024-01-11 20:10:28 +01:00
<Message Importance="High" Text="See '$(RepoConsoleLogFile)' for more information." Condition="Exists('$(RepoConsoleLogFile)') and '$(MinimalConsoleLogOutput)' == 'true'" />
2021-06-24 16:36:04 -05:00
</Target>
2024-01-16 19:40:26 -08:00
<Target Name="CopyRepoArtifacts"
2024-02-13 16:19:33 +01:00
DependsOnTargets="RepoBuild"
2024-02-07 18:44:09 +01:00
Condition="'$(IsUtilityProject)' != 'true'"
2024-01-16 19:40:26 -08:00
Inputs="$(RepoManifestFile)"
2024-02-13 16:19:33 +01:00
Outputs="$(BaseIntermediateOutputPath)CopyRepoArtifacts.complete">
2024-02-07 18:44:09 +01:00
<Error Text="Repo manifest file doesn't exist." Condition="!Exists('$(RepoManifestFile)')" />
2024-01-16 19:40:26 -08:00
<XmlPeek XmlInputPath="$(RepoManifestFile)"
Query="Build/Artifact/@Path">
<Output TaskParameter="Result" ItemName="RepoManifestArtifact" />
</XmlPeek>
2024-02-13 16:19:33 +01:00
<!-- Error if a repository doesn't produce any shipping or non-shipping artifacts. -->
<ItemGroup Condition="'@(RepoManifestArtifact)' == ''">
<_ArtifactsNotCreatedReason Include="^ There may have been a silent failure in the repo build." />
<_ArtifactsNotCreatedReason Include="^ To confirm, check the build log file for undetected errors that may have prevented package creation: $(RepoConsoleLogFile)" Condition="'$(MinimalConsoleLogOutput)' == 'true'" />
<_ArtifactsNotCreatedReason Include="^ The packages may have been written to an unexpected directory. For example, some repos used bin/ and changed to artifacts/ to match Arcade. Check RepoManifestFile in $(MSBuildProjectFullPath) (currently '$(RepoManifestFile)')" />
</ItemGroup>
<Error Text="$(RepositoryName) produced no new source-built package identities. Known possible causes:%0A@(_ArtifactsNotCreatedReason, '%0A')"
Condition="'@(RepoManifestArtifact)' == ''" />
<!-- The repo symbol archive shouldn't be copied. -->
2024-01-16 19:40:26 -08:00
<ItemGroup>
2024-02-13 16:19:33 +01:00
<RepoSymbolsArchive Include="@(RepoManifestArtifact)"
Condition="$([System.String]::Copy('%(Identity)').EndsWith('Symbols.$(RepositoryName)$(ArchiveExtension)'))" />
<RepoManifestArtifact Remove="@(RepoSymbolsArchive)" />
2024-01-16 19:40:26 -08:00
</ItemGroup>
2024-02-13 16:19:33 +01:00
<!-- Log the new repo artifacts -->
<Message Importance="High" Text="New artifact(s) after building $(RepositoryName):" />
<Message Importance="High" Text=" -> %(RepoManifestArtifact.Filename)%(RepoManifestArtifact.Extension)" />
<ItemGroup>
<RepoManifestPackage Include="@(RepoManifestArtifact->WithMetadataValue('Extension', '.nupkg'))" />
<RepoManifestAsset Include="@(RepoManifestArtifact)" Exclude="@(RepoManifestPackage)" />
</ItemGroup>
<!-- Prepare the repo manifest packages and group them by shipping and non-shipping. -->
<ItemGroup>
<RepoManifestNonShippingPackage Include="@(RepoManifestPackage)"
Condition="$([System.String]::Copy('%(Identity)').Contains('$([System.IO.Path]::DirectorySeparatorChar)NonShipping$([System.IO.Path]::DirectorySeparatorChar)'))">
<DestinationFolder Condition="'$(RepositoryName)' != 'source-build-reference-packages'">$(ArtifactsNonShippingPackagesDir)</DestinationFolder>
<DestinationFolder Condition="'$(RepositoryName)' == 'source-build-reference-packages'">$(ReferencePackagesDir)</DestinationFolder>
</RepoManifestNonShippingPackage>
<RepoManifestShippingPackage Include="@(RepoManifestPackage)"
Exclude="@(RepoManifestNonShippingPackage)">
<DestinationFolder Condition="'$(RepositoryName)' != 'source-build-reference-packages'">$(ArtifactsShippingPackagesDir)</DestinationFolder>
<DestinationFolder Condition="'$(RepositoryName)' == 'source-build-reference-packages'">$(ReferencePackagesDir)</DestinationFolder>
</RepoManifestShippingPackage>
</ItemGroup>
2024-01-16 19:40:26 -08:00
<!-- Building SBRP: At this point the References directory contains the previously-source-built SBRPs,
clear it before copying the current SBRPs. This ensures n-1 SBRPs aren't required to build the product repos. -->
2024-02-13 16:19:33 +01:00
<RemoveDir Directories="$(ReferencePackagesDir)"
Condition="'$(RepositoryName)' == 'source-build-reference-packages'" />
2024-01-16 19:40:26 -08:00
2024-02-13 16:19:33 +01:00
<!-- Copy shipping packages -->
<Copy SourceFiles="@(RepoManifestShippingPackage)"
DestinationFolder="%(RepoManifestShippingPackage.DestinationFolder)"
Condition="'@(RepoManifestShippingPackage)' != ''" />
2024-01-16 19:40:26 -08:00
2024-02-13 16:19:33 +01:00
<!-- Copy non-shipping packages -->
<Copy SourceFiles="@(RepoManifestNonShippingPackage)"
DestinationFolder="%(RepoManifestNonShippingPackage.DestinationFolder)"
Condition="'@(RepoManifestNonShippingPackage)' != ''" />
2024-01-16 19:40:26 -08:00
2024-02-13 16:19:33 +01:00
<!-- Copy assets -->
<Copy SourceFiles="@(RepoManifestAsset)"
DestinationFolder="$(ArtifactsAssetsDir)"
Condition="'@(RepoManifestAsset)' != ''" />
2024-01-16 19:40:26 -08:00
<MakeDir Directories="$(BaseIntermediateOutputPath)" />
2024-02-13 16:19:33 +01:00
<Touch Files="$(BaseIntermediateOutputPath)CopyRepoArtifacts.complete" AlwaysCreate="true">
2024-01-16 19:40:26 -08:00
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
</Touch>
</Target>
2021-07-27 10:27:40 -05:00
<!-- Copy restored packages from inner build to ensure they're included in the
2021-06-30 21:17:54 -05:00
main build prebuilt check -->
2024-02-13 16:19:33 +01:00
<Target Name="CopyInnerBuildRestoredPackages"
Condition="'$(IsUtilityProject)' != 'true'">
2021-06-30 21:17:54 -05:00
<ItemGroup>
2023-12-15 12:47:35 +01:00
<_InnerPackageCacheFiles Include="$(ProjectDirectory)artifacts/sb/package-cache/**/*" />
2021-06-30 21:17:54 -05:00
</ItemGroup>
<Copy SourceFiles="@(_InnerPackageCacheFiles)"
2024-01-11 23:13:20 +01:00
DestinationFiles="$(NuGetPackageRoot)%(RecursiveDir)%(Filename)%(Extension)"
2024-02-12 12:00:19 -08:00
SkipUnchangedFiles="true"
Condition="'@(_InnerPackageCacheFiles)' != ''" />
2021-06-30 21:17:54 -05:00
</Target>
2024-01-11 20:10:28 +01:00
<Target Name="CleanupRepo"
2024-02-13 16:19:33 +01:00
Condition="'$(IsUtilityProject)' != 'true' and
'$(CleanWhileBuilding)' == 'true' and
Exists('$(ProjectDirectory)artifacts')">
2024-02-09 14:36:23 -08:00
<!--
Some repositories (WinForms) use source generators that open files manually and keep file handles open on the compiler server (CsWin32).
These source generators are written incorrectly (a source generator should never do IO itself),
but the required features to read in binary files as input to a source generator don't exist.
To work around these source generators, shut down the compiler server so we can delete the obj directories.
-->
<Exec Command="$(DotnetTool) build-server shutdown --vbcscompiler" />
2021-08-06 09:12:04 -05:00
<PropertyGroup>
2024-01-11 20:10:28 +01:00
<BuildLogsDir>$([MSBuild]::NormalizeDirectory('$(ProjectDirectory)', 'artifacts', 'buildLogs'))</BuildLogsDir>
<BuildObjDir>$([MSBuild]::NormalizeDirectory('$(ProjectDirectory)', 'artifacts', 'buildObj'))</BuildObjDir>
2021-08-06 09:12:04 -05:00
</PropertyGroup>
2024-01-11 20:10:28 +01:00
2021-08-06 09:12:04 -05:00
<ItemGroup>
<LogFilesToCopy Include="$(ProjectDirectory)artifacts/**/*.log" />
<LogFilesToCopy Include="$(ProjectDirectory)artifacts/**/*.binlog" />
<ObjFilesToCopy Include="$(ProjectDirectory)artifacts/**/project.assets.json" />
</ItemGroup>
2024-01-11 20:10:28 +01:00
<!-- Make a copy of the build logs & project.assets.json files -->
<Copy SourceFiles="@(LogFilesToCopy)"
DestinationFolder="$(BuildLogsDir)%(RecursiveDir)"
SkipUnchangedFiles="true"
Condition="'@(LogFilesToCopy)' != ''" />
<Copy SourceFiles="@(ObjFilesToCopy)"
DestinationFolder="$(BuildObjDir)%(RecursiveDir)"
SkipUnchangedFiles="true"
Condition="'@(ObjFilesToCopy)' != ''" />
2021-08-06 09:12:04 -05:00
<ItemGroup>
2024-01-11 20:10:28 +01:00
<DirsToDelete Include="$([System.IO.Directory]::GetDirectories('$(ProjectDirectory)artifacts'))" />
<DirsToDeleteWithTrailingSeparator Include="$([MSBuild]::EnsureTrailingSlash('%(DirsToDelete.Identity)'))" />
<DirsToDeleteWithTrailingSeparator Remove="$(BuildLogsDir)" />
<DirsToDeleteWithTrailingSeparator Remove="$(BuildObjDir)" />
2021-08-06 09:12:04 -05:00
</ItemGroup>
2024-01-11 20:10:28 +01:00
<Message Text="DirSize After Building $(RepositoryName)" Importance="High" Condition="'$(BuildOS)' != 'windows' and '@(DirsToDeleteWithTrailingSeparator)' != ''" />
<Exec Command="df -h $(RepoRoot)" Condition="'$(BuildOS)' != 'windows' and '@(DirsToDeleteWithTrailingSeparator)' != ''" />
<!-- Cleanup everything else -->
<RemoveDir Directories="@(DirsToDeleteWithTrailingSeparator)" />
<Message Text="DirSize After CleanupRepo $(RepositoryName)" Importance="High" Condition="'$(BuildOS)' != 'windows'and '@(DirsToDeleteWithTrailingSeparator)' != ''" />
<Exec Command="df -h $(RepoRoot)" Condition="'$(BuildOS)' != 'windows'and '@(DirsToDeleteWithTrailingSeparator)' != ''" />
2021-08-06 09:12:04 -05:00
</Target>
2021-06-24 16:36:04 -05:00
<Target Name="ExtractToolPackage"
2024-02-09 08:19:15 +01:00
DependsOnTargets="CopyRepoArtifacts"
2021-06-24 16:36:04 -05:00
Condition="'@(BuiltSdkPackageOverride)' != ''"
Inputs="$(MSBuildProjectFullPath)"
2024-01-11 20:10:28 +01:00
Outputs="$(BaseIntermediateOutputPath)ExtractToolPackage.complete">
2024-02-02 16:49:07 -08:00
<PropertyGroup>
2024-02-13 16:19:33 +01:00
<_ToolPackagesRoot Condition="'$(RepositoryName)' != 'source-build-reference-packages'">$(ArtifactsNonShippingPackagesDir)</_ToolPackagesRoot>
2024-02-02 16:49:07 -08:00
<_ToolPackagesRoot Condition="'$(RepositoryName)' == 'source-build-reference-packages'">$(ReferencePackagesDir)</_ToolPackagesRoot>
</PropertyGroup>
2021-06-24 16:36:04 -05:00
<ItemGroup>
<_ToolPackage
Condition="'%(BuiltSdkPackageOverride.Version)' == ''"
2024-02-02 16:49:07 -08:00
Include="$(_ToolPackagesRoot)%(BuiltSdkPackageOverride.Identity)*.nupkg"
Exclude="$(_ToolPackagesRoot)%(BuiltSdkPackageOverride.Identity)*.symbols.nupkg"
2021-06-24 16:36:04 -05:00
Id="%(BuiltSdkPackageOverride.Identity)" />
<_ToolPackage
Condition="'%(BuiltSdkPackageOverride.Version)' != ''"
2024-02-02 16:49:07 -08:00
Include="$(_ToolPackagesRoot)%(BuiltSdkPackageOverride.Identity).%(BuiltSdkPackageOverride.Version).nupkg"
Exclude="$(_ToolPackagesRoot)%(BuiltSdkPackageOverride.Identity).%(BuiltSdkPackageOverride.Version).symbols.nupkg"
2021-06-24 16:36:04 -05:00
Id="%(BuiltSdkPackageOverride.Identity)" />
</ItemGroup>
2024-01-03 15:39:28 +01:00
<Unzip SourceFiles="%(_ToolPackage.Identity)"
DestinationFolder="$(SourceBuiltSdksDir)%(_ToolPackage.Id)\"
SkipUnchangedFiles="true" />
2021-06-24 16:36:04 -05:00
<ItemGroup>
2022-12-14 10:59:05 -06:00
<ExtractedToolFiles Include="$(SourceBuiltSdksDir)%(_ToolPackage.Id)/**/*netcore*/*.dll" />
2021-06-24 16:36:04 -05:00
</ItemGroup>
2022-12-14 10:59:05 -06:00
<Copy SourceFiles="@(ExtractedToolFiles)" DestinationFolder="$(SourceBuiltSdksDir)/" />
2021-06-24 16:36:04 -05:00
2024-01-03 15:39:28 +01:00
<!-- When unpacking, this executable file has the wrong permissions on
non-windows systems: https://github.com/NuGet/Home/issues/13121. -->
2021-06-24 16:36:04 -05:00
<Exec Command="chmod 755 git-clone-to-dir.sh"
2024-01-11 20:10:28 +01:00
Condition=" '%(_ToolPackage.Id)' == 'Microsoft.DotNet.Arcade.Sdk' and !$([MSBuild]::IsOSPlatform(Windows))"
2022-12-14 10:59:05 -06:00
WorkingDirectory="$(SourceBuiltSdksDir)%(_ToolPackage.Id)/tools/SourceBuild/" />
2021-07-27 10:27:40 -05:00
2024-01-11 20:10:28 +01:00
<MakeDir Directories="$(BaseIntermediateOutputPath)" />
<Touch Files="$(BaseIntermediateOutputPath)ExtractToolPackage.complete" AlwaysCreate="true">
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
</Touch>
2021-06-24 16:36:04 -05:00
</Target>
2024-02-13 16:19:33 +01:00
<Target Name="ExtractSymbolsArchiveFile"
2024-02-09 08:19:15 +01:00
DependsOnTargets="CopyRepoArtifacts"
2024-02-13 16:19:33 +01:00
Condition="'$(DotNetBuildSourceOnly)' == 'true' and
'$(IsUtilityProject)' != 'true' and
'@(RepoSymbolsArchive)' != ''"
Inputs="@(RepoSymbolsArchive)"
Outputs="$(IntermediateSymbolsRepoDir)">
<Error Text="There must only be a single repository symbols archive file. Found: @(RepoSymbolsArchive)"
Condition="@(RepoSymbolsArchive->Count()) > 1" />
<!-- Extract repo symbols tarball -->
<MakeDir Directories="$(IntermediateSymbolsRepoDir)" />
<Exec Command="tar -xzf %(RepoSymbolsArchive.Identity) -C $(IntermediateSymbolsRepoDir)" />
2021-06-24 16:36:04 -05:00
</Target>
2024-02-13 16:19:33 +01:00
<Target Name="Build"
DependsOnTargets="
BuildRepoReferences;
RepoBuild;
CopyRepoArtifacts;
CopyInnerBuildRestoredPackages;
ExtractToolPackage;
ExtractSymbolsArchiveFile;
CleanupRepo" />
2021-06-24 16:36:04 -05:00
<Target Name="WritePrebuiltUsageData"
DependsOnTargets="GetAllProjectDirectories"
Inputs="$(MSBuildProjectFullPath)"
2024-01-11 20:10:28 +01:00
Outputs="$(BaseIntermediateOutputPath)WritePrebuiltUsageData.complete">
2021-06-24 16:36:04 -05:00
<!-- Save the PVP snapshot of each build step to be evaluated while building the report. -->
<ItemGroup>
2024-02-13 16:19:33 +01:00
<PackageVersionPropsSnapshotFiles Include="$(PackageVersionsDir)PackageVersions.*.Snapshot.props" />
2021-06-24 16:36:04 -05:00
</ItemGroup>
<Copy SourceFiles="@(PackageVersionPropsSnapshotFiles)" DestinationFolder="$(PackageReportDir)snapshots/" />
<ItemGroup>
2024-01-11 23:13:20 +01:00
<AllRestoredPackageFiles Include="$(NuGetPackageRoot)**/*.nupkg" />
2021-06-24 16:36:04 -05:00
2023-01-10 08:50:31 -06:00
<!-- Only contains packages when building. -->
2021-06-24 16:36:04 -05:00
<TarballPrebuiltPackageFiles Include="$(PrebuiltPackagesPath)*.nupkg" />
2024-02-13 16:19:33 +01:00
<SourceBuiltPackageFiles Include="$(ArtifactsPackagesDir)**/*.nupkg" />
2021-06-24 16:36:04 -05:00
<SourceBuiltPackageFiles Include="$(PrebuiltSourceBuiltPackagesPath)*.nupkg" />
2021-07-09 16:42:42 -05:00
<ReferencePackageFiles Include="$(ReferencePackagesDir)**/*.nupkg" />
2021-06-24 16:36:04 -05:00
<!-- Check all RIDs from all restored Microsoft.NETCore.Platforms packages. -->
2024-01-11 23:13:20 +01:00
<PlatformsRuntimeJsonFiles Include="$(NuGetPackageRoot)microsoft.netcore.platforms/*/PortableRuntimeIdentifierGraph.json" />
2021-06-24 16:36:04 -05:00
<!-- Add some other potential top-level project directories for a more specific report. -->
2024-01-11 20:10:28 +01:00
<ProjectDirectories Include="$(SourceBuiltSdksDir);$(TasksDir);$(ArtifactsObjDir)" />
2021-06-24 16:36:04 -05:00
<!-- Finally, scan entire source-build, in case project.assets.json ends up in an unexpected place. -->
2024-01-11 20:10:28 +01:00
<ProjectDirectories Include="$(RepoRoot)" />
2021-06-24 16:36:04 -05:00
</ItemGroup>
<ItemGroup>
<!-- This file is a resource tracked by Git, not generated by restore. Ignore false positive. -->
2024-01-11 20:10:28 +01:00
<IgnoredProjectAssetsJsonFiles Include="$(SrcDir)*nuget-client*/**/test/NuGet.Core.Tests/NuGet.Build.Tasks.Pack.Test/compiler/resources/project.assets.json"/>
2021-06-24 16:36:04 -05:00
</ItemGroup>
<WritePackageUsageData
RestoredPackageFiles="@(AllRestoredPackageFiles)"
TarballPrebuiltPackageFiles="@(TarballPrebuiltPackageFiles)"
SourceBuiltPackageFiles="@(SourceBuiltPackageFiles)"
ReferencePackageFiles="@(ReferencePackageFiles)"
PlatformsRuntimeJsonFiles="@(PlatformsRuntimeJsonFiles)"
TargetRid="$(TargetRid)"
ProjectDirectories="@(ProjectDirectories)"
2024-01-11 20:10:28 +01:00
RootDir="$(RepoRoot)"
2021-06-24 16:36:04 -05:00
IgnoredProjectAssetsJsonFiles="@(IgnoredProjectAssetsJsonFiles)"
DataFile="$(PackageReportDataFile)"
ProjectAssetsJsonArchiveFile="$(ProjectAssetsJsonArchiveFile)" />
2023-08-17 13:59:33 -05:00
<!-- Copy packages detected as prebuilts to the artifacts prebuilt folder -->
2021-07-27 10:27:40 -05:00
<ItemGroup>
2023-08-17 13:59:33 -05:00
<AllowedPackageFiles Include="@(TarballPrebuiltPackageFile)" />
<AllowedPackageFiles Include="@(SourceBuiltPackageFiles)" />
<AllowedPackageFiles Include="@(ReferencePackageFiles)" />
<AllowedPackageFiles>
2024-01-11 20:10:28 +01:00
<LCFilename>$([System.String]::Copy(%(Filename)).ToLowerInvariant())</LCFilename>
2023-08-17 13:59:33 -05:00
</AllowedPackageFiles>
2021-07-27 10:27:40 -05:00
2023-08-17 13:59:33 -05:00
<PrebuiltPackageFiles Include="@(AllRestoredPackageFiles)" >
2024-01-11 20:10:28 +01:00
<LCFilename>$([System.String]::Copy(%(Filename)).ToLowerInvariant())</LCFilename>
2023-08-17 13:59:33 -05:00
</PrebuiltPackageFiles>
<PrebuiltPackageFiles Remove="@(AllowedPackageFiles)" MatchOnMetadata="LCFilename" />
2021-07-27 10:27:40 -05:00
</ItemGroup>
2023-08-17 13:59:33 -05:00
<Copy
SourceFiles="@(PrebuiltPackageFiles)"
DestinationFolder="$(ResultingPrebuiltPackagesDir)" />
2021-07-27 10:27:40 -05:00
2024-01-11 20:10:28 +01:00
<MakeDir Directories="$(BaseIntermediateOutputPath)" />
<Touch Files="$(BaseIntermediateOutputPath)WritePrebuiltUsageData.complete" AlwaysCreate="true">
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
</Touch>
2021-07-08 20:09:54 -05:00
</Target>
2021-06-24 16:36:04 -05:00
<Target Name="GetAllProjectDirectories">
<ItemGroup>
2022-12-14 10:59:05 -06:00
<AllRepoProjects Include="$(RepoProjectsDir)*.proj" />
2021-06-24 16:36:04 -05:00
</ItemGroup>
<Message Importance="High" Text="Finding project directories..." />
<MSBuild Projects="@(AllRepoProjects)"
Targets="GetProjectDirectory">
<Output TaskParameter="TargetOutputs" ItemName="ProjectDirectories" />
</MSBuild>
</Target>
<Target Name="ReportPrebuiltUsage"
Inputs="$(MSBuildProjectFullPath)"
2024-01-11 20:10:28 +01:00
Outputs="$(BaseIntermediateOutputPath)ReportPrebuiltUsage.complete">
2021-06-24 16:36:04 -05:00
<PropertyGroup>
<FailOnPrebuiltBaselineError Condition="'$(FailOnPrebuiltBaselineError)' == ''">false</FailOnPrebuiltBaselineError>
</PropertyGroup>
<ItemGroup>
2023-02-07 08:03:21 -08:00
<PackageVersionPropsSavedSnapshotFiles Include="$(PackageReportDir)snapshots/PackageVersions.*.Snapshot.props" />
2021-06-24 16:36:04 -05:00
</ItemGroup>
<WriteUsageReports DataFile="$(PackageReportDataFile)"
PackageVersionPropsSnapshots="@(PackageVersionPropsSavedSnapshotFiles)"
ProdConBuildManifestFile="$(ProdConManifestFile)"
PoisonedReportFile="$(PoisonedReportFile)"
OutputDirectory="$(PackageReportDir)" />
<PropertyGroup Condition="'$(ContinueOnPrebuiltBaselineError)' == ''">
<ContinueOnPrebuiltBaselineError>false</ContinueOnPrebuiltBaselineError>
<ContinueOnPrebuiltBaselineError Condition="'$(FailOnPrebuiltBaselineError)' != 'true'">true</ContinueOnPrebuiltBaselineError>
</PropertyGroup>
<ValidateUsageAgainstBaseline
DataFile="$(PackageReportDataFile)"
BaselineDataFile="$(BaselineDataFile)"
OutputBaselineFile="$(PackageReportDir)generated-new-baseline.xml"
OutputReportFile="$(PackageReportDir)baseline-comparison.xml"
AllowTestProjectUsage="$(AllowTestProjectUsage)"
ContinueOnError="$(ContinueOnPrebuiltBaselineError)" />
2024-01-11 20:10:28 +01:00
<MakeDir Directories="$(BaseIntermediateOutputPath)" />
<Touch Files="$(BaseIntermediateOutputPath)ReportPrebuiltUsage.complete" AlwaysCreate="true">
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
</Touch>
2021-06-24 16:36:04 -05:00
</Target>
<Target Name="GetProjectDirectory" Outputs="$(ProjectDirectory)" />
<Target Name="GetRepositoryReferences" Outputs="@(RepositoryReference)" />
</Project>