Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Commit

Permalink
Add shared projects instead of linked files to improve code sharing (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertvanHorrik authored and ctaggart committed May 4, 2017
1 parent ce1320b commit 55d9a32
Show file tree
Hide file tree
Showing 22 changed files with 161 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<!--<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>-->
</PropertyGroup>
<ItemGroup>
<Compile Include="..\SourceLink.Create.GitHub\GitCreateTask.cs" Link="GitCreateTask.cs" />
<Compile Include="..\SourceLink.Create.GitHub\Process.cs" Link="Process.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.1.548" />
Expand All @@ -36,6 +32,8 @@
<PackagePath>build/net461</PackagePath>
</Content>
</ItemGroup>
<Import Project="..\SourceLink.Create.Shared\SourceLink.Create.Shared.projitems" Label="Shared" />
<Import Project="..\SourceLink.Shared\SourceLink.Shared.projitems" Label="Shared" />

<Import Project="../build/sourcelink.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\SourceLink.Create.Shared\SourceLink.Create.Shared.projitems" Label="Shared" />
<Import Project="..\SourceLink.Shared\SourceLink.Shared.projitems" Label="Shared" />
<Import Project="../build/common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard1.4;net461</TargetFrameworks>
Expand Down
2 changes: 2 additions & 0 deletions SourceLink.Create.GitHub/SourceLink.Create.GitHub.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<PackagePath>build/net461</PackagePath>
</Content>
</ItemGroup>
<Import Project="..\SourceLink.Create.Shared\SourceLink.Create.Shared.projitems" Label="Shared" />
<Import Project="..\SourceLink.Shared\SourceLink.Shared.projitems" Label="Shared" />

<Import Project="../build/sourcelink.props" />
</Project>
14 changes: 14 additions & 0 deletions SourceLink.Create.Shared/SourceLink.Create.Shared.projitems
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>225d4dcf-82a5-49b0-8f45-7cbada058ca9</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>SourceLink.Create</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)GitCreateTask.cs" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions SourceLink.Create.Shared/SourceLink.Create.Shared.shproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>225d4dcf-82a5-49b0-8f45-7cbada058ca9</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="SourceLink.Create.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<IncludeBuildOutput>false</IncludeBuildOutput>
Expand All @@ -9,4 +9,5 @@
<PackagePath>build</PackagePath>
</Content>
</ItemGroup>
<Import Project="..\SourceLink.Embed.Shared\SourceLink.Embed.Shared.projitems" Label="Shared" />
</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.4</TargetFramework>
<IncludeBuildOutput>false</IncludeBuildOutput>
Expand All @@ -9,4 +9,5 @@
<PackagePath>build</PackagePath>
</Content>
</ItemGroup>
<Import Project="..\SourceLink.Embed.Shared\SourceLink.Embed.Shared.projitems" Label="Shared" />
</Project>
13 changes: 13 additions & 0 deletions SourceLink.Embed.Shared/SourceLink.Embed.Shared.projitems
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>083cd576-0be4-4aac-86d8-00e50c660759</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>SourceLink.Embed</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions SourceLink.Embed.Shared/SourceLink.Embed.Shared.shproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>083cd576-0be4-4aac-86d8-00e50c660759</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="SourceLink.Embed.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
File renamed without changes.
14 changes: 14 additions & 0 deletions SourceLink.Shared/SourceLink.Shared.projitems
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>b1b7304a-fb72-435b-920f-b2dc53da6054</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>SourceLink.Shared</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Process.cs" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions SourceLink.Shared/SourceLink.Shared.shproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>b1b7304a-fb72-435b-920f-b2dc53da6054</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="SourceLink.Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
5 changes: 1 addition & 4 deletions SourceLink.Test/SourceLink.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
<PackagePath>build/net461</PackagePath>
</Content>
</ItemGroup>

<ItemGroup>
<Compile Include="..\SourceLink.Create.GitHub\Process.cs" Link="Process.cs" />
</ItemGroup>
<Import Project="..\SourceLink.Shared\SourceLink.Shared.projitems" Label="Shared" />

