Skip to content

Commit

Permalink
Clean up build
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed Jan 20, 2024
1 parent 59c4f21 commit a830430
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 22 deletions.
30 changes: 18 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,40 +68,46 @@ jobs:
- name: Restore dependencies
run: dotnet restore

- name: Build debug, no shared instances
run: dotnet build --configuration Debug /p:UseSharedInstances=false

- name: Build debug, no hash sets
run: dotnet build --configuration Debug /p:UseHashSets=false

- name: Build debug, no bit array
run: dotnet build --configuration Debug /p:UseBitArray=false

- name: Build debug, location as class
run: dotnet build --configuration Debug /p:LocationAsStruct=false

- name: Build debug, no shared instances
run: dotnet build --configuration Debug /p:UseSharedInstances=false

- name: Build debug, no vectors
run: dotnet build --configuration Debug /p:UseVectors=false

- name: Build debug, no stackalloc
run: dotnet build --configuration Debug /p:UseStackalloc=false

- name: Build debug, no bit array
run: dotnet build --configuration Debug /p:UseBitArray=false
- name: Build debug, rent neighbors
run: dotnet build --configuration Debug /p:RentNeighbors=true

- name: Build debug, allow dynamic FLUTE degree
run: dotnet build --configuration Debug /p:AllowDynamicFluteDegree=true

- name: Build debug, no grid ToString
run: dotnet build --configuration Debug /p:EnableGridToString=false

- name: Build debug, no defines at all
run: dotnet build --configuration Debug /p:UseDefines=false
- name: Build debug, with Lua settings
run: dotnet build --configuration Debug /p:UseLuaSettings=true

- name: Build release without defines
run: dotnet build --configuration Release /p:UseDefines=false
- name: Build debug, with Lua settings
run: dotnet build --configuration Release /p:UseLuaSettings=true

- name: Test without defines
- name: Test with Lua settings
run: dotnet test --no-build --configuration Release --logger "console;verbosity=normal"

- name: Build release with defines
- name: Build release with default settings
run: dotnet build --configuration Release

- name: Test with defines
- name: Test with default settings
run: dotnet test --no-build --configuration Release --logger "console;verbosity=normal"

- name: Publish
Expand Down
21 changes: 17 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,21 +1,34 @@
<Project>

<PropertyGroup>
<UseDefines Condition="'$(UseDefines)' == ''">true</UseDefines>
<UseLuaSettings Condition="'$(UseLuaSettings)' == ''">false</UseLuaSettings>
</PropertyGroup>

<PropertyGroup Condition="'$(UseLuaSettings)' == 'true'">
<UseHashSets>false</UseHashSets>
<UseBitArray>false</UseBitArray>
<LocationAsStruct>false</LocationAsStruct>
<UseSharedInstances>false</UseSharedInstances>
<UseVectors>false</UseVectors>
<UseStackalloc>false</UseStackalloc>
<RentNeighbors>true</RentNeighbors>
<EnableVisualizer>false</EnableVisualizer>
<EnableGridToString>true</EnableGridToString>
<AllowDynamicFluteDegree>false</AllowDynamicFluteDegree>
</PropertyGroup>

<PropertyGroup>
<UseHashSets Condition="'$(UseHashSets)' == ''">$(UseDefines)</UseHashSets>
<UseHashSets Condition="'$(UseHashSets)' == ''">true</UseHashSets>
<DefineConstants Condition="$(UseHashSets) == 'true'">$(DefineConstants);USE_HASHSETS</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<UseBitArray Condition="'$(UseBitArray)' == ''">$(UseDefines)</UseBitArray>
<UseBitArray Condition="'$(UseBitArray)' == ''">true</UseBitArray>
<DefineConstants Condition="$(UseBitArray) == 'true'">$(DefineConstants);USE_BITARRAY</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<LocationAsStruct Condition="'$(LocationAsStruct)' == ''">$(UseDefines)</LocationAsStruct>
<LocationAsStruct Condition="'$(LocationAsStruct)' == ''">true</LocationAsStruct>
<DefineConstants Condition="$(LocationAsStruct) == 'true'">$(DefineConstants);LOCATION_AS_STRUCT</DefineConstants>
</PropertyGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/FactorioTools/FactorioTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
</PropertyGroup>

<PropertyGroup>
<UseSharedInstances Condition="'$(UseSharedInstances)' == ''">$(UseDefines)</UseSharedInstances>
<UseSharedInstances Condition="'$(UseSharedInstances)' == ''">true</UseSharedInstances>
<DefineConstants Condition="$(UseSharedInstances) == 'true'">$(DefineConstants);USE_SHARED_INSTANCES</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<UseVectors Condition="'$(UseVectors)' == ''">$(UseDefines)</UseVectors>
<UseVectors Condition="'$(UseVectors)' == ''">true</UseVectors>
<DefineConstants Condition="$(UseVectors) == 'true'">$(DefineConstants);USE_VECTORS</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<UseStackalloc Condition="'$(UseStackalloc)' == ''">$(UseDefines)</UseStackalloc>
<UseStackalloc Condition="'$(UseStackalloc)' == ''">true</UseStackalloc>
<DefineConstants Condition="$(UseStackalloc) == 'true'">$(DefineConstants);USE_STACKALLOC</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<RentNeighbors Condition="'$(RentNeighbors)' == ''">true</RentNeighbors>
<RentNeighbors Condition="'$(RentNeighbors)' == ''">false</RentNeighbors>
<DefineConstants Condition="$(RentNeighbors) == 'true'">$(DefineConstants);RENT_NEIGHBORS</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<EnableVisualizer Condition="'$(EnableVisualizer)' == '' and '$(Configuration)' == 'Debug'">$(UseDefines)</EnableVisualizer>
<EnableVisualizer Condition="'$(EnableVisualizer)' == '' and '$(Configuration)' == 'Debug'">true</EnableVisualizer>
<EnableVisualizer Condition="'$(EnableVisualizer)' == '' and '$(Configuration)' != 'Debug'">false</EnableVisualizer>
<DefineConstants Condition="$(EnableVisualizer) == 'true'">$(DefineConstants);ENABLE_VISUALIZER</DefineConstants>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/lua/Invoke-LuaBuild.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function Publish-CompiledLua($projectDir, $referenceNames, $filesFirst) {
$libArg = if ($references) { @("-l"; $references -join ";") } else { @() }
$sourceList = ($files | ForEach-Object { $_.FullName } | Sort-Object) -join ";"

dotnet run --no-build --configuration Release --project $compilerDir -- -c -p -csc "-define:ENABLE_GRID_TOSTRING -define:RENT_NEIGHBORS" @libArg -s $sourceList -d $outputDir
dotnet run --no-build --configuration Release --project $compilerDir -- -c -p -csc "-define:RENT_NEIGHBORS -define:ENABLE_GRID_TOSTRING" @libArg -s $sourceList -d $outputDir
if ($LASTEXITCODE -ne 0) {
throw "The CSharp.lua compiler failed with exit code $LASTEXITCODE."
}
Expand Down

0 comments on commit a830430

Please sign in to comment.