|
|
||
|---|---|---|
| .github/workflows | ||
| mono-cil-strip | ||
| packaging | ||
| .gitignore | ||
| README.md | ||
IllusionLibs
Every library ever needed for Illusion game modding, almost.
How to use IllusionLibs in your project
- Create a new
nuget.configfile next to your .sln file. - Put this inside the newly created file:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<packageSources>
<add key="IllusionMods" value="https://pkgs.dev.azure.com/IllusionMods/Nuget/_packaging/IllusionMods/nuget/v3/index.json" />
</packageSources>
</configuration>
- Close and reopen your solution if you had it open in VS.
- Right click on your project and "Manage NuGet packages..."
- Change "Package source" on right to "IllusionMods". You should now see all of the packages from this repository (and more).
How to prevent dll files from these packages from being copied to the build output
If you want to keep your build directory clean with only the plugin dlls being copied there, you can use one of the following methods to prevent dlls from nuget packages from being copied there.
By editing .csproj
Open your project in VisualStudio or similar and find it in the Solution Explorer, then:
- For old format .csproj files
- Expand References
- Select all of them (except for the Analyzers element if it exists)
- Go to the Properties window
- In "Copy Local" type in "False"
- For new format .csproj files (sdk)
- Expand Dependencies\Packages
- Select all of the packages (except for analyzers if any)
- Go to the Properties window
- In "Included Assets" type in "compile" and in "Private Assets" type in "All"
Finally, manually delete the dlls from your build output. Now whenever you build your project the package dlls should no longer get copied to the build directory.
By using Directory.Build.props
Add this section to Directory.Build.props. Warning: The SkipAllRefs target will prevent all package references from being copied. RemoveDepsJson target will remove the *.deps.json files from build output since they are not needed for BepInEx plugins.
<Project>
<Target Name="SkipAllRefs" AfterTargets="ResolveReferences">
<ItemGroup>
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" />
</ItemGroup>
</Target>
<Target Name="RemoveDepsJson" AfterTargets="PostBuildEvent">
<Delete Files="$(OutputPath)\$(MSBuildProjectName).deps.json" />
</Target>
</Project>
How to update nuget packages in this repository
This is necessary only if you want to update or add new dlls to this repository. To do that you will have to prepare the dlls and update nuspec files.
Note: Assemblies of games running on mono (from the managed folder) should be stripped and then publicized before being added. IL2CPP interop assemblies should only be stripped, not publicized (they are already publicized, only things hidden is IL2CPP piping).
- Clone the repo
- Use the included mono-cil-strip.exe to strip the new assemblies of their code and AssemblyPublicizer.exe to publicize them (make all members public for easier access, your project has to be set to unsafe for it to work, the packages all contain a script that sets this flag automatically when installed)
publicize-and-strip-folder.batandstrip-folder.batare used by dragging a folder on itstrip-dlls-folder.sh(Linux) is used by running it to strip contents of the dlls foldermono-cil-strip.exeis used by dragging a file on it
- Replace the dll files you want to update with the new versions in the
packaging\GAME\librariesfolder - Update the nuget version
- Game and unity package versions are defined in the
packaging\pack.ps1file - Some other packages have the version in the nuspec file directly
- Game and unity package versions are defined in the
- Commit your changes and the github action will automatically push the updated packages to the nuget feed