Skip to content

Commit

Permalink
Fix NuGet packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveDesmond-ca committed Nov 10, 2019
1 parent 147b673 commit 19556d7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
9 changes: 9 additions & 0 deletions src/LibYear.Lib/LibYear.Lib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>libyear-lib</PackageId>
<Description>Library portion of libyear, for consumption by other applications</Description>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NuGet.Protocol.Core.v3" Version="4.2.0" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

</Project>
13 changes: 12 additions & 1 deletion src/LibYear/LibYear.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
<Company>Steve Desmond Software Development</Company>
<Description>Display projects' dependencies and their outdatedness</Description>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>3.0.0-rc1</Version>
<PackAsTool>true</PackAsTool>
<ToolCommandName>dotnet-libyear</ToolCommandName>
<Version>3.0.0-rc2</Version>
<PackageId>libyear</PackageId>
<Product>libyear</Product>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
<PackageLicenseExpression></PackageLicenseExpression>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>

<ItemGroup>
Expand All @@ -28,4 +32,11 @@
<ProjectReference Include="..\LibYear.Lib\LibYear.Lib.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

</Project>
7 changes: 4 additions & 3 deletions src/LibYear/Runner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ private string GetAllResultsTables(IDictionary<IProjectFile, IEnumerable<Result>
if (!allResults.Any())
return string.Empty;

var namePad = Math.Max("Package".Length, allResults.Max(results => results.Value.Any() ? results.Value.Max(r => r.Name.Length) : 0));
var installedPad = Math.Max("Installed".Length, allResults.Max(results => results.Value.Any() ? results.Value.Max(r => r.Installed?.Version.ToString().Length ?? 0) : 0));
var latestPad = Math.Max("Latest".Length, allResults.Max(results => results.Value.Any() ? results.Value.Max(r => r.Latest?.Version.ToString().Length ?? 0) : 0));
int MaxLength(Func<Result, int> field) => allResults.Max(results => results.Value.Any() ? results.Value.Max(field) : 0);
var namePad = Math.Max("Package".Length, MaxLength(r => r.Name.Length));
var installedPad = Math.Max("Installed".Length, MaxLength(r => r.Installed?.Version.ToString().Length ?? 0));
var latestPad = Math.Max("Latest".Length, MaxLength(r => r.Latest?.Version.ToString().Length ?? 0));

var msg = new StringBuilder();
foreach (var results in allResults)
Expand Down

0 comments on commit 19556d7

Please sign in to comment.