Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate package flow between repos #18557

Merged
merged 44 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0ea4e6c
Isolate package flow between repos
mthalman Feb 6, 2024
3878626
Compute transitive dependencies
mthalman Feb 12, 2024
823a8aa
Swap dep graph visualizer with a simple YAML-based representation
mthalman Feb 12, 2024
edebea7
Fix dependency on scenario-tests
mthalman Feb 12, 2024
5b8a5a2
Remove duplicate installer dependency
mthalman Feb 12, 2024
566f613
Delete obsolete installer-deps
mthalman Feb 12, 2024
8ce569e
Add conditional deps specific to source build
mthalman Feb 13, 2024
4611a5e
Merge branch 'main' into sb3608-parallel
mthalman Feb 13, 2024
fe61fb5
Merge branch 'main' into sb3608-parallel
mthalman Feb 16, 2024
d18498a
Updates to integrate with artifact path refactoring
mthalman Feb 16, 2024
6f33ebb
Merge branch 'main' into sb3608-parallel
mthalman Feb 20, 2024
608e3ad
Add back primary dependencies
mthalman Feb 21, 2024
a7a6f79
Move psb references
mthalman Feb 21, 2024
bdaa440
Use Exclude instead of Condition
mthalman Feb 21, 2024
241ad6f
whitespace
mthalman Feb 21, 2024
a50512d
Remove MakeDir for package dirs
mthalman Feb 21, 2024
c97b8d2
Add comment for embedding
mthalman Feb 21, 2024
8b3f3b2
indenting
mthalman Feb 21, 2024
8834743
Remove TransitiveRepositoryReference instead of RepositoryReference, …
mthalman Feb 21, 2024
0540025
Remove SkipEnsurePackagesCreated
mthalman Feb 21, 2024
3c0edf6
Remove SharedOutputPath MakeDir
mthalman Feb 21, 2024
fe82c36
Use Copy instead of ln
mthalman Feb 21, 2024
816e8dc
Separate SB refs into separate ItemGroup
mthalman Feb 21, 2024
4d7ac80
dependency adjustments
mthalman Feb 21, 2024
2be9e44
Renames to remove "SourceBuild"
mthalman Feb 21, 2024
a0117ac
Reclassify fsharp dep on runtime
mthalman Feb 22, 2024
afb34ea
Reclassify msbuild dep on runtime
mthalman Feb 22, 2024
bb5af84
Add runtime dep to templating
mthalman Feb 22, 2024
fe469d7
Remove whitespace
mthalman Feb 22, 2024
308159f
Remove psb dep on scenario-tests
mthalman Feb 22, 2024
19bc3f3
Remove whitespace
mthalman Feb 22, 2024
5f14aa3
Reclassify format dep on symreader
mthalman Feb 22, 2024
80ba493
Use directory normalization
mthalman Feb 22, 2024
7d574e2
Simplify package file collection
mthalman Feb 22, 2024
a0599e1
Add whitespace
mthalman Feb 22, 2024
6e800d7
Simplify _BuildSources
mthalman Feb 22, 2024
59013c6
Get repo refs in parallel
mthalman Feb 22, 2024
28f645a
Use Distinct
mthalman Feb 22, 2024
0dfac72
whitespace
mthalman Feb 22, 2024
d1b1de0
Merge branch 'main' into sb3608-parallel
mthalman Feb 22, 2024
2c3836b
Move windowsdesktop dep from sdk to installer
mthalman Feb 22, 2024
9a25ae6
Revert "Use Distinct"
mthalman Feb 22, 2024
5420993
Remove unnecessary normalize calls
mthalman Feb 22, 2024
2303610
Update src/SourceBuild/content/repo-projects/package-source-build.proj
mthalman Feb 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/SourceBuild/content/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
<SharedIntermediateOutputPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsObjDir)', '$(TargetArchitecture)', '$(Configuration)'))</SharedIntermediateOutputPath>

