Skip to content

Commit d7bcdaa

Browse files
committed
Bundle Source Link packages
1 parent e0390ce commit d7bcdaa

File tree

15 files changed

+380
-12
lines changed

15 files changed

+380
-12
lines changed

eng/Version.Details.xml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,36 @@
266266
<Uri>https://github.com/dotnet/deployment-tools</Uri>
267267
<Sha>b60c95e1ce736630d17e16626c59e3dd85ebae2b</Sha>
268268
</Dependency>
269+
<Dependency Name="Microsoft.Build.Tasks.Git" Version="1.2.0-beta-23207-01">
270+
<Uri>https://github.com/dotnet/sourcelink</Uri>
271+
<Sha>31a772fb8b2e3430e91766cdb169fba379f0d013</Sha>
272+
<SourceBuild RepoName="sourcelink" ManagedOnly="true" />
273+
</Dependency>
274+
<Dependency Name="Microsoft.SourceLink.Common" Version="1.2.0-beta-23207-01">
275+
<Uri>https://github.com/dotnet/sourcelink</Uri>
276+
<Sha>31a772fb8b2e3430e91766cdb169fba379f0d013</Sha>
277+
<SourceBuild RepoName="sourcelink" ManagedOnly="true" />
278+
</Dependency>
279+
<Dependency Name="Microsoft.SourceLink.AzureRepos.Git" Version="1.2.0-beta-23207-01">
280+
<Uri>https://github.com/dotnet/sourcelink</Uri>
281+
<Sha>31a772fb8b2e3430e91766cdb169fba379f0d013</Sha>
282+
<SourceBuild RepoName="sourcelink" ManagedOnly="true" />
283+
</Dependency>
284+
<Dependency Name="Microsoft.SourceLink.GitHub" Version="1.2.0-beta-23207-01">
285+
<Uri>https://github.com/dotnet/sourcelink</Uri>
286+
<Sha>31a772fb8b2e3430e91766cdb169fba379f0d013</Sha>
287+
<SourceBuild RepoName="sourcelink" ManagedOnly="true" />
288+
</Dependency>
289+
<Dependency Name="Microsoft.SourceLink.GitLab" Version="1.2.0-beta-23207-01">
290+
<Uri>https://github.com/dotnet/sourcelink</Uri>
291+
<Sha>31a772fb8b2e3430e91766cdb169fba379f0d013</Sha>
292+
<SourceBuild RepoName="sourcelink" ManagedOnly="true" />
293+
</Dependency>
294+
<Dependency Name="Microsoft.SourceLink.BitBucket.Git" Version="1.2.0-beta-23207-01">
295+
<Uri>https://github.com/dotnet/sourcelink</Uri>
296+
<Sha>31a772fb8b2e3430e91766cdb169fba379f0d013</Sha>
297+
<SourceBuild RepoName="sourcelink" ManagedOnly="true" />
298+
</Dependency>
269299
<!-- Explicit dependency because Microsoft.Deployment.DotNet.Releases has different versioning
270300
than the SB intermediate -->
271301
<Dependency Name="Microsoft.SourceBuild.Intermediate.deployment-tools" Version="8.0.0-preview.1.23159.4">
@@ -280,9 +310,9 @@
280310
<Sha>747f53d751983dd062f39f4654bff074536e0012</Sha>
281311
<SourceBuild RepoName="arcade" ManagedOnly="true" />
282312
</Dependency>
283-
<Dependency Name="Microsoft.SourceLink.GitHub" Version="1.2.0-beta-23175-02" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
313+
<Dependency Name="Microsoft.SourceLink.GitHub" Version="1.2.0-beta-23207-01" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
284314
<Uri>https://github.com/dotnet/sourcelink</Uri>
285-
<Sha>ccfca8dce5f7525433756281c2c275386348a9ad</Sha>
315+
<Sha>31a772fb8b2e3430e91766cdb169fba379f0d013</Sha>
286316
<SourceBuild RepoName="sourcelink" ManagedOnly="true" />
287317
</Dependency>
288318
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.23177.4">

