2024-01-11 20:11:30 +01:00
|
|
|
<Project Sdk="Microsoft.NET.Sdk">
|
2021-06-24 16:36:04 -05:00
|
|
|
|
|
|
|
<PropertyGroup>
|
2024-02-23 15:04:42 +01:00
|
|
|
<!-- Need to set to false to calculate RepositoryCommit. -->
|
|
|
|
<EnableSourceControlManagerQueries>false</EnableSourceControlManagerQueries>
|
|
|
|
|
2024-01-11 20:11:30 +01:00
|
|
|
<!-- Use the repo root build script -->
|
|
|
|
<BuildScript>$(ProjectDirectory)build$(ShellExtension)</BuildScript>
|
2021-08-23 17:05:58 -05:00
|
|
|
|
2024-01-11 20:11:30 +01:00
|
|
|
<!-- Restore and Build actions are already passed in by the root script. -->
|
|
|
|
<BuildActions>$(FlagParameterPrefix)pack $(FlagParameterPrefix)publish</BuildActions>
|
|
|
|
|
2021-08-23 17:05:58 -05:00
|
|
|
<!--
|
|
|
|
Setting NETCoreAppMaximumVersion to a high version so that the sdk doesn't complain if we're restoring/publishing for a higher version than the sdk.
|
|
|
|
See https://github.com/dotnet/sdk/issues/1512#issuecomment-377082883
|
|
|
|
-->
|
2024-01-11 20:11:30 +01:00
|
|
|
<BuildArgs>$(BuildArgs) /p:NETCoreAppMaximumVersion=99.9</BuildArgs>
|
2024-02-26 02:51:44 -08:00
|
|
|
<!-- We need to extract the non-portable OS name from the non-portable RID and pass that to installer build script.
|
|
|
|
This should not happen except when building non-portable. installer generally extracts the OSName from the host OS,
|
|
|
|
or from the Rid if supplied. -->
|
|
|
|
<BuildArgs Condition="$(PortableBuild) != 'true'">$(BuildArgs) /p:OSName=$(TargetRid.Substring(0, $(TargetRid.IndexOf("-"))))</BuildArgs>
|
2024-02-02 01:13:03 -05:00
|
|
|
<BuildArgs>$(BuildArgs) /p:PortableOSName=$(__PortableTargetOS)</BuildArgs>
|
|
|
|
<BuildArgs>$(BuildArgs) /p:Rid=$(TargetRid)</BuildArgs>
|
2024-02-20 18:07:53 +01:00
|
|
|
<BuildArgs>$(BuildArgs) /p:Architecture=$(TargetArchitecture)</BuildArgs>
|
2024-01-11 20:11:30 +01:00
|
|
|
<BuildArgs>$(BuildArgs) /p:DOTNET_INSTALL_DIR=$(DotNetRoot)</BuildArgs>
|
2021-08-23 17:05:58 -05:00
|
|
|
|
2024-02-02 01:13:03 -05:00
|
|
|
<BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:AspNetCoreInstallerRid=$(TargetRid)</BuildArgs>
|
2024-01-25 22:46:29 +01:00
|
|
|
<!-- installer always wants to build portable on FreeBSD -->
|
2024-01-26 11:27:18 +01:00
|
|
|
<BuildArgs Condition="'$(TargetOS)' == 'freebsd' and '$(DotNetBuildSourceOnly)' == 'true'">$(BuildArgs) /p:PortableBuild=true</BuildArgs>
|
2024-02-26 02:51:44 -08:00
|
|
|
<BuildArgs Condition="'$(TargetOS)' != 'windows'">$(BuildArgs) /p:NetRuntimeRid=$(TargetRid)</BuildArgs>
|
|
|
|
<!-- https://github.com/dotnet/source-build/issues/4138 -->
|
|
|
|
<BuildArgs Condition="'$(TargetOS)' != 'windows' and '$(TargetOS)' != 'osx'">$(BuildArgs) /p:SkipBuildingInstallers=true</BuildArgs>
|
2021-08-23 17:05:58 -05:00
|
|
|
|
2024-02-13 16:19:33 +01:00
|
|
|
<BuildArgs>$(BuildArgs) /p:PublicBaseURL=file:%2F%2F$(ArtifactsAssetsDir)</BuildArgs>
|
2024-02-26 02:51:44 -08:00
|
|
|
<!-- In non-source-only scenarios, currently consume aspnetcore from the normal public base url -->
|
|
|
|
<BuildArgs>$(BuildArgs) /p:FallbackPublicBaseURL=https://dotnetbuilds.blob.core.windows.net/public/</BuildArgs>
|
2024-01-11 20:11:30 +01:00
|
|
|
<BuildArgs>$(BuildArgs) /p:UsePortableLinuxSharedFramework=false</BuildArgs>
|
2024-02-23 07:18:09 -08:00
|
|
|
|
|
|
|
<BuildArgs Condition="'$(PgoInstrument)' == 'true'">$(BuildArgs) /p:PgoInstrument=true</BuildArgs>
|
2021-06-24 16:36:04 -05:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<RepositoryReference Include="arcade" />
|
2024-02-22 10:25:55 -06:00
|
|
|
<RepositoryReference Include="aspire" />
|
2021-06-24 16:36:04 -05:00
|
|
|
<RepositoryReference Include="aspnetcore" />
|
2024-02-22 10:25:55 -06:00
|
|
|
<RepositoryReference Include="command-line-api" />
|
|
|
|
<RepositoryReference Include="deployment-tools" />
|
2023-01-31 12:33:55 -05:00
|
|
|
<RepositoryReference Include="emsdk" />
|
2021-06-24 16:36:04 -05:00
|
|
|
<RepositoryReference Include="fsharp" />
|
|
|
|
<RepositoryReference Include="msbuild" />
|
2021-08-24 15:01:06 -05:00
|
|
|
<RepositoryReference Include="nuget-client" />
|
2021-06-24 16:36:04 -05:00
|
|
|
<RepositoryReference Include="roslyn" />
|
|
|
|
<RepositoryReference Include="runtime" />
|
|
|
|
<RepositoryReference Include="sdk" />
|
2024-02-22 10:25:55 -06:00
|
|
|
<RepositoryReference Include="symreader" />
|
2021-06-24 16:36:04 -05:00
|
|
|
<RepositoryReference Include="test-templates" />
|
|
|
|
<RepositoryReference Include="vstest" />
|
2024-02-22 10:25:55 -06:00
|
|
|
<RepositoryReference Include="windowsdesktop" Condition="'$(TargetOS)' == 'windows'" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
|
|
|
|
<RepositoryReference Include="source-build-externals" />
|
|
|
|
<RepositoryReference Include="source-build-reference-packages" />
|
2021-06-24 16:36:04 -05:00
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
If we have authentication, keep the templating internal feed (if one exists) to acquire the
|
|
|
|
text-only prebuilt. The source-build repo as a whole should depend on the same internal feed as
|
|
|
|
this repo does, so authentication should already be set up in the global endpoints json.
|
|
|
|
-->
|
|
|
|
<ItemGroup Condition="'$(VSS_NUGET_EXTERNAL_FEED_ENDPOINTS)' != ''">
|
|
|
|
<KeepFeedPrefixes Include="darc-int-dotnet-aspnetcore-" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<EnvironmentVariables Include="CLIBUILD_SKIP_TESTS=true" />
|
2024-02-26 02:51:44 -08:00
|
|
|
<!-- https://github.com/dotnet/source-build/issues/4115. -->
|
|
|
|
<EnvironmentVariables Include="PublishWindowsPdb=false" />
|
2021-06-24 16:36:04 -05:00
|
|
|
</ItemGroup>
|
|
|
|
|
2024-02-23 15:04:42 +01:00
|
|
|
<Target Name="GetInputsOutputForCreatePrivateSourceBuiltArtifactsArchive"
|
|
|
|
DependsOnTargets="DetermineSourceBuiltSdkVersion">
|
|
|
|
<!-- Inputs: Packages to include in the tarball -->
|
|
|
|
<ItemGroup>
|
|
|
|
<ArtifactsPackageToBundle Include="$(ArtifactsShippingPackagesDir)**;
|
|
|
|
$(ArtifactsNonShippingPackagesDir)**"
|
|
|
|
Condition="!$([System.String]::Copy('%(Identity)').EndsWith('.symbols.nupkg'))" />
|
|
|
|
<ReferencePackageToBundle Include="$(ReferencePackagesDir)**"
|
|
|
|
Condition="!$([System.String]::Copy('%(Identity)').EndsWith('.symbols.nupkg'))" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<!-- Create a layout directory for the files that are to be included in the artifacts tarball. -->
|
|
|
|
<SourceBuiltLayoutDir>$([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', 'artifacts-layout'))</SourceBuiltLayoutDir>
|
|
|
|
|
|
|
|
<!-- Outputs -->
|
|
|
|
<SourceBuiltTarballName>$(ArtifactsAssetsDir)$(SourceBuiltArtifactsTarballName).$(SourceBuiltSdkVersion).$(TargetRid)$(ArchiveExtension)</SourceBuiltTarballName>
|
|
|
|
<SourceBuiltVersionName>$(SourceBuiltLayoutDir).version</SourceBuiltVersionName>
|
|
|
|
<AllPackageVersionsPropsName>$(SourceBuiltLayoutDir)PackageVersions.props</AllPackageVersionsPropsName>
|
|
|
|
</PropertyGroup>
|
|
|
|
</Target>
|
|
|
|
|
|
|
|
<!-- Create the SourceBuilt.Private.Artifacts archive when building source-only. -->
|
|
|
|
<Target Name="CreatePrivateSourceBuiltArtifactsArchive"
|
|
|
|
AfterTargets="Build"
|
|
|
|
DependsOnTargets="GetInputsOutputForCreatePrivateSourceBuiltArtifactsArchive"
|
|
|
|
Inputs="@(ArtifactsPackageToBundle);@(ReferencePackageToBundle)"
|
|
|
|
Outputs="$(SourceBuiltTarballName);$(SourceBuiltVersionName);$(AllPackageVersionsPropsName)"
|
|
|
|
Condition="'$(DotNetBuildSourceOnly)' == 'true'">
|
|
|
|
<!-- Copy packages to layout directory. Since there are a large number of files,
|
|
|
|
this will use symlinks instead of copying files to make this execute quickly. -->
|
|
|
|
<Copy SourceFiles="@(ArtifactsPackageToBundle)"
|
|
|
|
DestinationFolder="$(SourceBuiltLayoutDir)"
|
|
|
|
UseSymbolicLinksIfPossible="true" />
|
|
|
|
<Copy SourceFiles="@(ReferencePackageToBundle)"
|
|
|
|
DestinationFolder="$(SourceBuiltLayoutDir)SourceBuildReferencePackages"
|
|
|
|
UseSymbolicLinksIfPossible="true" />
|
|
|
|
|
|
|
|
<!-- Content of the .version file to include in the tarball -->
|
|
|
|
<ItemGroup>
|
|
|
|
<VersionFileContent Include="$(RepositoryCommit);$(SourceBuiltSdkVersion)" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<WriteLinesToFile File="$(SourceBuiltVersionName)"
|
|
|
|
Lines="@(VersionFileContent)"
|
|
|
|
Overwrite="true" />
|
|
|
|
|
|
|
|
<!-- Create a PackageVersions.props file that includes entries for all packages. -->
|
|
|
|
<WritePackageVersionsProps NuGetPackages="@(ArtifactsPackageToBundle)"
|
|
|
|
ExtraProperties="@(ExtraPackageVersionPropsPackageInfo)"
|
|
|
|
VersionPropsFlowType="AllPackages"
|
|
|
|
OutputPath="$(AllPackageVersionsPropsName)" />
|
|
|
|
|
|
|
|
<Exec Command="tar --numeric-owner -czhf $(SourceBuiltTarballName) $([System.IO.Path]::GetFileName('$(SourceBuiltVersionName)')) *"
|
|
|
|
WorkingDirectory="$(SourceBuiltLayoutDir)" />
|
|
|
|
|
|
|
|
<Message Importance="High" Text="Packaged source-built artifacts to $(SourceBuiltTarballName)" />
|
|
|
|
</Target>
|
|
|
|
|
2021-06-24 16:36:04 -05:00
|
|
|
</Project>
|