<SourceBuiltBlobFeedDir>$([MSBuild]::NormalizeDirectory('$(SharedIntermediateOutputPath)', 'blob-feed'))</SourceBuiltBlobFeedDir>
<SourceBuiltPackagesPath>$([MSBuild]::NormalizeDirectory('$(SourceBuiltBlobFeedDir)', 'packages'))</SourceBuiltPackagesPath>
<SourceBuiltBasePackagesPath>$([MSBuild]::NormalizeDirectory('$(SourceBuiltBlobFeedDir)', 'packages'))</SourceBuiltBasePackagesPath>
<SourceBuiltAssetsDir>$([MSBuild]::NormalizeDirectory('$(SourceBuiltBlobFeedDir)', 'assets'))</SourceBuiltAssetsDir>

<PrebuiltPackagesPath>$([MSBuild]::NormalizeDirectory('$(PrereqsPackagesDir)', 'prebuilt'))</PrebuiltPackagesPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<NuGetConfigFile Condition="'$(OriginalNuGetConfigFile)' != ''">$(BaseIntermediateOutputPath)$([System.IO.Path]::GetFileName('$(OriginalNuGetConfigFile)'))</NuGetConfigFile>

<SourceBuiltSdksDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'source-built-sdks'))</SourceBuiltSdksDir>
<SourceBuiltPackagesPath>$(SourceBuiltBasePackagesPath)$(RepositoryName)/</SourceBuiltPackagesPath>

<!-- Set the bootstrap version to the VMR's version if empty. (no bootstrap set). -->
<ArcadeBootstrapVersion>$([MSBuild]::ValueOrDefault('$(ARCADE_BOOTSTRAP_VERSION)', '$(ArcadeSdkVersion)'))</ArcadeBootstrapVersion>
Expand Down
46 changes: 36 additions & 10 deletions src/SourceBuild/content/repo-projects/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="WritePackageVersionsProps" />
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="WritePackageUsageData" />
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="WriteUsageReports" />

<Target Name="GetRepositoryReferenceInfo">
<ItemGroup>
<RepositoryReferenceInfo Include="@(RepositoryReference)">
<SourceName>source-built-%(Identity)</SourceName>
<PackagesPath>$(SourceBuiltBasePackagesPath)%(Identity)/</PackagesPath>
</RepositoryReferenceInfo>
<DependentRepoSourceName Include="@(RepositoryReferenceInfo->'%(SourceName)')" />
<DependentRepoPackageFile Include="%(RepositoryReferenceInfo.PackagesPath)**" />
</ItemGroup>
</Target>

<Target Name="CopyNuGetConfig"
Condition="'$(NuGetConfigFile)' != ''"
Expand All @@ -70,24 +81,32 @@
</Target>

<Target Name="UpdateNuGetConfig"
DependsOnTargets="CopyNuGetConfig"
DependsOnTargets="CopyNuGetConfig;GetRepositoryReferenceInfo"
Condition="'$(NuGetConfigFile)' != ''"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(BaseIntermediateOutputPath)UpdateNuGetConfig.complete">
<PropertyGroup>
<SourceBuiltNuGetSourceName>source-built</SourceBuiltNuGetSourceName>
<ExtraSourcesNuGetSourceName>ExtraSources</ExtraSourcesNuGetSourceName>
<SourceBuildSources>$(SourceBuiltNuGetSourceName)</SourceBuildSources>
<SourceBuildSources Condition="'$(ExtraRestoreSourcePath)' != ''">$(SourceBuildSources);$(ExtraSourcesNuGetSourceName)</SourceBuildSources>
</PropertyGroup>

<PropertyGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
<PrebuiltNuGetSourceName>prebuilt</PrebuiltNuGetSourceName>
<PreviouslySourceBuiltNuGetSourceName>previously-source-built</PreviouslySourceBuiltNuGetSourceName>
<ReferencePackagesNuGetSourceName>reference-packages</ReferencePackagesNuGetSourceName>
<SourceBuildSources>$(SourceBuildSources);$(PrebuiltNuGetSourceName);$(PreviouslySourceBuiltNuGetSourceName);$(ReferencePackagesNuGetSourceName)</SourceBuildSources>
</PropertyGroup>

<ItemGroup>
<_CommonSourceBuildSources Include="@(DependentRepoSourceName)" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<_CommonSourceBuildSources Include="$(ExtraSourcesNuGetSourceName)" Condition="'$(ExtraRestoreSourcePath)' != ''" />
</ItemGroup>