eng/Versions.props

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,15 @@
174174
<!-- Dependencies from https://github.com/dotnet/xliff-tasks -->
175175
<MicrosoftDotNetXliffTasksVersion>1.0.0-beta.23175.1</MicrosoftDotNetXliffTasksVersion>
176176
</PropertyGroup>
177+
<PropertyGroup>
178+
<!-- Dependencies from https://github.com/dotnet/sourcelink -->
179+
<MicrosoftBuildTasksGitVersion>1.2.0-beta-23207-01</MicrosoftBuildTasksGitVersion>
180+
<MicrosoftSourceLinkCommonVersion>1.2.0-beta-23207-01</MicrosoftSourceLinkCommonVersion>
181+
<MicrosoftSourceLinkAzureReposGitVersion>1.2.0-beta-23207-01</MicrosoftSourceLinkAzureReposGitVersion>
182+
<MicrosoftSourceLinkGitHubVersion>1.2.0-beta-23207-01</MicrosoftSourceLinkGitHubVersion>
183+
<MicrosoftSourceLinkGitLabVersion>1.2.0-beta-23207-01</MicrosoftSourceLinkGitLabVersion>
184+
<MicrosoftSourceLinkBitBucketVersion>1.2.0-beta-23207-01</MicrosoftSourceLinkBitBucketVersion>
185+
</PropertyGroup>
177186
<!-- Get .NET Framework reference assemblies from NuGet packages -->
178187
<PropertyGroup>
179188
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<Project>
2+
</Project>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<Project>
2+
</Project>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Copyright (c) .NET Foundation and contributors. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System;
5+
6+
Console.WriteLine("Hello World!");
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<RestorePackagesPath Condition=" '$(RestorePackagesPath)' == '' ">$(MSBuildThisFileDirectory)..\..\..\artifacts\.nuget\packages</RestorePackagesPath>
4+
<NoPackageAnalysis>true</NoPackageAnalysis>
5+
<TargetFramework>$(CurrentTargetFramework)</TargetFramework>
6+
<OutputType>Exe</OutputType>
7+
</PropertyGroup>
8+
</Project>

src/Layout/redist/targets/BundledSdks.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,12 @@
44
<BundledSdk Include="Microsoft.NET.Sdk.WindowsDesktop" Version="$(MicrosoftNETSdkWindowsDesktopPackageVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
55
<BundledSdk Include="FSharp.NET.Sdk" Version="1.0.4-bundled-0100" />
66
<BundledSdk Include="Microsoft.Docker.Sdk" Version="1.1.0" />
7+
8+
<BundledSdk Include="Microsoft.Build.Tasks.Git" Version="$(MicrosoftBuildTasksGitVersion)" />
9+
<BundledSdk Include="Microsoft.SourceLink.Common" Version="$(MicrosoftSourceLinkCommonVersion)" />
10+
<BundledSdk Include="Microsoft.SourceLink.AzureRepos.Git" Version="$(MicrosoftSourceLinkAzureReposGitVersion)" />
11+
<BundledSdk Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" />
12+
<BundledSdk Include="Microsoft.SourceLink.GitLab" Version="$(MicrosoftSourceLinkGitLabVersion)" />
13+
<BundledSdk Include="Microsoft.SourceLink.Bitbucket.Git" Version="$(MicrosoftSourceLinkBitBucketVersion)" />
714
</ItemGroup>
815
</Project>

src/Layout/redist/targets/RestoreDependency.proj

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project ToolsVersion="15.0" DefaultTargets="EnsureDependencyRestored;CopySdkToOutput">
1+
<Project ToolsVersion="15.0" DefaultTargets="PrepareBundledDependencyProps;EnsureDependencyRestored;CopySdkToOutput">
22
<!--
33
44
Note that the CopySdkToOutput target explicitly does NOT have Inputs and Outputs declared.
@@ -24,24 +24,29 @@
2424

2525
<Target Name="GetSdkItemsToCopy">
2626
<ItemGroup>
27-
<SdkContent Include="$(DependencyNuPkgPath)/**/*"
28-
Exclude="$(DependencyNuPkgPath)/$(DependencyPackageName).nuspec;
29-
$(DependencyNuPkgPath)/$(DependencyPackageName).$(DependencyPackageVersion).nupkg;
30-
$(DependencyNuPkgPath)/$(DependencyPackageName).$(DependencyPackageVersion).nupkg.sha512" />
27+
<SdkContent Include="$(DependencyNuPkgPath)**\*"
28+
Exclude="$(DependencyNuPkgPath)Icon.png;
29+
$(DependencyNuPkgPath)$(DependencyPackageName).nuspec;
30+
$(DependencyNuPkgPath)$(DependencyPackageName).$(DependencyPackageVersion).nupkg;
31+
$(DependencyNuPkgPath)$(DependencyPackageName).$(DependencyPackageVersion).nupkg.sha512" />
3132
</ItemGroup>
3233
</Target>
3334

