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>
|
|
|
|
|
2021-07-09 16:42:42 -05:00
|
|
|
<PropertyGroup Condition=" '$(BuildWithOnlineSources)' != 'true' ">
|
2021-06-24 16:36:04 -05:00
|
|
|
<BuildTasksOfflineSources>$(ReferencePackagesDir)%3B$(PrebuiltPackagesPath)</BuildTasksOfflineSources>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<Target Name="Build">
|
|
|
|
<CallTarget Targets="
|
|
|
|
UnpackTarballs;
|
|
|
|
BuildXPlatTasks;
|
|
|
|
ExtractToolPackage;
|
|
|
|
GenerateRootFs;
|
|
|
|
ApplyPatches;
|
|
|
|
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-08-05 15:19:38 -05:00
|
|
|
<Exec Command="tar -xzf $(ExternalTarballsDir)$(SourceBuiltPrebuiltsTarballName).*.tar.gz"
|
|
|
|
WorkingDirectory="$(PrebuiltPackagesPath)" />
|
|
|
|
|
2021-07-08 09:35:21 -05:00
|
|
|
<!-- Move SBRP packages to reference packages location -->
|
|
|
|
<MakeDir Directories="$(ReferencePackagesDir)" />
|
|
|
|
<ItemGroup>
|
|
|
|
<UnpackedSourceBuildReferencePackages Include="$(PrebuiltSourceBuiltPackagesPath)SourceBuildReferencePackages/*"/>
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Move 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 -->
|
|
|
|
<!-- relevant issues: https://github.com/dotnet/runtime/issues/44646, https://github.com/dotnet/runtime/issues/45183,
|
|
|
|
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-06-24 16:36:04 -05:00
|
|
|
<!-- Setup the PackageVersions.props file to be a combination of SourceBuilt and GennedPackages -->
|
2021-07-08 09:35:21 -05:00
|
|
|
<Copy SourceFiles="$(PrebuiltSourceBuiltPackagesPath)PackageVersions.props" DestinationFiles="$(IntermediatePath)SourceBuiltPackageVersions.props" />
|
|
|
|
|
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">
|
|
|
|
<Import Project="SourceBuiltPackageVersions.props" Condition="Exists('SourceBuiltPackageVersions.props')" />
|
2021-07-27 10:27:40 -05:00
|
|
|
<Import Project="$(ProjectDir)TemporaryBootstrapPackageVersions.props" Condition="Exists('$(ProjectDir)TemporaryBootstrapPackageVersions.props')" />
|
2021-06-24 16:36:04 -05:00
|
|
|
<Import Project="GennedPackageVersions.props" Condition="Exists('GennedPackageVersions.props')" />
|
|
|
|
</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">
|
|
|
|
<MSBuild
|
|
|
|
Projects="
|
|
|
|
tasks\Microsoft.DotNet.SourceBuild.Tasks.XPlat\Microsoft.DotNet.SourceBuild.Tasks.XPlat.csproj;
|
|
|
|
tasks\SourceBuild.MSBuildSdkResolver\SourceBuild.MSBuildSdkResolver.csproj"
|
|
|
|
Targets="%(BuildTasksTarget.Identity)"
|
|
|
|
SkipNonexistentTargets="true"
|
|
|
|
Properties="
|
|
|
|
RestoreSources=$(BuildTasksOfflineSources);
|
|
|
|
__ToolInitPhase=%(BuildTasksTarget.Identity)" />
|
|
|
|
|
|
|
|
<WriteLinesToFile File="$(CompletedSemaphorePath)BuildXPlatTasks.complete" Overwrite="true" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="GetRepoProjects">
|
|
|
|
<ItemGroup>
|
|
|
|
<RepoProjects Include="$(ProjectDir)repos/*.proj" />
|
|
|
|
</ItemGroup>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="ApplyPatches" DependsOnTargets="GetRepoProjects">
|
|
|
|
<Message Text="Applying patches only" />
|
|
|
|
<MSBuild Projects="@(RepoProjects)" Targets="ApplyPatches" BuildInParallel="$(BuildInParallel)" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<Target Name="GenerateRootFs" Condition="'$(OS)' != 'Windows_NT'">
|
|
|
|
<Exec Condition="$(Platform.Contains('arm')) AND '$(Platform)' != 'armel' AND '$(BuildArchitecture)' != 'arm64'" Command="$(ArmEnvironmentVariables) $(ProjectDir)cross/build-rootfs.sh" />
|
|
|
|
<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>
|
|
|
|
|
|
|
|
<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-06-28 14:24:48 -05:00
|
|
|
<!-- Allow overriding of Arcade targets for SourceBuild to enable quicker
|
|
|
|
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>
|
|
|
|
<MarkAndCatalogPackages PackagesToMark="@(PrebuiltPackages)" CatalogOutputFilePath="$(PoisonReportDataFile)" MarkerFileName="$(PoisonMarkerFile)" />
|
|
|
|
<MarkAndCatalogPackages PackagesToMark="@(PrebuiltSourceBuiltPackages)" CatalogOutputFilePath="$(SourceBuiltPoisonReportDataFile)" MarkerFileName="$(SourceBuiltPoisonMarkerFile)" />
|
|
|
|
|
|
|
|
<WriteLinesToFile File="$(CompletedSemaphorePath)PoisonPrebuiltPackages.complete" Overwrite="true" />
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
</Project>
|