generalise NuGet package's non-mod project feature (#555)
This commit is contained in:
parent
79ad322a8e
commit
4b646e4f92
|
@ -131,18 +131,20 @@ If you don't want to include a file in the mod folder or release zip:
|
|||
This is a comma-delimited list of regular expression patterns. If any pattern matches a file's
|
||||
relative path in your mod folder, that file won't be included.
|
||||
|
||||
### Unit test projects
|
||||
### Non-mod projects
|
||||
**(upcoming in 2.1)**
|
||||
|
||||
You can use the package in unit test projects too. Its optional unit test mode...
|
||||
You can use the package in non-mod projects too (e.g. unit tests or framework DLLs). You'll need to
|
||||
disable deploying the mod and creating a release zip:
|
||||
|
||||
1. disables deploying the project as a mod;
|
||||
2. disables creating a release zip;
|
||||
2. and copies the referenced DLLs into the build output for unit test frameworks.
|
||||
|
||||
To enable it, add this above the first `</PropertyGroup>` in your `.csproj`:
|
||||
```xml
|
||||
<ModUnitTests>True</ModUnitTests>
|
||||
<EnableModDeploy>False</EnableModDeploy>
|
||||
<EnableModZip>False</EnableModZip>
|
||||
```
|
||||
|
||||
If this is for unit tests, you may need to copy the referenced DLLs into your build output too:
|
||||
```xml
|
||||
<CopyModReferencesToBuildOutput>True</CopyModReferencesToBuildOutput>
|
||||
```
|
||||
|
||||
## Code warnings
|
||||
|
|
|
@ -19,14 +19,10 @@
|
|||
|
||||
<!-- set default settings -->
|
||||
<ModFolderName Condition="'$(ModFolderName)' == ''">$(MSBuildProjectName)</ModFolderName>
|
||||
<ModUnitTests Condition="'$(ModUnitTests)' == ''">False</ModUnitTests>
|
||||
<ModZipPath Condition="'$(ModZipPath)' == ''">$(TargetDir)</ModZipPath>
|
||||
<EnableModDeploy Condition="'$(EnableModDeploy)' == ''">True</EnableModDeploy>
|
||||
<EnableModZip Condition="'$(EnableModZip)' == ''">True</EnableModZip>
|
||||
|
||||
<!-- disable mod deploy in unit test project -->
|
||||
<EnableModDeploy Condition="'$(ModUnitTests)' == true">False</EnableModDeploy>
|
||||
<EnableModZip Condition="'$(ModUnitTests)' == true">False</EnableModZip>
|
||||
<CopyModReferencesToBuildOutput Condition="'$(CopyModReferencesToBuildOutput)' == ''">False</CopyModReferencesToBuildOutput>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- find platform + game path -->
|
||||
|
@ -63,45 +59,45 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="Netcode">
|
||||
<HintPath>$(GamePath)\Netcode.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="Stardew Valley">
|
||||
<HintPath>$(GamePath)\Stardew Valley.exe</HintPath>
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="StardewModdingAPI">
|
||||
<HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="StardewModdingAPI.Toolkit.CoreInterfaces">
|
||||
<HintPath>$(GamePath)\StardewModdingAPI.Toolkit.CoreInterfaces.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="xTile, Version=2.0.4.0, Culture=neutral, processorArchitecture=x86">
|
||||
<HintPath>$(GamePath)\xTile.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -119,27 +115,27 @@
|
|||
<HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="StardewValley">
|
||||
<HintPath>$(GamePath)\StardewValley.exe</HintPath>
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="StardewModdingAPI">
|
||||
<HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="StardewModdingAPI.Toolkit.CoreInterfaces">
|
||||
<HintPath>$(GamePath)\StardewModdingAPI.Toolkit.CoreInterfaces.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
<Reference Include="xTile">
|
||||
<HintPath>$(GamePath)\xTile.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
<Private Condition="$(ModUnitTests)">true</Private>
|
||||
<Private Condition="$(CopyModReferencesToBuildOutput)">true</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</Otherwise>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<releaseNotes>
|
||||
2.1:
|
||||
- Added support for Stardew Valley 1.3.
|
||||
- Added support for unit test projects.
|
||||
- Added support for non-mod projects.
|
||||
- Added C# analyzers to warn about implicit conversions of Netcode fields in Stardew Valley 1.3.
|
||||
- Added option to ignore files by regex pattern.
|
||||
- Added reference to new SMAPI DLL.
|
||||
|
|
Loading…
Reference in New Issue