3435
<Target Name="EnsureDependencyRestored"
35-
Condition="!Exists('$(DependencyNuPkgPath)/$(DependencyPackageName.ToLower()).nuspec')">
36+
DependsOnTargets="PrepareBundledDependencyProps"
37+
Condition="!Exists('$(DependencyNuPkgPath)$(DependencyPackageName.ToLower()).nuspec')">
38+
39+
<Message Text="Dependency has not been restored yet: '$(DependencyNuPkgPath)$(DependencyPackageName.ToLower()).nuspec'"/>
40+
3641
<MSbuild
37-
Projects="$(MSBuildThisFileDirectory)/sdks/sdks.csproj"
42+
Projects="$(MSBuildThisFileDirectory)sdks\sdks.csproj"
3843
Properties="DependencyPackageName=$(DependencyPackageName);DependencyPackageVersion=$(DependencyPackageVersion)"
3944
Targets="Restore" />
4045
</Target>
4146

4247
<Target Name="PrepareBundledDependencyProps">
4348
<PropertyGroup>
44-
<DependencyNuPkgPath>$(NuGetPackageRoot)/$(DependencyPackageName.ToLower())/$(DependencyPackageVersion.ToLower())</DependencyNuPkgPath>
49+
<DependencyNuPkgPath>$(NuGetPackageRoot)$(DependencyPackageName.ToLower())\$(DependencyPackageVersion.ToLower())\</DependencyNuPkgPath>
4550
</PropertyGroup>
4651
</Target>
4752
</Project>

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.Common.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Copyright (c) .NET Foundation. All rights reserved.
1313

1414
<!-- This file is imported by both cross-targeting and inner builds. Set properties that need to be available to both here. -->
1515

16+
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.SourceLink.targets" />
17+
1618
<PropertyGroup>
1719
<MicrosoftNETBuildTasksDirectoryRoot>$(MSBuildThisFileDirectory)..\tools\</MicrosoftNETBuildTasksDirectoryRoot>
1820
<MicrosoftNETBuildTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net8.0</MicrosoftNETBuildTasksTFM>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--
2+
***********************************************************************************************
3+
Microsoft.NET.Sdk.FSharp.props
4+
5+
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
6+
created a backup copy. Incorrect changes to this file will make it
7+
impossible to load or build your projects from the command-line or the IDE.
8+
9+
Copyright (c) .NET Foundation. All rights reserved.
10+
***********************************************************************************************
11+
-->
12+
13+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
14+
15+
<PropertyGroup>
16+
<_SourceLinkSdkSubDir>build</_SourceLinkSdkSubDir>
17+
<_SourceLinkSdkSubDir Condition="'$(IsCrossTargetingBuild)' == 'true'">buildMultiTargeting</_SourceLinkSdkSubDir>
18+
19+
<!-- Suppress implicit SourceLink inclusion if any Microsoft.SourceLink package is referenced. -->
20+
<SuppressImplicitGitSourceLink Condition="'$(SuppressImplicitGitSourceLink)' == '' and '$(PkgMicrosoft_SourceLink_Common)' != ''">true</SuppressImplicitGitSourceLink>
21+
</PropertyGroup>
22+
23+
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.Build.Tasks.Git\$(_SourceLinkSdkSubDir)\Microsoft.Build.Tasks.Git.props" Condition="'$(SuppressImplicitGitSourceLink)' != 'true'"/>
24+
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.Common\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.Common.props" Condition="'$(SuppressImplicitGitSourceLink)' != 'true'"/>
25+
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.GitHub\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.GitHub.props" Condition="'$(SuppressImplicitGitSourceLink)' != 'true'"/>
26+
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.GitLab\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.GitLab.props" Condition="'$(SuppressImplicitGitSourceLink)' != 'true'"/>
27+
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.AzureRepos.Git\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.AzureRepos.Git.props" Condition="'$(SuppressImplicitGitSourceLink)' != 'true'"/>
28+
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.Bitbucket.Git\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.Bitbucket.Git.props" Condition="'$(SuppressImplicitGitSourceLink)' != 'true'"/>
29+
30+
</Project>

0 commit comments

Comments
 (0)