Skip to content

Commit

Permalink
Version in arguments (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredpar authored Jan 15, 2025
1 parent b6e3ddd commit b9d06ce
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
21 changes: 20 additions & 1 deletion src/Basic.CompilerLog/Basic.CompilerLog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<NoWarn>$(NoWarn);CS8002</NoWarn>

<!-- NuPkg information -->
<Version>0.1.2</Version>
<Version>42.42.42.42</Version>
<PackageProjectUrl>https://github.com/jaredpar/basic-compiler-logger</PackageProjectUrl>
<RepositoryUrl>https://github.com/jaredpar/basic-compiler-logger</RepositoryUrl>
<PackageReadmeFile>README.md</PackageReadmeFile>
Expand All @@ -35,4 +35,23 @@
<ProjectReference Include="..\Basic.CompilerLog.Util\Basic.CompilerLog.Util.csproj" />
</ItemGroup>

<Target Name="GenerateConstants" BeforeTargets="BeforeBuild">
<PropertyGroup>
<_BasicToolVersion>$(PackageVersion)</_BasicToolVersion>
<_BasicToolVersion Condition="'$(_BasicToolVersion)' == ''">42.42.42.42</_BasicToolVersion>
<_BasicGeneratedConstantsFile>$(IntermediateOutputPath)GeneratedConstants.cs</_BasicGeneratedConstantsFile>
<_BasicCode>internal static partial class Constants
{
public const string ToolVersion = &quot;$(_BasicToolVersion)&quot;%3B
}
</_BasicCode>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(_BasicGeneratedConstantsFile)" />
</ItemGroup>
<WriteLinesToFile
File="$(_BasicGeneratedConstantsFile)"
Lines="$(_BasicCode)"
Overwrite="true" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion src/Basic.CompilerLog/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading.Tasks;
using Basic.CompilerLog.Util;

internal static class Constants
internal static partial class Constants
{
internal const int ExitFailure = 1;
internal const int ExitSuccess = 0;
Expand Down
4 changes: 3 additions & 1 deletion src/Basic.CompilerLog/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,10 @@ int RunHelp(IEnumerable<string>? args)
options.Parse(args);
}

WriteLine("""
WriteLine($"""
complog [command] [args]
version: {ToolVersion}
Commands
create Create a compiler log file
replay Replay compilations from the log
Expand Down

0 comments on commit b9d06ce

Please sign in to comment.