<Import Project="../build/sourcelink.props" />
</Project>
41 changes: 39 additions & 2 deletions SourceLink.sln
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,33 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceLink.Create.CommandLi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceLink.Create.BitBucket", "SourceLink.Create.BitBucket\SourceLink.Create.BitBucket.csproj", "{76CC64F0-2D47-4B3C-ADEA-6E758953F2D3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourceLink.Embed.AllSourceFiles", "SourceLink.Embed.AllSourceFiles\SourceLink.Embed.AllSourceFiles.csproj", "{A791FDDC-9BAD-441B-9545-C26D2292E5C3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceLink.Embed.AllSourceFiles", "SourceLink.Embed.AllSourceFiles\SourceLink.Embed.AllSourceFiles.csproj", "{A791FDDC-9BAD-441B-9545-C26D2292E5C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourceLink.Embed.PaketFiles", "SourceLink.Embed.PaketFiles\SourceLink.Embed.PaketFiles.csproj", "{81801FB5-9388-43BA-B8FD-508A428C03CF}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceLink.Embed.PaketFiles", "SourceLink.Embed.PaketFiles\SourceLink.Embed.PaketFiles.csproj", "{81801FB5-9388-43BA-B8FD-508A428C03CF}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "dotnet-sourcelink-shared", "dotnet-sourcelink-shared\dotnet-sourcelink-shared.shproj", "{FD0C81CE-4FAE-47CE-B89A-20F1DB6DAD0A}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SourceLink.Embed.Shared", "SourceLink.Embed.Shared\SourceLink.Embed.Shared.shproj", "{083CD576-0BE4-4AAC-86D8-00E50C660759}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dotnet", "dotnet", "{2402E19F-C4A4-43A4-B939-F5CD198EEED3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SourceLink", "SourceLink", "{07737978-28A8-42A2-A240-A66EF5EC4C5E}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SourceLink.Create.Shared", "SourceLink.Create.Shared\SourceLink.Create.Shared.shproj", "{225D4DCF-82A5-49B0-8F45-7CBADA058CA9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Create", "Create", "{F157756B-2442-4131-848B-CBEF39E8F706}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Embed", "Embed", "{CB177CE6-ADA8-4017-B5B3-579B72B67B2A}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SourceLink.Shared", "SourceLink.Shared\SourceLink.Shared.shproj", "{B1B7304A-FB72-435B-920F-B2DC53DA6054}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
SourceLink.Embed.Shared\SourceLink.Embed.Shared.projitems*{083cd576-0be4-4aac-86d8-00e50c660759}*SharedItemsImports = 13
SourceLink.Create.Shared\SourceLink.Create.Shared.projitems*{225d4dcf-82a5-49b0-8f45-7cbada058ca9}*SharedItemsImports = 13
SourceLink.Shared\SourceLink.Shared.projitems*{b1b7304a-fb72-435b-920f-b2dc53da6054}*SharedItemsImports = 13
dotnet-sourcelink-shared\dotnet-sourcelink-shared.projitems*{fd0c81ce-4fae-47ce-b89a-20f1db6dad0a}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -151,4 +173,19 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{68D40DAC-77EF-426A-979D-1CC4723CB2A1} = {2402E19F-C4A4-43A4-B939-F5CD198EEED3}
{5CEE8EC8-7A54-4860-8B5D-29F89D7F7F4C} = {F157756B-2442-4131-848B-CBEF39E8F706}
{87BCE13E-47FF-43A4-ADF4-F645FD4966AD} = {2402E19F-C4A4-43A4-B939-F5CD198EEED3}
{FB0D8C0B-27DF-4D20-9F15-09794D95F744} = {F157756B-2442-4131-848B-CBEF39E8F706}
{76CC64F0-2D47-4B3C-ADEA-6E758953F2D3} = {F157756B-2442-4131-848B-CBEF39E8F706}
{A791FDDC-9BAD-441B-9545-C26D2292E5C3} = {CB177CE6-ADA8-4017-B5B3-579B72B67B2A}
{81801FB5-9388-43BA-B8FD-508A428C03CF} = {CB177CE6-ADA8-4017-B5B3-579B72B67B2A}
{FD0C81CE-4FAE-47CE-B89A-20F1DB6DAD0A} = {2402E19F-C4A4-43A4-B939-F5CD198EEED3}
{083CD576-0BE4-4AAC-86D8-00E50C660759} = {CB177CE6-ADA8-4017-B5B3-579B72B67B2A}
{225D4DCF-82A5-49B0-8F45-7CBADA058CA9} = {F157756B-2442-4131-848B-CBEF39E8F706}
{F157756B-2442-4131-848B-CBEF39E8F706} = {07737978-28A8-42A2-A240-A66EF5EC4C5E}
{CB177CE6-ADA8-4017-B5B3-579B72B67B2A} = {07737978-28A8-42A2-A240-A66EF5EC4C5E}
{B1B7304A-FB72-435B-920F-B2DC53DA6054} = {07737978-28A8-42A2-A240-A66EF5EC4C5E}
EndGlobalSection
EndGlobal
6 changes: 1 addition & 5 deletions dotnet-sourcelink-git/dotnet-sourcelink-git.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@
<PackageType>DotnetCliTool</PackageType>
<RootNamespace>SourceLink.Git</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\dotnet-sourcelink\SourceLinkJson.cs" Link="SourceLinkJson.cs" />
<Compile Include="..\dotnet-sourcelink\System.cs" Link="System.cs" />
<Compile Include="..\dotnet-sourcelink\Version.cs" Link="Version.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="LibGit2Sharp.Portable" Version="0.24.10" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
<Import Project="..\dotnet-sourcelink-shared\dotnet-sourcelink-shared.projitems" Label="Shared" />
<Import Project="../build/sourcelink.props" />
</Project>
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions dotnet-sourcelink-shared/dotnet-sourcelink-shared.projitems
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>fd0c81ce-4fae-47ce-b89a-20f1db6dad0a</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>SourceLink</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)SourceLinkJson.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Version.cs" />
</ItemGroup>
</Project>
13 changes: 13 additions & 0 deletions dotnet-sourcelink-shared/dotnet-sourcelink-shared.shproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>fd0c81ce-4fae-47ce-b89a-20f1db6dad0a</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<PropertyGroup />
<Import Project="dotnet-sourcelink-shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>
1 change: 1 addition & 0 deletions dotnet-sourcelink/dotnet-sourcelink.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
<PackageReference Include="NuGet.Packaging" Version="4.0.0" />
<PackageReference Include="System.Reflection.Metadata" Version="1.4.2" />
</ItemGroup>
<Import Project="..\dotnet-sourcelink-shared\dotnet-sourcelink-shared.projitems" Label="Shared" />
<Import Project="../build/sourcelink.props" />
</Project>

0 comments on commit 55d9a32

Please sign in to comment.