Skip to content

Commit

Permalink
Merge pull request #18 from ByronMayne/16-can-i-specify-the-microsoft…
Browse files Browse the repository at this point in the history
…codeanalysiscsharp-package-version-myself

Removed the forcefully added Microsoft.CodeAnalysis.CSharp reference
  • Loading branch information
ByronMayne authored May 13, 2024
2 parents 1f1fbf0 + bfd8424 commit ec7283d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Publish
on:
release:
types: [published]
push: {}
pull_request: {}

env:
Expand Down Expand Up @@ -40,4 +39,5 @@ jobs:
run: dotnet pack src\SourceGenerator.Foundations\SourceGenerator.Foundations.csproj -p:Version=${{env.GitVersion_AssemblySemVer}} -p:PackageVersion=${{env.GitVersion_FullSemVer}}
# -- Release Only --
- name: Push NuGet
if: github.event_name == 'release'
run: dotnet nuget push ${{env.ProjectDir}}bin\${{env.Configuration}}\*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
6 changes: 6 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
<RootNamespace>SGF</RootNamespace>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<SGFSourceDir>$(MSBuildThisFileDirectory)</SGFSourceDir>
<ImgDir>$(MSBuildThisFileDirectory)..\img\</ImgDir>
<SGfIco>$(MSBuildThisFileDirectory)..\img\icon.png</SGfIco>
<!-- Icons -->
<ApplicationIcon>$(MSBuildThisFileDirectory)..\img\icon.ico</ApplicationIcon>


<!-- Paths | SGF Core -->
<SGFProjectDir>$(SGFSourceDir)SourceGenerator.Foundations\</SGFProjectDir>
<SGFProjectPath>$(SGFProjectDir)SourceGenerator.Foundations.csproj</SGFProjectPath>
Expand Down
6 changes: 5 additions & 1 deletion src/Nuget.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
===============================-->
<PropertyGroup>
<TItle>Source Generator Foundations</TItle>
<AUthors>Byron Mayne</AUthors>
<Authors>Byron Mayne</Authors>
<PackageIcon>SgfIcon.png</PackageIcon>
<Description>Provides boilerplate code to be used by source generators. Provides the ability to have nuget packages that are resolvable at runtime as well as much better exception handling.</Description>
<PackageProjectUrl>https://github.dev/ByronMayne/SourceGenerator.Foundations</PackageProjectUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand All @@ -21,6 +22,9 @@
<!-- Changes the content of the nuget package by manually adding files-->
<Target Name="AppendNugetContent">
<ItemGroup>
<TfmSpecificPackageFile Include="$(ImgDir)icon.png">
<PackagePath>/$(PackageIcon)</PackagePath>
</TfmSpecificPackageFile>
<TfmSpecificPackageFile Include="$(SGFContractsProjectDir)bin\$(Configuration)\netstandard2.0\SourceGenerator.Foundations.Contracts.dll">
<PackagePath>lib/netstandard2.0/SourceGenerator.Foundations.Contracts.dll</PackagePath>
</TfmSpecificPackageFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,13 @@
<LangVersion>11</LangVersion>
<IsRoslynComponent>true</IsRoslynComponent>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);CustomNugetPack</TargetsForTfmSpecificContentInPackage>
<ApplicationIcon>icon.ico</ApplicationIcon>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>
<ItemGroup>
<Content Include="icon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<None Include="..\..\img\icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
<None Include="..\..\README.md" Pack="True" PackagePath="/" />
<None Update="SourceGenerator.Foundations.props" Pack="True" PackagePath="build/$(AssemblyName).props" />
<None Update="SourceGenerator.Foundations.targets" Pack="True" PackagePath="build/$(AssemblyName).targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
<CompilerVisibleProperty Include="RootNamespace" />
<CompilerVisibleProperty Include="AssemblyName" />
<CompilerVisibleProperty Include="BaseOutputPath "/>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition="'$(IsNuGetPackage.ToLower())' == 'true'">
<SGF_EmbeddedAssembly Include="$(MSBuildThisFileDirectory)..\sgf\embedded\assemblies\*.*"/>

<!-- Core -->
<Compile Include="$(MSBuildThisFileDirectory)..\sgf\src\Core\**\*.cs" Visible="$(SgfShowImports)">
<Link>SGF/%(RecursiveDir)%(Filename)%(Extension)</Link>
Expand Down

0 comments on commit ec7283d

Please sign in to comment.