<ItemGroup>
<SourceBuildSources Condition="'$(DotNetBuildSourceOnly)' == 'true'"
mthalman marked this conversation as resolved.
Show resolved Hide resolved
Include="$(PrebuiltNuGetSourceName);$(PreviouslySourceBuiltNuGetSourceName);$(ReferencePackagesNuGetSourceName);@(_CommonSourceBuildSources)" />
<SourceBuildSources Condition="'$(DotNetBuildSourceOnly)' != 'true'"
Include="@(_CommonSourceBuildSources)" />
</ItemGroup>

<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
Expand Down Expand Up @@ -126,8 +145,9 @@
Condition="'$(DotNetBuildSourceOnly)' == 'true'" />

<AddSourceToNuGetConfig NuGetConfigFile="$(NuGetConfigFile)"
SourceName="$(SourceBuiltNuGetSourceName)"
SourcePath="$(SourceBuiltPackagesPath)" />
SourceName="%(RepositoryReferenceInfo.SourceName)"
SourcePath="%(RepositoryReferenceInfo.PackagesPath)"
Condition=" '@(RepositoryReferenceInfo)' != '' " />

<AddSourceToNuGetConfig NuGetConfigFile="$(NuGetConfigFile)"
SourceName="$(ExtraSourcesNuGetSourceName)"
Expand All @@ -143,12 +163,16 @@
<UpdateNuGetConfigPackageSourcesMappings
NuGetConfigFile="$(NuGetConfigFile)"
BuildWithOnlineFeeds="$(DotNetBuildWithOnlineFeeds)"
SourceBuildSources="$(SourceBuildSources)" />
SourceBuildSources="@(SourceBuildSources)" />

<MakeDir Directories="$(BaseIntermediateOutputPath)" />
<Touch Files="$(BaseIntermediateOutputPath)UpdateNuGetConfig.complete" AlwaysCreate="true">
<Output TaskParameter="TouchedFiles" ItemName="FileWrites" />
</Touch>

<ItemGroup>
<EmbedInBinlog Include="$(NuGetConfigFile)" />
</ItemGroup>
mthalman marked this conversation as resolved.
Show resolved Hide resolved
ViktorHofer marked this conversation as resolved.
Show resolved Hide resolved
</Target>

<!-- Update the SDK version in the repo's global.json file.
Expand Down Expand Up @@ -193,11 +217,13 @@
<!-- Before a repository builds, set up the version property files that override the repo's defaults.
There are 3 files generated -->
<Target Name="CreateBuildInputProps"
DependsOnTargets="GetRepositoryReferenceInfo"
Inputs="$(MSBuildProjectFullPath)"
Outputs="$(BaseIntermediateOutputPath)CreateBuildInputProps.complete">
<ItemGroup>
<_CurrentSourceBuiltPackages Include="$(SourceBuiltPackagesPath)*.nupkg"
Exclude="$(SourceBuiltPackagesPath)*.symbols.nupkg" />
<!-- Collect all the NuGet packages from dependent repos except for the symbols -->
<_CurrentSourceBuiltPackages Include="@(DependentRepoPackageFile)"
Condition="'%(Extension)' == '.nupkg' and !$([System.String]::new('%(Filename)').EndsWith('.symbols')) " />
<_PreviouslyBuiltSourceBuiltPackages Include="$(PrebuiltSourceBuiltPackagesPath)*.nupkg" />
</ItemGroup>

Expand Down
9 changes: 5 additions & 4 deletions src/SourceBuild/content/repo-projects/aspnetcore.proj
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@

<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="roslyn" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<RepositoryReference Include="roslyn-analyzers" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="symreader" />
<RepositoryReference Include="xdt" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/SourceBuild/content/repo-projects/cecil.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion src/SourceBuild/content/repo-projects/deployment-tools.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/SourceBuild/content/repo-projects/diagnostics.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
</ItemGroup>

</Project>
37 changes: 3 additions & 34 deletions src/SourceBuild/content/repo-projects/dotnet.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,12 @@
- We need an "empty" build after the last real repo for prebuilt detection to work - this is that file.
- If we have a repo that is not in sdk's dependency tree, we can still build it by including it here. -->

<ItemGroup>
<!-- Toolsets -->
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="arcade" />
<!-- This import can be removed when https://github.com/dotnet/source-build/issues/4017 is resolved -->
<Import Project="$(MSBuildThisFileDirectory)installer-deps.props" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved

