Skip to content

Commit

Permalink
Generate tarball smoke-test nuget.config
Browse files Browse the repository at this point in the history
  • Loading branch information
dagood committed Sep 28, 2020
1 parent 8aa30a1 commit 60dbbc6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
42 changes: 30 additions & 12 deletions eng/SourceBuild.Tarball.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
Project="SourceBuild.Tarball.DestructiveCleanup.targets"
Condition="'$(DestructiveIntermediateClean)' == 'true'"/>

<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="RemoveInternetSourcesFromNuGetConfig" />

<Target Name="GetTarballDirProps">
<PropertyGroup>
<TarballRootDir>$([MSBuild]::NormalizeDirectory('$(TarballRoot)'))</TarballRootDir>
Expand Down Expand Up @@ -151,23 +153,39 @@
Include="$(ProjectDir)support/tarball/build.sh"
RelativeDestination="build.sh" />

<!--
When building an internal build, the main smoke-test nuget config has authenticated sources
in it to generate a full set of smoke-test-prereqs. This isn't necessary in the tarball
because we have those smoke-test-prereqs, but we hit authentication errors nonetheless. Copy
a trimmed down nuget.config in this case.
TODO: Automatically trim down the main nuget.config.
-->
<TarballCopyFile
Condition="Exists('$(ProjectDir)support\tarball\smoke-testNuGet.Config')"
Include="$(ProjectDir)support\tarball\smoke-testNuGet.Config"
RelativeDestination="smoke-testNuGet.Config" />

<!-- Setup package version props to include both source-built and running PackageVersions.props -->
<TarballCopyFile
Include="$(ProjectDir)support\tarball\PackageVersions.props"
RelativeRoot="artifacts/obj/$(Platform)/Release/" />
</ItemGroup>

<!--
When building an internal build, the main smoke-test nuget config has authenticated sources in
it to generate a full set of smoke-test-prereqs. We need to get rid of these internal feeds in
the tarball to avoid hitting authentication errors. (In the tarball, we have those
smoke-test-prereqs in a local feed, so this is fine.)
Use the nuget trimming task to create a tarball nuget.config without the internal feeds, for
this case. Importantly, this leaves public feeds alone: when running a public servicing build,
we need to use them for runtime packs, and the smoke-test-prereqs tarball won't contain them.
-->
<PropertyGroup>
<FilteredSmokeTestNuGetConfig>$(ArtifactsDir)support\smoke-testNuGet.Config</FilteredSmokeTestNuGetConfig>
</PropertyGroup>

<Copy
SourceFiles="$(ProjectDir)smoke-testNuGet.Config"
DestinationFiles="$(FilteredSmokeTestNuGetConfig)" />

<RemoveInternetSourcesFromNuGetConfig
NuGetConfigFile="$(FilteredSmokeTestNuGetConfig)"
OfflineBuild="false" />

<ItemGroup>
<TarballCopyFile
Include="$(FilteredSmokeTestNuGetConfig)"
RelativeDestination="smoke-testNuGet.Config" />
</ItemGroup>
</Target>

<Target Name="AddTarballPackages">
Expand Down
14 changes: 0 additions & 14 deletions support/tarball/smoke-testNuGet.Config

This file was deleted.

0 comments on commit 60dbbc6

Please sign in to comment.