Skip to content

Commit

Permalink
Merge pull request #5 from MonkeyModdingTroop/chore/packaging
Browse files Browse the repository at this point in the history
Packaging automation
  • Loading branch information
Banane9 authored Apr 30, 2024
2 parents 3e3e40b + 0677ffa commit af12e52
Show file tree
Hide file tree
Showing 8 changed files with 379 additions and 19 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Docs/_site/*
Docs/api/*

# Local symlink/folder for automations
/Game

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down Expand Up @@ -354,8 +357,7 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/

# BeatPulse healthcheck temp database
healthchecksdb
/

# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
Expand All @@ -366,4 +368,3 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd

/Resonite
7 changes: 2 additions & 5 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
<CopyToLibraries Condition="'$(CopyToLibraries)'==''">true</CopyToLibraries>
</PropertyGroup>

<PropertyGroup Condition="'$(ResonitePath)'==''">
<ResonitePath>$(MSBuildThisFileDirectory)Resonite</ResonitePath>
<ResonitePath Condition="Exists('C:\Program Files (x86)\Steam\steamapps\common\Resonite\')">C:\Program Files (x86)\Steam\steamapps\common\Resonite</ResonitePath>
<ResonitePath Condition="Exists('$(HOME)/.steam/steam/steamapps/common/Resonite/')">$(HOME)/.steam/steam/steamapps/common/Resonite</ResonitePath>
<ResonitePath Condition="Exists('D:/Files/Games/Resonite/app/')">D:/Files/Games/Resonite/app</ResonitePath>
<PropertyGroup Condition="'$(GamePath)'==''">
<GamePath>$(MSBuildThisFileDirectory)Game</GamePath>
</PropertyGroup>

</Project>
75 changes: 64 additions & 11 deletions MonkeyLoader/MonkeyLoader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@

<Target Name="AddSymbolsToPackage">
<ItemGroup>
<TfmSpecificPackageFile Include="$(OutDir)$(AssemblyName).pdb" PackagePath="lib/$(TargetFramework)/" />
<TfmSpecificPackageFile Include="$(OutDir)$(AssemblyName).pdb"
PackagePath="lib/$(TargetFramework)/" />
</ItemGroup>
</Target>

Expand All @@ -46,31 +47,83 @@
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(CopyToLibraries)'=='true'">
<Copy SourceFiles="$(TargetDir)$(TargetFileName)" DestinationFiles="$(ResonitePath)/MonkeyLoader/$(AssemblyFileName)" />
<Message Text="Copied $(TargetFileName) to $(ResonitePath)/MonkeyLoader/$(AssemblyFileName)" Importance="high" />
<Copy SourceFiles="$(TargetDir)$(TargetFileName)"
DestinationFiles="$(GamePath)/MonkeyLoader/$(AssemblyFileName)" />
<Message Text="Copied $(TargetFileName) to $(GamePath)/MonkeyLoader/$(AssemblyFileName)"
Importance="high" />

<Copy SourceFiles="$(TargetDir)$(TargetName).pdb" DestinationFiles="$(ResonitePath)/MonkeyLoader/$(TargetName).pdb" />
<Message Text="Copied $(TargetName).pdb to $(ResonitePath)/MonkeyLoader/$(TargetName).pdb" Importance="high" />
<Copy SourceFiles="$(TargetDir)$(TargetName).pdb"
DestinationFiles="$(GamePath)/MonkeyLoader/$(TargetName).pdb" />
<Message Text="Copied $(TargetName).pdb to $(GamePath)/MonkeyLoader/$(TargetName).pdb"
Importance="high" />
</Target>

<Target Name="CreateZip" AfterTargets="Build">
<PropertyGroup>
<ZipCreationFolder>$(BaseOutputPath)zip-creation</ZipCreationFolder>
</PropertyGroup>
<ItemGroup>
<ZipSourceFiles Include="$(OutputPath)\**\*.*" />
<ZipVendorFiles Include="$(MSBuildProjectDirectory)/vendor/**/*.*" />
</ItemGroup>