<!-- Product Repos -->
<RepositoryReference Include="command-line-api" />
<RepositoryReference Include="sourcelink" />
<RepositoryReference Include="diagnostics" />
<RepositoryReference Include="emsdk" />
<RepositoryReference Include="cecil" />
<RepositoryReference Include="symreader" />
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="roslyn" />
<RepositoryReference Include="windowsdesktop" Condition="'$(TargetOS)' == 'windows'" />
<RepositoryReference Include="xdt" />
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="roslyn-analyzers" />
<RepositoryReference Include="aspnetcore" />
<RepositoryReference Include="razor" />
<RepositoryReference Include="deployment-tools" />
<RepositoryReference Include="format" />
<RepositoryReference Include="nuget-client" />
<RepositoryReference Include="templating" />
<RepositoryReference Include="test-templates" />
<RepositoryReference Include="fsharp" />
<RepositoryReference Include="vstest" />
<RepositoryReference Include="sdk" />
<RepositoryReference Include="aspire" />
<ItemGroup>
<RepositoryReference Include="installer" />

<!-- Package source-build artifacts -->
<RepositoryReference Include="package-source-build" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />

<!-- Testing. -->
<RepositoryReference Include="scenario-tests" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions src/SourceBuild/content/repo-projects/emsdk.proj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/SourceBuild/content/repo-projects/format.proj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@

<ItemGroup>
<RepositoryReference Include="arcade" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<RepositoryReference Include="command-line-api" />
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="roslyn" />
<RepositoryReference Include="roslyn-analyzers" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="sourcelink" />
<RepositoryReference Include="symreader" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

</Project>
6 changes: 4 additions & 2 deletions src/SourceBuild/content/repo-projects/fsharp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@

<ItemGroup>
<RepositoryReference Include="arcade" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="msbuild" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<RepositoryReference Include="runtime" />
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="sourcelink" />
</ItemGroup>

</Project>
24 changes: 24 additions & 0 deletions src/SourceBuild/content/repo-projects/installer-deps.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project>

<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="aspire" />
<RepositoryReference Include="aspnetcore" />
<RepositoryReference Include="command-line-api" />
<RepositoryReference Include="deployment-tools" />
<RepositoryReference Include="emsdk" />
<RepositoryReference Include="fsharp" />
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="nuget-client" />
<RepositoryReference Include="roslyn" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="scenario-tests" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<RepositoryReference Include="sdk" />
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="symreader" />
<RepositoryReference Include="test-templates" />
<RepositoryReference Include="vstest" />
</ItemGroup>

</Project>
18 changes: 4 additions & 14 deletions src/SourceBuild/content/repo-projects/installer.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

<!-- Restore and Build actions are already passed in by the root script. -->
<BuildActions>$(FlagParameterPrefix)pack $(FlagParameterPrefix)publish</BuildActions>

mthalman marked this conversation as resolved.
Show resolved Hide resolved
<SkipEnsurePackagesCreated>true</SkipEnsurePackagesCreated>
mthalman marked this conversation as resolved.
Show resolved Hide resolved
mthalman marked this conversation as resolved.
Show resolved Hide resolved

<BuildArgs>$(BuildArgs) $(FlagParameterPrefix)runtime-id $(TargetRid)</BuildArgs>

Expand All @@ -34,20 +36,8 @@
<BuildArgs>$(BuildArgs) /p:UsePortableLinuxSharedFramework=false</BuildArgs>
</PropertyGroup>

<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="aspnetcore" />
<RepositoryReference Include="emsdk" />
<RepositoryReference Include="fsharp" />
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="nuget-client" />
<RepositoryReference Include="roslyn" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="sdk" />
<RepositoryReference Include="test-templates" />
<RepositoryReference Include="vstest" />
</ItemGroup>
<!-- Import RepositoryReferences of installer from a shared file -->
<Import Project="$(MSBuildThisFileDirectory)installer-deps.props" />

<!--
If we have authentication, keep the templating internal feed (if one exists) to acquire the
Expand Down
3 changes: 2 additions & 1 deletion src/SourceBuild/content/repo-projects/msbuild.proj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

