Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enable restoration and resolution of plugin assemblies from
ThunderDependency
items.To support restore, additional Sdk properties have been added:
PluginManager
1PluginStagingProfile
. Possible values:r2modman
,''
(implies Thunderstore)PluginManagerDataDir
1$(AppData)\Thunderstore Mod Manager\DataFolder\LethalCompany\
. Default value is determined based on$(PluginManager)
. Must end in a trailing slash.PluginCacheDir
$(PluginManagerDataDir)cache\
if thePLUGIN_SDK_CACHE
2 is not defined. Must end in a trailing slashPluginInfoTypeModifiers
PluginInfoTypeAccessModifier
(backwards compatible)RestorePluginsWithLockFile
plugins.lock.json
file should be used for restore. Defaults to$(RestorePackagesWithLockFile)
.PluginLockFile
plugins.lock.json
file. Defaults to$(MSBuildProjectDirectory)\plugins.lock.json
if$(RestorePluginsWithLockFile)
evaluates totrue
, empty otherwisePluginAssetsFile
plugin.assets.json
file. Defaults to$(BaseIntermediateOutputPath)plugin.assets.json
PluginRestoreOutputs
RestorePlugins
Target.Plugin Restoration & Assembly Resolution
A
RestorePlugins
MSBuild Target has been added that runs before the defaultRestore
which executes theRestorePluginDependencies
Task, which evaluates the provided@(ThunderDependency)
items, resolving a dependency graph of direct and transitive plugins, and restoring (download+extract) them to the$(PluginCacheDir)
. The implemention ofRestorePluginDependencies
is intended to be similar to NuGet restore functionality.If
$(RestorePluginsWithLockFile)
evaluates totrue
, aplugins.lock.json
file is generated in the project root representing the resolved dependency graph; this file is used for speeding up and ensuring consistency across restores.If
$(RestoreLockedMode)
(e.g.dotnet restore --locked-mode
) evaluates totrue
, the Sdk expects aplugins.lock.json
file to exist in the project root, which is used rather than resolving a dependency graph.When the
RestorePlugins
target succeeds, aplugin.assets.json
file is generated containing a listing of assets for each restored plugin.The
plugin.assets.json
file is evaluated by theResolvePluginAssemblies
task, prior to theCompile
andResolveReferences
targets, via theResolvePluginReferences
target. Upon evaluation of the assets file, theResolvePluginReferences
target addsReference
items for the resolved plugin assemblies.The listing of assets contained in
plugin.assets.json
is evaluated based on theExcludeAssets
/IncludeAssets
metadata of theThunderDependency
item of a plugin. For example if the pluginExampleTeam-ExamplePlugin
contained assemblies in aplugins\ignored\
directory that are unwanted, they may be excluded with the glob patternplugins\ignored\*.dll
:Manifest & PluginInfo Generation
PluginInfo code and Thunderstore manifest generation have been re-implemented as MSBuild Tasks as well. With this, manifest generation now includes validation of generated values, such as the
name
.