summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/common.targets9
-rw-r--r--build/prepare-install-package.targets15
-rw-r--r--build/prepare-nuget-package.targets2
3 files changed, 18 insertions, 8 deletions
diff --git a/build/common.targets b/build/common.targets
index e08e7066..0781d568 100644
--- a/build/common.targets
+++ b/build/common.targets
@@ -39,6 +39,11 @@
<Choose>
<When Condition="'$(MSBuildProjectName)' == 'StardewModdingAPI' OR '$(MSBuildProjectName)' == 'StardewModdingAPI.Mods.ConsoleCommands' OR '$(MSBuildProjectName)' == 'StardewModdingAPI.Mods.SaveBackup' OR '$(MSBuildProjectName)' == 'StardewModdingAPI.Tests'">
<!-- Windows -->
+ <PropertyGroup>
+ <!--recognise XNA Framework DLLs in the GAC-->
+ <AssemblySearchPaths>$(AssemblySearchPaths);{GAC}</AssemblySearchPaths>
+ </PropertyGroup>
+
<ItemGroup Condition="$(OS) == 'Windows_NT'">
<Reference Include="Stardew Valley">
<HintPath>$(GamePath)\Stardew Valley.exe</HintPath>
@@ -93,12 +98,12 @@
</Choose>
<!-- if game path is invalid, show one user-friendly error instead of a slew of reference errors -->
- <Target Name="BeforeBuild">
+ <Target Name="ValidateInstallPath" AfterTargets="BeforeBuild">
<Error Condition="!Exists('$(GamePath)')" Text="Failed to find the game install path automatically; edit the *.csproj file and manually add a &lt;GamePath&gt; setting with the full directory path containing the Stardew Valley executable." />
</Target>
<!-- copy files into game directory and enable debugging -->
- <Target Name="AfterBuild">
+ <Target Name="CopySmapiFiles" AfterTargets="AfterBuild">
<CallTarget Targets="CopySMAPI;CopyDefaultMods" />
</Target>
<Target Name="CopySMAPI" Condition="'$(MSBuildProjectName)' == 'StardewModdingAPI'">
diff --git a/build/prepare-install-package.targets b/build/prepare-install-package.targets
index cd758e96..b7b70ed0 100644
--- a/build/prepare-install-package.targets
+++ b/build/prepare-install-package.targets
@@ -5,20 +5,18 @@
creates the build package in the bin\Packages folder.
-->
- <Target Name="AfterBuild">
+ <Target Name="PrepareInstaller" AfterTargets="AfterBuild">
<PropertyGroup>
<RootPath>$(SolutionDir)\..</RootPath>
<CompiledRootPath>$(RootPath)\bin\$(Configuration)</CompiledRootPath>
<CompiledSmapiPath>$(CompiledRootPath)\SMAPI</CompiledSmapiPath>
<CompiledToolkitPath>$(CompiledRootPath)\SMAPI.Toolkit\net4.5</CompiledToolkitPath>
+ <CompiledModsPath>$(CompiledRootPath)\Mods</CompiledModsPath>
<PackagePath>$(SolutionDir)\..\bin\SMAPI installer</PackagePath>
<PackageDevPath>$(SolutionDir)\..\bin\SMAPI installer for developers</PackageDevPath>
<PlatformName>windows</PlatformName>
<PlatformName Condition="$(OS) != 'Windows_NT'">unix</PlatformName>
</PropertyGroup>
- <ItemGroup>
- <CompiledMods Include="$(SolutionDir)\..\bin\$(Configuration)\Mods\**\*.*" />
- </ItemGroup>
<!-- reset package directory -->
<RemoveDir Directories="$(PackagePath)" />
@@ -48,12 +46,19 @@
<Copy SourceFiles="$(CompiledToolkitPath)\StardewModdingAPI.Toolkit.CoreInterfaces.dll" DestinationFolder="$(PackagePath)\bundle\smapi-internal" />
<Copy SourceFiles="$(CompiledToolkitPath)\StardewModdingAPI.Toolkit.CoreInterfaces.pdb" DestinationFolder="$(PackagePath)\bundle\smapi-internal" />
<Copy SourceFiles="$(CompiledToolkitPath)\StardewModdingAPI.Toolkit.CoreInterfaces.xml" DestinationFolder="$(PackagePath)\bundle\smapi-internal" />
- <Copy SourceFiles="@(CompiledMods)" DestinationFolder="$(PackagePath)\bundle\Mods\%(RecursiveDir)" />
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(TargetDir)\unix-launcher.sh" DestinationFiles="$(PackagePath)\bundle\StardewModdingAPI" />
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(CompiledSmapiPath)\System.Numerics.dll" DestinationFolder="$(PackagePath)\bundle\smapi-internal" />
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(CompiledSmapiPath)\System.Runtime.Caching.dll" DestinationFolder="$(PackagePath)\bundle\smapi-internal" />
<Copy Condition="$(OS) == 'Windows_NT'" SourceFiles="$(TargetDir)\windows-exe-config.xml" DestinationFiles="$(PackagePath)\bundle\StardewModdingAPI.exe.config" />
+ <!--copy bundled mods-->
+ <Copy SourceFiles="$(CompiledModsPath)\ConsoleCommands\ConsoleCommands.dll" DestinationFolder="$(PackagePath)\bundle\Mods\ConsoleCommands" />
+ <Copy SourceFiles="$(CompiledModsPath)\ConsoleCommands\ConsoleCommands.pdb" DestinationFolder="$(PackagePath)\bundle\Mods\ConsoleCommands" />
+ <Copy SourceFiles="$(CompiledModsPath)\ConsoleCommands\manifest.json" DestinationFolder="$(PackagePath)\bundle\Mods\ConsoleCommands" />
+ <Copy SourceFiles="$(CompiledModsPath)\SaveBackup\SaveBackup.dll" DestinationFolder="$(PackagePath)\bundle\Mods\SaveBackup" />
+ <Copy SourceFiles="$(CompiledModsPath)\SaveBackup\SaveBackup.pdb" DestinationFolder="$(PackagePath)\bundle\Mods\SaveBackup" />
+ <Copy SourceFiles="$(CompiledModsPath)\SaveBackup\manifest.json" DestinationFolder="$(PackagePath)\bundle\Mods\SaveBackup" />
+
<!-- fix errors on Linux/Mac (sample: https://log.smapi.io/mMdFUpgB) -->
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(RootPath)\build\lib\System.Numerics.dll" DestinationFolder="$(PackagePath)\bundle\smapi-internal" />
<Copy Condition="$(OS) != 'Windows_NT'" SourceFiles="$(RootPath)\build\lib\System.Runtime.Caching.dll" DestinationFolder="$(PackagePath)\bundle\smapi-internal" />
diff --git a/build/prepare-nuget-package.targets b/build/prepare-nuget-package.targets
index 0b4320a7..172bfdcc 100644
--- a/build/prepare-nuget-package.targets
+++ b/build/prepare-nuget-package.targets
@@ -5,7 +5,7 @@
package files to the bin\Pathoschild.Stardew.ModBuildConfig folder.
-->
- <Target Name="AfterBuild">
+ <Target Name="PreparePackage" AfterTargets="AfterBuild">
<PropertyGroup>
<PackagePath>$(SolutionDir)\..\bin\Pathoschild.Stardew.ModBuildConfig</PackagePath>
</PropertyGroup>