2021-06-24 16:36:04 -05:00
|
|
|
<Project>
|
|
|
|
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
|
|
|
|
|
|
|
|
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
|
|
|
|
|
|
|
|
<Import Project="$(OfflineAllRepoPropsFile)" Condition="Exists('$(OfflineAllRepoPropsFile)')" />
|
|
|
|
|
|
|
|
<UsingTask AssemblyFile="$(LeakDetectionTasksAssembly)" TaskName="MarkAndCatalogPackages" />
|
|
|
|
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="NuGetPack" />
|
|
|
|
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="ZipFileExtractToDirectory" />
|
|
|
|
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="ReplaceTextInFile" />
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<BuildTasksTarget Include="Restore;Build;InstallResolver" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
2022-03-31 19:12:59 -05:00
|
|
|
<PropertyGroup>
|
|
|
|
<BuildTasksOfflineSources>$(ReferencePackagesDir)%3B$(PrebuiltPackagesPath)%3B$(PrebuiltSourceBuiltPackagesPath)</BuildTasksOfflineSources>
|
2021-06-24 16:36:04 -05:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<Target Name="Build">
|
|
|
|
<CallTarget Targets="
|
|
|
|
UnpackTarballs;
|
|
|
|
BuildXPlatTasks;
|
2022-03-31 19:12:59 -05:00
|
|
|
BuildLeakDetection;
|
2021-06-24 16:36:04 -05:00
|
|
|
ExtractToolPackage;
|
|
|
|
GenerateRootFs;
|
2021-09-21 19:06:41 -07:00
|
|
|
BuildTextOnlyPackages;
|
2021-06-24 16:36:04 -05:00
|
|
|
PoisonPrebuiltPackages" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="PrepareOfflineLocalTools"
|
|
|
|
DependsOnTargets="
|
|
|
|
ExtractToolPackage;
|
|
|
|
BuildXPlatTasks" />
|
|
|
|
|
|
|
|
<Target Name="Clean">
|
|
|
|
<Delete Files="$(CompletedSemaphorePath)*.*" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="UnpackTarballs"
|
|
|
|
Inputs="$(MSBuildProjectFullPath)"
|
|
|
|
Outputs="$(CompletedSemaphorePath)UnpackTarballs.complete" >
|
|
|
|
|
|
|
|
<MakeDir Directories="$(PrebuiltSourceBuiltPackagesPath)" Condition="'$(CustomPrebuiltSourceBuiltPackagesPath)' == ''" />
|
|
|
|
<Exec Command="tar -xzf $(ExternalTarballsDir)$(SourceBuiltArtifactsTarballName).*.tar.gz"
|
|
|
|
WorkingDirectory="$(PrebuiltSourceBuiltPackagesPath)"
|
|
|
|
Condition="'$(CustomPrebuiltSourceBuiltPackagesPath)' == ''" />
|
|
|
|
|
2021-10-21 17:39:47 -05:00
|
|
|
<!--
|
|
|
|
Check for a prebuilt dependency tarball and extract if exists. If there isn't one, we expect
|
|
|
|
the build to be working without prebuilts.
|
|
|
|
-->
|
|
|
|
<ItemGroup>
|
|
|
|
<SourceBuiltPrebuiltsTarballFile Include="$(ExternalTarballsDir)$(SourceBuiltPrebuiltsTarballName).*.tar.gz" />
|
|
|
|
</ItemGroup>
|
|
|
|
<Exec Command="tar -xzf %(SourceBuiltPrebuiltsTarballFile.FullPath)"
|
2021-10-21 18:14:47 -05:00
|
|
|
WorkingDirectory="$(PrebuiltPackagesPath)"
|
|
|
|
Condition="'@(SourceBuiltPrebuiltsTarballFile)' != ''" />
|
2021-08-05 15:19:38 -05:00
|
|
|
|
2022-03-01 11:39:47 -06:00
|
|
|
<!-- Copy SBRP packages to reference packages location -->
|
2021-07-08 09:35:21 -05:00
|
|
|
<MakeDir Directories="$(ReferencePackagesDir)" />
|
|
|
|
<ItemGroup>
|
|
|
|
<UnpackedSourceBuildReferencePackages Include="$(PrebuiltSourceBuiltPackagesPath)SourceBuildReferencePackages/*"/>
|
|
|
|
</ItemGroup>
|
|
|
|
|
2022-03-01 11:39:47 -06:00
|
|
|
<Copy SourceFiles="@(UnpackedSourceBuildReferencePackages)" DestinationFiles="$(ReferencePackagesDir)%(Filename)%(Extension)" />
|
2021-06-24 16:36:04 -05:00
|
|
|
|
2021-07-09 17:43:30 -05:00
|
|
|
<!-- remove some reference packages that are generated incorrectly and instead use the prebuilt checked-in version instead -->
|
2021-09-21 19:06:41 -07:00
|
|
|
<!-- relevant issues: https://github.com/dotnet/runtime/issues/44646, https://github.com/dotnet/runtime/issues/45183,
|
2021-07-09 17:43:30 -05:00
|
|
|
https://github.com/dotnet/runtime/issues/45417. this should be fixed for the 6.0 release. -->
|
|
|
|
<ItemGroup>
|
|
|
|
<PrebuiltPackagesToUse Include="$(PrebuiltPackagesPath)/*.nupkg" />
|
|
|
|
<ReferencePackagesToOverride Include="@(PrebuiltPackagesToUse -> '$(ReferencePackagesDir)/%(Filename)%(Extension)')" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Message Text="Overriding @(ReferencePackagesToOverride) with @(PrebuiltPackagesToUse)" Importance="High" />
|
|
|
|
|
|
|
|
<Delete Files="@(ReferencePackagesToOverride)" />
|
|
|
|
|
2021-08-06 10:07:54 -07:00
|
|
|
<!-- Setup the PackageVersions.props file to be a combination of source built and previously source built packages -->
|
|
|
|
<Copy SourceFiles="$(PrebuiltSourceBuiltPackagesPath)PackageVersions.props" DestinationFiles="$(IntermediatePath)PreviouslySourceBuiltPackageVersions.props" />
|
2021-07-08 09:35:21 -05:00
|
|
|
|
2021-06-24 16:36:04 -05:00
|
|
|
<PropertyGroup>
|
|
|
|
<PackageVersionsPropsFile>$(IntermediatePath)PackageVersions.props</PackageVersionsPropsFile>
|
|
|
|
<PackageVersionsPropsContents>
|
|
|
|
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
2021-08-06 10:07:54 -07:00
|
|
|
<Import Project="PreviouslySourceBuiltPackageVersions.props" Condition="Exists('PreviouslySourceBuiltPackageVersions.props')" />
|
|
|
|
<Import Project="CurrentSourceBuiltPackageVersions.props" Condition="Exists('CurrentSourceBuiltPackageVersions.props')" />
|
2021-06-24 16:36:04 -05:00
|
|
|
</Project>
|
|
|
|
]]>
|
|
|
|
</PackageVersionsPropsContents>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<WriteLinesToFile File="$(PackageVersionsPropsFile)"
|
|
|
|
Lines="$(PackageVersionsPropsContents)"
|
|
|
|
Overwrite="true" />
|
|
|
|
|
|
|
|
<WriteLinesToFile File="$(CompletedSemaphorePath)UnpackTarballs.complete" Overwrite="true" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="BuildXPlatTasks"
|
|
|
|
DependsOnTargets="UnpackTarballs"
|
|
|
|
Inputs="$(MSBuildProjectFullPath)"
|
|
|
|
Outputs="$(CompletedSemaphorePath)BuildXPlatTasks.complete">
|
2022-03-31 19:12:59 -05:00
|
|
|
<PropertyGroup>
|
|
|
|
<XPlatTaskProjects>tasks\Microsoft.DotNet.SourceBuild.Tasks.XPlat\Microsoft.DotNet.SourceBuild.Tasks.XPlat.csproj;tasks\SourceBuild.MSBuildSdkResolver\SourceBuild.MSBuildSdkResolver.csproj</XPlatTaskProjects>
|
|
|
|
</PropertyGroup>
|
2021-06-24 16:36:04 -05:00
|
|
|
<MSBuild
|
2022-03-31 19:12:59 -05:00
|
|
|
Projects="$(XPlatTaskProjects)"
|
2021-06-24 16:36:04 -05:00
|
|
|
Targets="%(BuildTasksTarget.Identity)"
|
|
|
|
SkipNonexistentTargets="true"
|
|
|
|
Properties="
|
|
|
|
RestoreSources=$(BuildTasksOfflineSources);
|
|
|
|
__ToolInitPhase=%(BuildTasksTarget.Identity)" />
|
|
|
|
|
|
|
|
<WriteLinesToFile File="$(CompletedSemaphorePath)BuildXPlatTasks.complete" Overwrite="true" />
|
|
|
|
</Target>
|
|
|
|
|
2022-03-31 19:12:59 -05:00
|
|
|
<Target Name="BuildLeakDetection"
|
|
|
|
DependsOnTargets="ExtractToolPackage"
|
|
|
|
Inputs="$(MSBuildProjectFullPath)"
|
|
|
|
Outputs="$(CompletedSemaphorePath)BuildLeakDetection.complete"
|
|
|
|
Condition="'$(EnablePoison)' == 'true'">
|
|
|
|
<PropertyGroup>
|
|
|
|
<LeakDetectionProjects>tasks\Microsoft.DotNet.SourceBuild.Tasks.LeakDetection\Microsoft.DotNet.SourceBuild.Tasks.LeakDetection.csproj</LeakDetectionProjects>
|
|
|
|
</PropertyGroup>
|
|
|
|
<MSBuild
|
|
|
|
Projects="$(LeakDetectionProjects)"
|
|
|
|
Targets="%(BuildTasksTarget.Identity)"
|
|
|
|
SkipNonexistentTargets="true"
|
|
|
|
Properties="
|
|
|
|
RestoreSources=$(BuildTasksOfflineSources);
|
|
|
|
__ToolInitPhase=%(BuildTasksTarget.Identity)" />
|
|
|
|
|
|
|
|
<WriteLinesToFile File="$(CompletedSemaphorePath)BuildLeakDetection.complete" Overwrite="true" />
|
|
|
|
</Target>
|
|
|
|
|
2021-06-24 16:36:04 -05:00
|
|
|
<Target Name="GenerateRootFs" Condition="'$(OS)' != 'Windows_NT'">
|
2022-09-11 07:33:51 -04:00
|
|
|
<Exec Condition="$(Platform.Contains('arm')) AND '$(Platform)' != 'armel' AND '$(BuildArchitecture)' != 'arm64' AND '$(BuildArchitecture)' != 'arm'" Command="$(ArmEnvironmentVariables) $(ProjectDir)cross/build-rootfs.sh" />
|
2021-06-24 16:36:04 -05:00
|
|
|
<Exec Condition="'$(Platform)' == 'armel'" Command="$(ArmEnvironmentVariables) $(ProjectDir)cross/armel/tizen-build-rootfs.sh" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="BuildTextOnlyPackages"
|
|
|
|
Inputs="$(MSBuildProjectFullPath)"
|
|
|
|
Outputs="$(CompletedSemaphorePath)BuildTextOnlyPackages.complete">
|
|
|
|
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Packing text-only packages." />
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<TextOnlyPackageNuspecFile Include="$(TextOnlyPackageBaseDir)/**/*.nuspec" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
2021-09-21 19:06:41 -07:00
|
|
|
<Message Importance="High" Text="Found text only package nuspec file: %(TextOnlyPackageNuspecFile.Identity)" />
|
|
|
|
|
|
|
|
<ReplaceTextInFile
|
|
|
|
InputFile="%(TextOnlyPackageNuspecFile.Identity)"
|
|
|
|
OldText="</package>"
|
|
|
|
NewText="<files><file src=".\**\*"/></files></package>" />
|
|
|
|
|
2021-06-24 16:36:04 -05:00
|
|
|
<NugetPack
|
|
|
|
Nuspecs="%(TextOnlyPackageNuspecFile.Identity)"
|
|
|
|
OutputDirectory="$(SourceBuiltPackagesPath)"
|
|
|
|
ExcludeEmptyDirectories="false"
|
|
|
|
CreateSymbolPackage="false" />
|
|
|
|
|
|
|
|
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Done packing text-only packages." />
|
|
|
|
<WriteLinesToFile File="$(CompletedSemaphorePath)BuildTextOnlyPackages.complete" Overwrite="true" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="ExtractToolPackage"
|
|
|
|
DependsOnTargets="UnpackTarballs;BuildXPlatTasks"
|
|
|
|
Inputs="$(MSBuildProjectFullPath)"
|
|
|
|
Outputs="$(CompletedSemaphorePath)ExtractToolPackage.complete">
|
|
|
|
<ZipFileExtractToDirectory SourceArchive="$(PrebuiltSourceBuiltPackagesPath)Microsoft.DotNet.Arcade.Sdk.$(ARCADE_BOOTSTRAP_VERSION).nupkg"
|
|
|
|
DestinationDirectory="$(ArcadeBootstrapPackageDir)microsoft.dotnet.arcade.sdk/$(ARCADE_BOOTSTRAP_VERSION)/"
|
|
|
|
OverwriteDestination="true" />
|
|
|
|
|
|
|
|
<!-- TODO: When unpacking using ZipFileExtractToDirectory, this executable file has the wrong
|
|
|
|
permissions. See https://github.com/dotnet/source-build/issues/2259 -->
|
|
|
|
<Exec Command="chmod 755 git-clone-to-dir.sh"
|
|
|
|
WorkingDirectory="$(ArcadeBootstrapPackageDir)microsoft.dotnet.arcade.sdk/$(ARCADE_BOOTSTRAP_VERSION)/tools/SourceBuild/" />
|
|
|
|
|
|
|
|
<ReplaceTextInFile InputFile="$(ArcadeBootstrapPackageDir)microsoft.dotnet.arcade.sdk/$(ARCADE_BOOTSTRAP_VERSION)/tools/SourceBuild/SourceBuildArcadeTools.targets"
|
|
|
|
OldText="%3CReadSourceBuildIntermediateNupkgDependencies"
|
|
|
|
NewText="%3CReadSourceBuildIntermediateNupkgDependencies Condition="'%24%28DotNetBuildOffline%29' != 'true'"" />
|
|
|
|
|
2021-09-21 19:06:41 -07:00
|
|
|
<!-- Allow overriding of Arcade targets for SourceBuild to enable quicker
|
2021-06-28 14:24:48 -05:00
|
|
|
dev turnaround for Preview 6 -->
|
|
|
|
<ItemGroup>
|
|
|
|
<OverrideArcadeFiles Include="$(ProjectDir)ArcadeOverrides/**/*" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Copy
|
|
|
|
SourceFiles="@(OverrideArcadeFiles)"
|
|
|
|
DestinationFiles="$(ArcadeBootstrapPackageDir)microsoft.dotnet.arcade.sdk/$(ARCADE_BOOTSTRAP_VERSION)/tools/SourceBuild/%(RecursiveDir)%(Filename)%(Extension)" />
|
|
|
|
|
2021-06-24 16:36:04 -05:00
|
|
|
<WriteLinesToFile File="$(CompletedSemaphorePath)ExtractToolPackage.complete" Overwrite="true" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="PoisonPrebuiltPackages"
|
2021-07-09 16:42:42 -05:00
|
|
|
Condition="'$(EnablePoison)' == 'true'"
|
2021-06-24 16:36:04 -05:00
|
|
|
Inputs="$(MSBuildProjectFullPath)"
|
|
|
|
Outputs="$(CompletedSemaphorePath)PoisonPrebuiltPackages.complete">
|
|
|
|
<ItemGroup>
|
|
|
|
<PrebuiltPackages Include="$(PrebuiltPackagesPath)**/*.nupkg" />
|
|
|
|
<PrebuiltSourceBuiltPackages Include="$(PrebuiltSourceBuiltPackagesPath)**/*.nupkg" />
|
|
|
|
</ItemGroup>
|
2022-03-31 19:12:59 -05:00
|
|
|
|
|
|
|
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Poisoning existing packages for leak detection." />
|
|
|
|
|
2021-06-24 16:36:04 -05:00
|
|
|
<MarkAndCatalogPackages PackagesToMark="@(PrebuiltPackages)" CatalogOutputFilePath="$(PoisonReportDataFile)" MarkerFileName="$(PoisonMarkerFile)" />
|
|
|
|
<MarkAndCatalogPackages PackagesToMark="@(PrebuiltSourceBuiltPackages)" CatalogOutputFilePath="$(SourceBuiltPoisonReportDataFile)" MarkerFileName="$(SourceBuiltPoisonMarkerFile)" />
|
|
|
|
|
|
|
|
<WriteLinesToFile File="$(CompletedSemaphorePath)PoisonPrebuiltPackages.complete" Overwrite="true" />
|
2022-03-31 19:12:59 -05:00
|
|
|
<Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Done poisoning." />
|
2021-06-24 16:36:04 -05:00
|
|
|
</Target>
|
|
|
|
|
|
|
|
</Project>
|