Skip to content

Commit

Permalink
Fixed bug where the git information is not properly obtained and the …
Browse files Browse the repository at this point in the history
…head information was not properly dumped to the right file name.

This also sadly requires fixing the roslyn version to 4.0.1 for now to avoid loading errors when using the generator when building projects.

Signed-off-by: AraHaan <[email protected]>
  • Loading branch information
AraHaan committed Jan 13, 2022
1 parent d5beac0 commit 23ba564
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
3 changes: 3 additions & 0 deletions build/GitBuildInfo.SourceGenerator.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
WorkingDirectory="$(MSBuildProjectDirectory)"
ConsoleToMSBuild="true"
IgnoreExitCode="true"
StandardOutputImportance="low"
Condition="'$(GitHead)' == ''">
<Output TaskParameter="ConsoleOutput" PropertyName="GitHead" />
</Exec>
Expand All @@ -18,6 +19,7 @@
WorkingDirectory="$(MSBuildProjectDirectory)"
ConsoleToMSBuild="true"
IgnoreExitCode="true"
StandardOutputImportance="low"
Condition="'$(CommitHash)' == ''">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitHash" />
</Exec>
Expand All @@ -26,6 +28,7 @@
WorkingDirectory="$(MSBuildProjectDirectory)"
ConsoleToMSBuild="true"
IgnoreExitCode="true"
StandardOutputImportance="low"
Condition="'$(GitBranch)' == ''">
<Output TaskParameter="ConsoleOutput" PropertyName="GitBranch" />
</Exec>
Expand Down
6 changes: 3 additions & 3 deletions src/GitBuildInfo.SourceGenerator/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>true</IsPackable>
<Version>1.0.15</Version>
<PackageReleaseNotes>Fixed bug where the git information is not properly obtained and the head information was not properly dumped to the right file name.</PackageReleaseNotes>
<Version>1.0.16</Version>
<PackageReleaseNotes>Fixed issue where the roslyn dependencies gets placed in the nuget package.</PackageReleaseNotes>
<Copyright>Copyright (c) 2021-2022</Copyright>
<!-- Suppresses the warnings about the package not having assemblies in lib/*/.dll.-->
<NoPackageAnalysis>true</NoPackageAnalysis>
<!-- Special properties for analyzer packages. -->
<IncludeBuildOutput>false</IncludeBuildOutput>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
<NoWarn>$(NoWarn);NU5128;NU5127</NoWarn>
<NuSpecFile>GitBuildInfo.SourceGenerator.nuspec</NuSpecFile>
<IsRoslynComponent>true</IsRoslynComponent>
Expand Down
2 changes: 1 addition & 1 deletion src/GitBuildInfo.SourceGenerator/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</ItemDefinitionGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="*-*" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<ItemGroup>
<!-- Analysis of C# projects -->
<TfmSpecificPackageFile Include="$(TargetPath)" PackagePath="analyzers\cs\" />
<TfmSpecificPackageFile Include="@(ReferencePath)" PackagePath="analyzers\cs\" Condition=" '%(FileName)%(Extension)' == 'Microsoft.CodeAnalysis.dll' " />
<TfmSpecificPackageFile Include="@(SatelliteDllsProjectOutputGroupDependency)" PackagePath="analyzers\cs\%(SatelliteDllsProjectOutputGroupDependency.DestinationSubDirectory)" Condition=" '%(SatelliteDllsProjectOutputGroupDependency.DestinationSubDirectory)' != '' " />
<TfmSpecificPackageFile Include="@(SatelliteDllsProjectOutputGroupOutput->'%(FinalOutputPath)')" PackagePath="analyzers\cs\%(SatelliteDllsProjectOutputGroupOutput.Culture)\" />
<TfmSpecificPackageFile Include="%(_ResolvedProjectReferencePaths.Identity)" PackagePath="analyzers\cs\" />
</ItemGroup>
</Target>

Expand Down
2 changes: 1 addition & 1 deletion tests/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" Version="*-*" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="*-*" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="*-*" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.SourceGenerators.Testing" Version="*-*" />
Expand Down

0 comments on commit 23ba564

Please sign in to comment.