Skip to content

Commit

Permalink
Save our own source generator output in git
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Nov 18, 2024
1 parent 747c248 commit 25cb751
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,7 @@ tmp/

# Verify exclusions
**/Snapshots/*.g.received.cs

# Configuration binder source generator output
**/Generated/*
!**/Generated/Lynx.Generator/
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Lynx;

static partial class EvaluationParams
{
public const int IsolatedPawnPenalty = -917521;
public const int OpenFileRookBonus = 131112;
public const int SemiOpenFileRookBonus = 524303;
public const int SemiOpenFileKingPenalty = 327656;
public const int OpenFileKingPenalty = 131007;
public const int KingShieldBonus = -196585;
public const int BishopPairBonus = 4718622;
public const int PieceProtectedByPawnBonus = 983052;
public const int PieceAttackedByPawnPenalty = -2162735;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;

namespace Lynx.Generator
{
[AttributeUsage(AttributeTargets.Field, Inherited = false, AllowMultiple = false)]
internal sealed class GeneratedPackAttribute : Attribute
{
public short MG { get; }
public short EG { get; }

public GeneratedPackAttribute(short mg, short eg)
{
MG = mg;
EG = eg;
}
}
}
11 changes: 10 additions & 1 deletion src/Lynx/Lynx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

Expand Down Expand Up @@ -48,6 +47,16 @@
<Using Include="Lynx.Model.TranspositionTableElement[]" Alias="TranspositionTable" />
</ItemGroup>

<PropertyGroup>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>

<ItemGroup>
<!-- Exclude the output of source generators from the compilation -->
<Compile Remove="$(CompilerGeneratedFilesOutputPath)/**/*.cs" />
</ItemGroup>

<PropertyGroup>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
Expand Down

0 comments on commit 25cb751

Please sign in to comment.