<ItemGroup>
<RepositoryReference Include="arcade" />
<RepositoryReference Include="runtime" />
<RepositoryReference Include="roslyn" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<RepositoryReference Include="runtime" />
<RepositoryReference Include="source-build-reference-packages" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/SourceBuild/content/repo-projects/nuget-client.proj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="msbuild" />
<RepositoryReference Include="source-build-externals" Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<RepositoryReference Include="xdt" />
</ItemGroup>

Expand Down
34 changes: 28 additions & 6 deletions src/SourceBuild/content/repo-projects/package-source-build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
<EnableSourceControlManagerQueries>false</EnableSourceControlManagerQueries>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)installer-deps.props" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved

<ItemGroup>
<RepositoryReference Include="installer" />
</ItemGroup>

<Target Name="CustomRepoBuild"
AfterTargets="RepoBuild"
DependsOnTargets="CreateBuildInputProps;DetermineSourceBuiltSdkVersion">
<!-- Copy PVP to packages dir in order to package them together -->
<Copy SourceFiles="$(CurrentSourceBuiltPackageVersionPropsPath)" DestinationFiles="$(SourceBuiltPackagesPath)PackageVersions.props" />

<PropertyGroup>
<SourceBuildReferencePackagesDestination>$(SourceBuiltPackagesPath)SourceBuildReferencePackages/</SourceBuildReferencePackagesDestination>
<SourceBuildReferencePackagesDestinationDirName>SourceBuildReferencePackages</SourceBuildReferencePackagesDestinationDirName>
<SourceBuildReferencePackagesDestination>$(SourceBuiltPackagesPath)$(SourceBuildReferencePackagesDestinationDirName)/</SourceBuildReferencePackagesDestination>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -47,10 +47,32 @@
Overwrite="true" />

<MakeDir Directories="$(SharedOutputPath)" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<Exec Command="tar --numeric-owner --exclude='Microsoft.SourceBuild.Intermediate.*.nupkg' -czf $(SourceBuiltTarballName) $(SourceBuiltVersionFileName) *.nupkg *.props SourceBuildReferencePackages/"
WorkingDirectory="$(SourceBuiltPackagesPath)" />

<ItemGroup>
<_AllRepoDirs Include="$([System.IO.Directory]::GetDirectories($(SourceBuiltBasePackagesPath)))"
Exclude="$(SourceBuiltBasePackagesPath)package-source-build" />
</ItemGroup>

<!-- Create a layout directory for the files that are to be included in the artifacts tarball. Since there are a large number of files, this will use symlinks
instead of copying files to make this execute quickly. -->
<PropertyGroup>
<_SourceBuiltLayoutDir>$(BaseIntermediateOutputPath)artifacts-layout/</_SourceBuiltLayoutDir>
mthalman marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<MakeDir Directories="$(_SourceBuiltLayoutDir)$(SourceBuildReferencePackagesDestinationDirName)" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<Exec Command="ln -sf %(_AllRepoDirs.Identity)/* $(_SourceBuiltLayoutDir)"
Condition="$([System.IO.Directory]::GetFiles('%(_AllRepoDirs.Identity)')) != ''" />
mthalman marked this conversation as resolved.
Show resolved Hide resolved
<Exec Command="ln -sf $(SourceBuiltPackagesPath)$(SourceBuiltVersionFileName) $(_SourceBuiltLayoutDir)" />
<Exec Command="ln -sf $(CurrentSourceBuiltPackageVersionPropsPath) $(_SourceBuiltLayoutDir)PackageVersions.props" />
<Exec Command="ln -sf $(SourceBuildReferencePackagesDestination)* $(_SourceBuiltLayoutDir)$(SourceBuildReferencePackagesDestinationDirName)" />

<Exec Command="tar --numeric-owner -czhf $(SourceBuiltTarballName) $(SourceBuiltVersionFileName) *"
WorkingDirectory="$(_SourceBuiltLayoutDir)" />

<Message Importance="High" Text="Packaged source-built artifacts to $(SourceBuiltTarballName)" />
</Target>

<ItemGroup>
<RepositoryReference Include="installer" />
</ItemGroup>

mthalman marked this conversation as resolved.
Show resolved Hide resolved
</Project>
Loading