Skip to content

Commit

Permalink
Merge pull request #18 from dawedawe/projreflocalsdk
Browse files Browse the repository at this point in the history
Support referencing local sdk repo
  • Loading branch information
dawedawe authored Nov 8, 2023
2 parents 49a4c3c + 5325858 commit 934c65c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<ServerGarbageCollection>true</ServerGarbageCollection>
<LangVersion>preview</LangVersion>
<OtherFlags>$(OtherFlags) --test:GraphBasedChecking --test:ParallelOptimization --test:ParallelIlxGen</OtherFlags>
<!-- Set to true and adjust the path to your local repo if you want to use that instead of the nuget packages -->
<UseLocalAnalyzersSDK>false</UseLocalAnalyzersSDK>
<LocalAnalyzersSDKRepo>../../../FSharp.Analyzers.SDK</LocalAnalyzersSDKRepo>
</PropertyGroup>

<ItemGroup Condition="'$(IsPackable)' == 'true'">
Expand Down
6 changes: 4 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
<ItemGroup>
<PackageVersion Include="FSharp.Core" Version="[7.0.400]" />
<PackageVersion Include="FSharp.Compiler.Service" Version="[43.7.400]" />
<PackageVersion Include="FSharp.Analyzers.SDK" Version="[0.19.0]" />
<PackageVersion Include="FSharp.Analyzers.SDK.Testing" Version="[0.19.0]" />
<PackageVersion Include="Ionide.KeepAChangelog.Tasks" Version="0.1.8" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.1.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageVersion Include="NUnit" Version="3.14.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(UseLocalAnalyzersSDK)' == 'false'">
<PackageVersion Include="FSharp.Analyzers.SDK" Version="[0.19.0]" />
<PackageVersion Include="FSharp.Analyzers.SDK.Testing" Version="[0.19.0]" />
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions docs/content/contributions.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ Please add [a new entry](https://keepachangelog.com/en/1.1.0/) for your changes.

Unless, there are technical reason blocking us, we will try and ship your contribution as soon as possible.
Our CI process should pick up new version from the changelog and push new packages to NuGet.org once the code is on the `main` branch.

## Using a local analyzers SDK

You might run into a situation when the SDK packages don't provide the features you need for your analyzers development.
In such a case, you can edit the `Directory.Build.props` file and set `UseLocalAnalyzersSDK` to `true` and let `LocalAnalyzersSDKRepo` point to your local SDK repository.
7 changes: 7 additions & 0 deletions src/Ionide.Analyzers/Ionide.Analyzers.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@
<Compile Include="Style\SquareBracketArrayAnalyzer.fs"/>
</ItemGroup>

<ItemGroup Condition="'$(UseLocalAnalyzersSDK)' == 'true'">
<ProjectReference Include="$(LocalAnalyzersSDKRepo)/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.fsproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="FSharp.Core"/>
</ItemGroup>

<ItemGroup Condition="'$(UseLocalAnalyzersSDK)' == 'false'">
<PackageReference Include="FSharp.Analyzers.SDK"/>
</ItemGroup>

Expand Down
7 changes: 7 additions & 0 deletions tests/Ionide.Analyzers.Tests/Ionide.Analyzers.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
</ItemGroup>

<ItemGroup Condition="'$(UseLocalAnalyzersSDK)' == 'false'">
<PackageReference Include="FSharp.Analyzers.SDK.Testing" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Ionide.Analyzers\Ionide.Analyzers.fsproj" />
</ItemGroup>

<ItemGroup Condition="'$(UseLocalAnalyzersSDK)' == 'true'">
<ProjectReference Include="$(LocalAnalyzersSDKRepo)/src/FSharp.Analyzers.SDK.Testing/FSharp.Analyzers.SDK.Testing.fsproj" />
</ItemGroup>

</Project>

0 comments on commit 934c65c

Please sign in to comment.