<RemoveDir Directories="$(ZipCreationFolder)" />
<MakeDir
Directories="$(ZipCreationFolder);$(ZipCreationFolder)/MonkeyLoader;$(ZipCreationFolder)/MonkeyLoader/Configs;$(ZipCreationFolder)/MonkeyLoader/GamePacks;$(ZipCreationFolder)/MonkeyLoader/Libs;$(ZipCreationFolder)/MonkeyLoader/Mods;$(ZipCreationFolder)/MonkeyLoader/PatchedAssemblies" />
<Copy SourceFiles="@(ZipSourceFiles)"
DestinationFolder="$(ZipCreationFolder)/MonkeyLoader/" />
<Copy SourceFiles="@(ZipVendorFiles)"
DestinationFolder="$(ZipCreationFolder)/%(RecursiveDir)" />
<ZipDirectory
SourceDirectory="$(ZipCreationFolder)"
Overwrite="true"
DestinationFile="$(BaseOutputPath)\MonkeyLoader-v$(Version)-$(Configuration).zip" />
</Target>

<ItemGroup>
<PackageReference Include="Lib.Harmony.Thin" Version="2.3.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NuGet.Packaging" Version="6.9.1" />
<PackageReference Include="NuGet.Protocol" Version="6.9.1" />
<PackageReference Include="Lib.Harmony.Thin" Version="2.3.3">
<Private>True</Private>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3">
<Private>False</Private>
</PackageReference>
<PackageReference Include="NuGet.Packaging" Version="6.9.1">
<Private>True</Private>
</PackageReference>
<PackageReference Include="NuGet.Protocol" Version="6.9.1">
<Private>True</Private>
</PackageReference>
<PackageReference Include="PolySharp" Version="1.14.1">
<Private>False</Private>
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Zio" Version="0.17.0" ExcludeAssets="compile; build; runtime; native" GeneratePathProperty="true" />
<PackageReference Include="System.ValueTuple" Version="4.5.0">
<Private>True</Private>
</PackageReference>
<PackageReference Include="Zio" Version="0.17.0" ExcludeAssets="compile; build; runtime; native"
GeneratePathProperty="true">
<Private>True</Private>
</PackageReference>
<!--<ProjectReference Include="..\MonkeyLoader.CodeGenerators\MonkeyLoader.CodeGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />-->
</ItemGroup>

<ItemGroup>
<Reference Include="Zio">
<HintPath>$(PkgZio)\lib\netstandard2.0\Zio.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>

<!-- Remove `System.*` DLLs from the output folder -->
<Target Name="ClearReferenceCopyLocalPaths" AfterTargets="ResolveAssemblyReferences">
<ItemGroup>
<RemoveRefCopy Include="@(ReferenceCopyLocalPaths)"
Condition="$([System.String]::Copy(&quot;%(ReferenceCopyLocalPaths.Filename)&quot;).StartsWith('System'))"
/>
<ReferenceCopyLocalPaths Remove="@(RemoveRefCopy)" />
</ItemGroup>
</Target>


</Project>
1 change: 1 addition & 0 deletions MonkeyLoader/vendor/.doorstop_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4.1.0
45 changes: 45 additions & 0 deletions MonkeyLoader/vendor/doorstop_config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# General options for Unity Doorstop
[General]

# Enable Doorstop?
enabled=true

# Path to the assembly to load and execute
# NOTE: The entrypoint must be of format `static void Doorstop.Entrypoint.Start()`
target_assembly=MonkeyLoader/MonkeyLoader.dll

# If true, Unity's output log is redirected to <current folder>\output_log.txt
redirect_output_log=false

# If enabled, DOORSTOP_DISABLE env var value is ignored
# USE THIS ONLY WHEN ASKED TO OR YOU KNOW WHAT THIS MEANS
ignore_disable_switch=false


# Options specific to running under Unity Mono runtime
[UnityMono]

# Overrides default Mono DLL search path
# Sometimes it is needed to instruct Mono to seek its assemblies from a different path
# (e.g. mscorlib is stripped in original game)
# This option causes Mono to seek mscorlib and core libraries from a different folder before Managed
# Original Managed folder is added as a secondary folder in the search path
dll_search_path_override=

# If true, Mono debugger server will be enabled
debug_enabled=false

# When debug_enabled is true, specifies the address to use for the debugger server
debug_address=127.0.0.1:10000

# If true and debug_enabled is true, Mono debugger server will suspend the game execution until a debugger is attached
debug_suspend=false

# Options sepcific to running under Il2Cpp runtime
[Il2Cpp]

# Path to coreclr.dll that contains the CoreCLR runtime
coreclr_path=

# Path to the directory containing the managed core libraries for CoreCLR (mscorlib, System, etc.)
corlib_dir=
Binary file added MonkeyLoader/vendor/libdoorstop.so
Binary file not shown.
Loading

0 comments on commit af12e52

Please sign in to comment.