Skip to content

Commit f9b14a6

Browse files
committed
Switched from msbuild to dotnet build.
1 parent b053db3 commit f9b14a6

File tree

3 files changed

+30
-25
lines changed

3 files changed

+30
-25
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ on:
88

99
jobs:
1010
build:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-20.04
1212
steps:
1313
- name: Checkout Repository
1414
uses: actions/checkout@v2
1515
- name: Build
16-
run: msbuild -property:Configuration=Release
16+
run: dotnet build --configuration Release
1717
- name: Upload Artifact
18-
uses: actions/upload-artifact@v3
18+
uses: actions/upload-artifact@v4
1919
with:
2020
name: target
2121
path: target/dist

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ contributions [as a pull request](https://github.com/Esper89/Subnautica-TerrainP
161161

162162
### Building
163163

164-
To build Terrain Patcher, run `msbuild` in the project's root directory. This will build in debug
165-
mode, and the output will be placed in `target/Debug`. If you create a file in the project root
166-
called `game-dirs.txt` and input the paths to your Subnautica and/or Below Zero installations (one
167-
per line), the output of debug builds will be automatically installed into those game directories
168-
for easier testing.
164+
To build Terrain Patcher, run `dotnet build` in the project's root directory. This will build in
165+
debug mode, and the output will be placed in `target/Debug`. If you create a file in the project
166+
root called `game-dirs.txt` and input the paths to your Subnautica and/or Below Zero installations
167+
(one per line), the output of debug builds will be automatically installed into those game
168+
directories for easier testing.
169169

170-
To build Terrain Patcher in release mode, run `msbuild -property:Configuration=Release`. This will
170+
To build Terrain Patcher in release mode, run `dotnet build --configuration Release`. This will
171171
also create a `dist.zip` file in `target` for easy distribution.
172172

173173
## License

TerrainPatcher.csproj

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<OutputType>Library</OutputType>
5-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
4+
<TargetFramework>net472</TargetFramework>
65
<LangVersion>8.0</LangVersion>
76
<Nullable>enable</Nullable>
87
<WarningLevel>4</WarningLevel>
98
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
10-
<OutputPath>bin/$(Configuration)</OutputPath>
119
</PropertyGroup>
1210
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
1311
<Optimize>false</Optimize>
@@ -43,21 +41,20 @@
4341
<HintPath>references/Nautilus.refasm.dll</HintPath>
4442
</Reference>
4543
</ItemGroup>
46-
<ItemGroup>
47-
<Compile Include="src/Mod.cs"/>
48-
<Compile Include="src/Terrain.cs"/>
49-
<Compile Include="src/FileLoading.cs"/>
50-
<Compile Include="src/Patches.cs"/>
51-
<Compile Include="src/Options.cs"/>
52-
</ItemGroup>
53-
<Import Project="$(MSBuildBinPath)/Microsoft.CSharp.targets"/>
5444
<Target Name="CopyToTargetDir" AfterTargets="Build">
55-
<Copy SourceFiles="$(TargetPath);LICENSE;$(DocumentationFile)" DestinationFolder="target/$(Configuration)"/>
45+
<Copy
46+
SourceFiles="$(TargetPath);LICENSE;$(DocumentationFile)"
47+
DestinationFolder="target/$(Configuration)"
48+
/>
5649
<Copy SourceFiles="dist-readme.md" DestinationFiles="target/$(Configuration)/README.md"/>
5750
<WriteLinesToFile File="target/$(Configuration)/load-order.txt" Overwrite="True"/>
5851
<MakeDir Directories="target/$(Configuration)/patches"/>
5952
</Target>
60-
<Target Name="CopyToModsDir" AfterTargets="CopyToTargetDir" Condition="'$(Configuration)' == 'Debug' And Exists('game-dirs.txt')">
53+
<Target
54+
Name="CopyToModsDir"
55+
AfterTargets="CopyToTargetDir"
56+
Condition="'$(Configuration)' == 'Debug' And Exists('game-dirs.txt')"
57+
>
6158
<ReadLinesFromFile File="game-dirs.txt">
6259
<Output TaskParameter="Lines" ItemName="GameDirs"/>
6360
</ReadLinesFromFile>
@@ -70,12 +67,20 @@
7067
<Copy SourceFiles="@(TargetFiles)" DestinationFolder="%(GameDirs.Identity)/$(PluginDir)"/>
7168
<MakeDir Directories="%(GameDirs.Identity)/$(PluginDir)/patches"/>
7269
</Target>
73-
<Target Name="ZipDist" AfterTargets="CopyToTargetDir" Condition="'$(Configuration)' == 'Release'">
70+
<Target
71+
Name="ZipDist"
72+
AfterTargets="CopyToTargetDir"
73+
Condition="'$(Configuration)' == 'Release'"
74+
>
7475
<CreateItem Include="target/$(Configuration)/**/*">
7576
<Output TaskParameter="Include" ItemName="TargetFiles"/>
7677
</CreateItem>
7778
<Copy SourceFiles="@(TargetFiles)" DestinationFolder="target/dist/$(ProjectName)"/>
7879
<MakeDir Directories="target/dist/$(ProjectName)/patches"/>
79-
<ZipDirectory SourceDirectory="target/dist" DestinationFile="target/dist.zip" Overwrite="True"/>
80+
<ZipDirectory
81+
SourceDirectory="target/dist"
82+
DestinationFile="target/dist.zip"
83+
Overwrite="True"
84+
/>
8085
</Target>
8186
</Project>

0 commit comments

Comments
 (0)