Skip to content

Commit

Permalink
Enable sourcelink (#925)
Browse files Browse the repository at this point in the history
* enable sourcelink

* make sure git metadata is published in the nuget package

* Add sourcelink support through a shared target file

* cleanup package references
  • Loading branch information
Barsonax authored Aug 24, 2023
1 parent 295b411 commit ecf8c2e
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/AppModel/NetDaemon.AppModel/NetDaemon.AppModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<Import Project="$(ProjectDir)../../Targets/Sourcelink.targets" />

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
Expand All @@ -28,6 +30,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="System.IO.Pipelines" Version="7.0.0" />
<PackageReference Include="Roslynator.Analyzers" Version="4.4.0">
Expand Down
3 changes: 3 additions & 0 deletions src/Client/NetDaemon.HassClient/NetDaemon.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<Import Project="$(ProjectDir)../../Targets/Sourcelink.targets" />

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;IL2121;CS1591</NoWarn>
</PropertyGroup>
Expand All @@ -33,6 +35,7 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="System.IO.Pipelines" Version="7.0.0" />
<PackageReference Include="Roslynator.Analyzers" Version="4.4.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<Import Project="$(ProjectDir)../../Targets/Sourcelink.targets" />

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Roslynator.Analyzers" Version="4.4.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<Import Project="$(ProjectDir)../../Targets/Sourcelink.targets" />

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="MQTTnet" Version="4.2.1.781" />
<PackageReference Include="MQTTnet.Extensions.ManagedClient" Version="4.2.1.781" />
<PackageReference Include="System.Reactive" Version="6.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<Import Project="$(ProjectDir)../../Targets/Sourcelink.targets" />

<ItemGroup>
<PackageReference Include="Cronos" Version="0.7.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Analyzers" Version="4.4.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<Import Project="$(ProjectDir)../../Targets/Sourcelink.targets" />

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="Roslynator.Analyzers" Version="4.4.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<Import Project="$(ProjectDir)../../Targets/Sourcelink.targets" />

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="System.Reactive" Version="6.0.0" />
</ItemGroup>

Expand Down
3 changes: 3 additions & 0 deletions src/HassModel/NetDeamon.HassModel/NetDaemon.HassModel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<Import Project="$(ProjectDir)../../Targets/Sourcelink.targets" />

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="System.Reactive" Version="6.0.0" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/Runtime/NetDaemon.Runtime/NetDaemon.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<Import Project="$(ProjectDir)../../Targets/Sourcelink.targets" />

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
Expand All @@ -27,6 +29,7 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="System.Reactive" Version="6.0.0" />
<PackageReference Include="Roslynator.Analyzers" Version="4.4.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
12 changes: 12 additions & 0 deletions src/Targets/Sourcelink.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>
<PropertyGroup>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<RepositoryUrl>https://github.com/net-daemon/netdaemon</RepositoryUrl>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
</Project>

0 comments on commit ecf8c2e

Please sign in to comment.