add unit test mode to mod build config package
This commit is contained in:
parent
de5ee6f928
commit
e48f230142
|
@ -120,6 +120,19 @@ or you have multiple installs, you can specify the path yourself. There's two wa
|
||||||
The configuration will check your custom path first, then fall back to the default paths (so it'll
|
The configuration will check your custom path first, then fall back to the default paths (so it'll
|
||||||
still compile on a different computer).
|
still compile on a different computer).
|
||||||
|
|
||||||
|
### Unit test projects
|
||||||
|
**(upcoming in 2.0.3)**
|
||||||
|
|
||||||
|
You can use the package in unit test projects too. Its optional unit test mode...
|
||||||
|
|
||||||
|
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>
|
||||||
|
```
|
||||||
|
|
||||||
## Troubleshoot
|
## Troubleshoot
|
||||||
### "Failed to find the game install path"
|
### "Failed to find the game install path"
|
||||||
|
|
|
@ -19,9 +19,14 @@
|
||||||
|
|
||||||
<!-- set default settings -->
|
<!-- set default settings -->
|
||||||
<ModFolderName Condition="'$(ModFolderName)' == ''">$(MSBuildProjectName)</ModFolderName>
|
<ModFolderName Condition="'$(ModFolderName)' == ''">$(MSBuildProjectName)</ModFolderName>
|
||||||
|
<ModUnitTests Condition="'$(ModUnitTests)' == ''">True</ModUnitTests>
|
||||||
<ModZipPath Condition="'$(ModZipPath)' == ''">$(TargetDir)</ModZipPath>
|
<ModZipPath Condition="'$(ModZipPath)' == ''">$(TargetDir)</ModZipPath>
|
||||||
<EnableModDeploy Condition="'$(EnableModDeploy)' == ''">True</EnableModDeploy>
|
<EnableModDeploy Condition="'$(EnableModDeploy)' == ''">True</EnableModDeploy>
|
||||||
<EnableModZip Condition="'$(EnableModZip)' == ''">True</EnableModZip>
|
<EnableModZip Condition="'$(EnableModZip)' == ''">True</EnableModZip>
|
||||||
|
|
||||||
|
<!-- disable mod deploy in unit test project -->
|
||||||
|
<EnableModDeploy Condition="$(ModUnitTests)">False</EnableModDeploy>
|
||||||
|
<EnableModZip Condition="$(ModUnitTests)">False</EnableModZip>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- find platform + game path -->
|
<!-- find platform + game path -->
|
||||||
|
@ -57,32 +62,40 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Netcode" Condition="Exists('$(GamePath)\Netcode.dll')">
|
<Reference Include="Netcode" Condition="Exists('$(GamePath)\Netcode.dll')">
|
||||||
<HintPath>$(GamePath)\Netcode.dll</HintPath>
|
<HintPath>$(GamePath)\Netcode.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Stardew Valley">
|
<Reference Include="Stardew Valley">
|
||||||
<HintPath>$(GamePath)\Stardew Valley.exe</HintPath>
|
<HintPath>$(GamePath)\Stardew Valley.exe</HintPath>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="StardewModdingAPI">
|
<Reference Include="StardewModdingAPI">
|
||||||
<HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
|
<HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="xTile, Version=2.0.4.0, Culture=neutral, processorArchitecture=x86">
|
<Reference Include="xTile, Version=2.0.4.0, Culture=neutral, processorArchitecture=x86">
|
||||||
<HintPath>$(GamePath)\xTile.dll</HintPath>
|
<HintPath>$(GamePath)\xTile.dll</HintPath>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -100,18 +113,22 @@
|
||||||
<HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
|
<HintPath>$(GamePath)\MonoGame.Framework.dll</HintPath>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="StardewValley">
|
<Reference Include="StardewValley">
|
||||||
<HintPath>$(GamePath)\StardewValley.exe</HintPath>
|
<HintPath>$(GamePath)\StardewValley.exe</HintPath>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="StardewModdingAPI">
|
<Reference Include="StardewModdingAPI">
|
||||||
<HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
|
<HintPath>$(GamePath)\StardewModdingAPI.exe</HintPath>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="xTile">
|
<Reference Include="xTile">
|
||||||
<HintPath>$(GamePath)\xTile.dll</HintPath>
|
<HintPath>$(GamePath)\xTile.dll</HintPath>
|
||||||
<Private>false</Private>
|
<Private>false</Private>
|
||||||
|
<Private Condition="$(ModUnitTests)">true</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Otherwise>
|
</Otherwise>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>Pathoschild.Stardew.ModBuildConfig</id>
|
<id>Pathoschild.Stardew.ModBuildConfig</id>
|
||||||
<version>2.0.3-alpha20180307</version>
|
<version>2.0.3-alpha20180321</version>
|
||||||
<title>Build package for SMAPI mods</title>
|
<title>Build package for SMAPI mods</title>
|
||||||
<authors>Pathoschild</authors>
|
<authors>Pathoschild</authors>
|
||||||
<owners>Pathoschild</owners>
|
<owners>Pathoschild</owners>
|
||||||
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
2.0.3:
|
2.0.3:
|
||||||
- Added support for Stardew Valley 1.3.
|
- Added support for Stardew Valley 1.3.
|
||||||
|
- Added support for unit test projects.
|
||||||
</releaseNotes>
|
</releaseNotes>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
Loading…
Reference in New Issue