-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow running samples from main solution for debugging
Projects can be added to the main solution and set as the target for roslyn debugging as needed. The new directory targets simulate package referencing and remove the actual package reference that's otherwise used (using solution name to detect standalone vs debugging sources mode).
- Loading branch information
Showing
9 changed files
with
64 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
namespace Sample; | ||
using StructId; | ||
|
||
namespace Sample; | ||
|
||
public record Product(ProductId Id, string Name); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Project> | ||
<Import Project="..\Directory.Build.props" /> | ||
|
||
<PropertyGroup> | ||
<FromSource>false</FromSource> | ||
<FromSource Condition="$(SolutionName) == 'StructId'">true</FromSource> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<Project> | ||
<Import Project="..\Directory.Build.targets" /> | ||
|
||
<PropertyGroup> | ||
<AfterMicrosoftNETSdkTargets>$(AfterMicrosoftNETSdkTargets);$(MSBuildThisFileDirectory)..\StructId.Package\StructId.targets</AfterMicrosoftNETSdkTargets> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="$(FromSource)"> | ||
<PackageReference Remove="StructId" /> | ||
<PackageReference Include="Scriban" Version="5.12.1" GeneratePathProperty="true" /> | ||
|
||
<ProjectReference Include="$(MSBuildThisFileDirectory)..\StructId.Analyzer\StructId.Analyzer.csproj" OutputItemType="Analyzer" /> | ||
<ProjectReference Include="$(MSBuildThisFileDirectory)..\StructId.CodeFix\StructId.CodeFix.csproj" OutputItemType="Analyzer" /> | ||
<ProjectReference Include="$(MSBuildThisFileDirectory)..\StructId.Package\StructId.Package.msbuildproj" ReferenceOutputAssembly="false" /> | ||
|
||
<Analyzer Include="$(PkgScriban)/lib/netstandard2.0/Scriban.dll" Condition="Exists('$(PkgScriban)/lib/netstandard2.0/Scriban.dll')" /> | ||
</ItemGroup> | ||
|
||
<Target Name="FromSource" Condition="$(FromSource)" BeforeTargets="AddStructId"> | ||
<ItemGroup> | ||
<!-- These would be added from the package-relative paths by the StructId.targets --> | ||
<StructIdCompile Include="$(MSBuildThisFileDirectory)..\StructId\*.cs" /> | ||
<StructIdTemplates Include="$(MSBuildThisFileDirectory)..\StructId\Templates\*.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<!-- Templates should always be added by buildTransitive targets --> | ||
<StructId Include="@(StructIdTemplates)" Link="StructId\Templates\%(StructIdTemplates.Filename)%(StructIdTemplates.Extension)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(HasStructIdReference)' != 'false'"> | ||
<StructId Include="@(StructIdCompile)" Link="StructId\%(StructIdCompile.Filename)%(StructIdCompile.Extension)" /> | ||
</ItemGroup> | ||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters