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

Bundle Source Link packages #31632

Merged
merged 9 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 25 additions & 5 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,31 @@
<Uri>https://github.com/dotnet/deployment-tools</Uri>
<Sha>b60c95e1ce736630d17e16626c59e3dd85ebae2b</Sha>
</Dependency>
<Dependency Name="Microsoft.Build.Tasks.Git" Version="8.0.0-beta.23210.3">
<Uri>https://github.com/dotnet/sourcelink</Uri>
<Sha>759f344923a0859f3fae83431d0ba1cc62108118</Sha>
<SourceBuild RepoName="sourcelink" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.SourceLink.Common" Version="8.0.0-beta.23210.3">
<Uri>https://github.com/dotnet/sourcelink</Uri>
<Sha>759f344923a0859f3fae83431d0ba1cc62108118</Sha>
</Dependency>
<Dependency Name="Microsoft.SourceLink.AzureRepos.Git" Version="8.0.0-beta.23210.3">
<Uri>https://github.com/dotnet/sourcelink</Uri>
<Sha>759f344923a0859f3fae83431d0ba1cc62108118</Sha>
</Dependency>
<Dependency Name="Microsoft.SourceLink.GitHub" Version="8.0.0-beta.23210.3">
<Uri>https://github.com/dotnet/sourcelink</Uri>
<Sha>759f344923a0859f3fae83431d0ba1cc62108118</Sha>
</Dependency>
<Dependency Name="Microsoft.SourceLink.GitLab" Version="8.0.0-beta.23210.3">
<Uri>https://github.com/dotnet/sourcelink</Uri>
<Sha>759f344923a0859f3fae83431d0ba1cc62108118</Sha>
</Dependency>
<Dependency Name="Microsoft.SourceLink.BitBucket.Git" Version="8.0.0-beta.23210.3">
<Uri>https://github.com/dotnet/sourcelink</Uri>
<Sha>759f344923a0859f3fae83431d0ba1cc62108118</Sha>
</Dependency>
<!-- Explicit dependency because Microsoft.Deployment.DotNet.Releases has different versioning
than the SB intermediate -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.deployment-tools" Version="8.0.0-preview.1.23159.4">
Expand All @@ -288,11 +313,6 @@
<Sha>17d9eee32f20a6af0ebb620254a22f601d159578</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.SourceLink.GitHub" Version="8.0.0-beta.23210.3" CoherentParentDependency="Microsoft.DotNet.Arcade.Sdk">
<Uri>https://github.com/dotnet/sourcelink</Uri>
<Sha>759f344923a0859f3fae83431d0ba1cc62108118</Sha>
<SourceBuild RepoName="sourcelink" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.23211.8">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>17d9eee32f20a6af0ebb620254a22f601d159578</Sha>
Expand Down
9 changes: 9 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@
<!-- Dependencies from https://github.com/dotnet/xliff-tasks -->
<MicrosoftDotNetXliffTasksVersion>1.0.0-beta.23206.1</MicrosoftDotNetXliffTasksVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/sourcelink -->
<MicrosoftBuildTasksGitVersion>8.0.0-beta.23210.3</MicrosoftBuildTasksGitVersion>
<MicrosoftSourceLinkCommonVersion>8.0.0-beta.23210.3</MicrosoftSourceLinkCommonVersion>
<MicrosoftSourceLinkAzureReposGitVersion>8.0.0-beta.23210.3</MicrosoftSourceLinkAzureReposGitVersion>
<MicrosoftSourceLinkGitHubVersion>8.0.0-beta.23210.3</MicrosoftSourceLinkGitHubVersion>
<MicrosoftSourceLinkGitLabVersion>8.0.0-beta.23210.3</MicrosoftSourceLinkGitLabVersion>
<MicrosoftSourceLinkBitBucketVersion>8.0.0-beta.23210.3</MicrosoftSourceLinkBitBucketVersion>
</PropertyGroup>
<!-- Get .NET Framework reference assemblies from NuGet packages -->
<PropertyGroup>
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<Project>
</Project>
12 changes: 12 additions & 0 deletions src/Assets/TestProjects/SourceLinkTestApp/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

class Program
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<NoPackageAnalysis>true</NoPackageAnalysis>
<TargetFramework>$(CurrentTargetFramework)</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
</Project>
7 changes: 7 additions & 0 deletions src/Layout/redist/targets/BundledSdks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@
<BundledSdk Include="Microsoft.NET.Sdk.WindowsDesktop" Version="$(MicrosoftNETSdkWindowsDesktopPackageVersion)" Condition="'$(DotNetBuildFromSource)' != 'true'" />
<BundledSdk Include="FSharp.NET.Sdk" Version="1.0.4-bundled-0100" />
<BundledSdk Include="Microsoft.Docker.Sdk" Version="1.1.0" />

<BundledSdk Include="Microsoft.Build.Tasks.Git" Version="$(MicrosoftBuildTasksGitVersion)" />
<BundledSdk Include="Microsoft.SourceLink.Common" Version="$(MicrosoftSourceLinkCommonVersion)" />
<BundledSdk Include="Microsoft.SourceLink.AzureRepos.Git" Version="$(MicrosoftSourceLinkAzureReposGitVersion)" />
<BundledSdk Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubVersion)" />
<BundledSdk Include="Microsoft.SourceLink.GitLab" Version="$(MicrosoftSourceLinkGitLabVersion)" />
<BundledSdk Include="Microsoft.SourceLink.Bitbucket.Git" Version="$(MicrosoftSourceLinkBitBucketVersion)" />
</ItemGroup>
</Project>
23 changes: 13 additions & 10 deletions src/Layout/redist/targets/RestoreDependency.proj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project ToolsVersion="15.0" DefaultTargets="EnsureDependencyRestored;CopySdkToOutput">
<Project ToolsVersion="15.0" DefaultTargets="PrepareBundledDependencyProps;EnsureDependencyRestored;CopySdkToOutput">
tmat marked this conversation as resolved.
Show resolved Hide resolved
<!--

Note that the CopySdkToOutput target explicitly does NOT have Inputs and Outputs declared.
Expand All @@ -10,8 +10,7 @@
-->

<Target Name="CopySdkToOutput"
DependsOnTargets="PrepareBundledDependencyProps;
EnsureDependencyRestored;
DependsOnTargets="EnsureDependencyRestored;
GetSdkItemsToCopy"
Condition="'$(SdkLayoutDirectory)' != ''"
>
Expand All @@ -24,24 +23,28 @@

<Target Name="GetSdkItemsToCopy">
<ItemGroup>
<SdkContent Include="$(DependencyNuPkgPath)/**/*"
Exclude="$(DependencyNuPkgPath)/$(DependencyPackageName).nuspec;
$(DependencyNuPkgPath)/$(DependencyPackageName).$(DependencyPackageVersion).nupkg;
$(DependencyNuPkgPath)/$(DependencyPackageName).$(DependencyPackageVersion).nupkg.sha512" />
<SdkContent Include="$(DependencyNuPkgPath)**\*"
Exclude="$(DependencyNuPkgPath)Icon.png;
$(DependencyNuPkgPath)$(DependencyPackageName).nuspec;
$(DependencyNuPkgPath)$(DependencyPackageName).$(DependencyPackageVersion).nupkg;
$(DependencyNuPkgPath)$(DependencyPackageName).$(DependencyPackageVersion).nupkg.sha512" />
</ItemGroup>
</Target>

<Target Name="EnsureDependencyRestored"
Condition="!Exists('$(DependencyNuPkgPath)/$(DependencyPackageName.ToLower()).nuspec')">
Condition="!Exists('$(DependencyNuPkgPath)$(DependencyPackageName.ToLower()).nuspec')">

<Message Text="Dependency has not been restored yet: '$(DependencyNuPkgPath)$(DependencyPackageName.ToLower()).nuspec'"/>

<MSbuild
Projects="$(MSBuildThisFileDirectory)/sdks/sdks.csproj"
Projects="$(MSBuildThisFileDirectory)sdks\sdks.csproj"
Properties="DependencyPackageName=$(DependencyPackageName);DependencyPackageVersion=$(DependencyPackageVersion)"
Targets="Restore" />
</Target>

<Target Name="PrepareBundledDependencyProps">
<PropertyGroup>
<DependencyNuPkgPath>$(NuGetPackageRoot)/$(DependencyPackageName.ToLower())/$(DependencyPackageVersion.ToLower())</DependencyNuPkgPath>
<DependencyNuPkgPath>$(NuGetPackageRoot)$(DependencyPackageName.ToLower())\$(DependencyPackageVersion.ToLower())\</DependencyNuPkgPath>
</PropertyGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<Import Project="Microsoft.NET.Sdk.Common.targets"/>
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.SourceLink.targets" Condition="'$(SuppressImplicitGitSourceLink)' != 'true'"/>

<!--
============================================================
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--
***********************************************************************************************
Microsoft.NET.Sdk.SourceLink.props

WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.

Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<_SourceLinkSdkSubDir>build</_SourceLinkSdkSubDir>
<_SourceLinkSdkSubDir Condition="'$(IsCrossTargetingBuild)' == 'true'">buildMultiTargeting</_SourceLinkSdkSubDir>

<!-- Suppress implicit SourceLink inclusion if any Microsoft.SourceLink package is referenced. -->
<SuppressImplicitGitSourceLink Condition="'$(PkgMicrosoft_SourceLink_Common)' != ''">true</SuppressImplicitGitSourceLink>
</PropertyGroup>

<ImportGroup Condition="'$(SuppressImplicitGitSourceLink)' != 'true'">
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.Build.Tasks.Git\$(_SourceLinkSdkSubDir)\Microsoft.Build.Tasks.Git.props"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.Common\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.Common.props"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.GitHub\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.GitHub.props"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.GitLab\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.GitLab.props"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.AzureRepos.Git\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.AzureRepos.Git.props"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.Bitbucket.Git\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.Bitbucket.Git.props"/>
</ImportGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!--
***********************************************************************************************
Microsoft.NET.Sdk.SourceLink.targets

WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.

Copyright (c) .NET Foundation. All rights reserved.
***********************************************************************************************
-->

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- C++ projects currently do not import Microsoft.NET.Sdk.props. -->
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.SourceLink.props" Condition="'$(_SourceLinkSdkSubDir)' == ''"/>

<PropertyGroup>
<EmbedUntrackedSources Condition="'$(EmbedUntrackedSources)' == ''">true</EmbedUntrackedSources>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.Build.Tasks.Git\$(_SourceLinkSdkSubDir)\Microsoft.Build.Tasks.Git.targets"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.Common\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.Common.targets"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.GitHub\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.GitHub.targets"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.GitLab\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.GitLab.targets"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.AzureRepos.Git\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.AzureRepos.Git.targets"/>
<Import Project="$(MSBuildThisFileDirectory)..\..\Microsoft.SourceLink.Bitbucket.Git\$(_SourceLinkSdkSubDir)\Microsoft.SourceLink.Bitbucket.Git.targets"/>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ Copyright (c) .NET Foundation. All rights reserved.
<!-- List of supported .NET windows target platform versions -->
<Import Project="Microsoft.NET.WindowsSdkSupportedTargetPlatforms.props" />

<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.SourceLink.props" />

<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.CSharp.props" Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.VisualBasic.props" Condition="'$(MSBuildProjectExtension)' == '.vbproj'" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.FSharp.props" Condition="'$(MSBuildProjectExtension)' == '.fsproj'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<ProjectCapability Remove="ReferenceManagerAssemblies" />
</ItemGroup>

<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.Sdk.SourceLink.targets" Condition="'$(SuppressImplicitGitSourceLink)' != 'true'" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DisableStandardFrameworkResolution.targets" Condition="'$(DisableStandardFrameworkResolution)' == 'true'" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.DesignerSupport.targets" />
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NET.GenerateAssemblyInfo.targets" Condition="'$(UsingNETSdkDefaults)' == 'true'"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<PropertyGroup>
<EnableDefaultItems>false</EnableDefaultItems>
<OutDirName>Tests\$(MSBuildProjectName)</OutDirName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
Expand Down
Loading