Skip to content

Commit

Permalink
- improve plugin restore/resolve target calling
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryptoc1 committed Jan 4, 2024
1 parent ed15b0e commit 29f132f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
10 changes: 6 additions & 4 deletions src/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
<PluginAssetsFile>$(BaseIntermediateOutputPath)plugin.assets.json</PluginAssetsFile>
<PluginRestoreOutputs>$(PluginRestoreOutputs)$(PluginAssetsFile);</PluginRestoreOutputs>
<PluginRestoreOutputs Condition=" '$(PluginLockFile)' != '' ">$(PluginRestoreOutputs)$(PluginLockFile);</PluginRestoreOutputs>

<ResolveAssemblyReferencesDependsOn>$(ResolveAssemblyReferencesDependsOn);ResolvePluginReferences</ResolveAssemblyReferencesDependsOn>
</PropertyGroup>

<!-- NOTE: enforce optimizations in release mode -->
Expand Down Expand Up @@ -82,7 +84,7 @@
<!--
Executes the `RestorePluginDependencies` task to restore `ThunderDependency` items
-->
<Target Name="RestorePlugins" BeforeTargets="Restore" Inputs="@(ThunderDependency)" Outputs="$(PluginRestoreOutputs)">
<Target Name="RestorePlugins" BeforeTargets="Restore" AfterTargets="_GetAllRestoreProjectPathItems" Inputs="$(MSBuildAllProjects)" Outputs="$(PluginRestoreOutputs)">
<ItemGroup>
<FileWrites Include="$(PluginLockFile)" Condition=" '$(PluginLockFile)' != '' " />
<FileWrites Include="$(PluginAssetsFile)" />
Expand All @@ -97,7 +99,7 @@
<!--
Executes the `ResolvePluginAssemblies` task to resolve the reference assemblies of `ThunderDependency` items.
-->
<Target Name="ResolvePluginReferences" AfterTargets="RestorePlugins;Restore" BeforeTargets="BeforeCompile;CoreCompile;ResolveReferences;ResolveAssemblyReferences">
<Target Name="ResolvePluginReferences" AfterTargets="RestorePlugins" DependsOnTargets="ResolveProjectReferences">
<ResolvePluginAssemblies AssetsFile="$(PluginAssetsFile)">
<Output ItemName="_PluginReference" TaskParameter="ResolvedAssemblies" />
</ResolvePluginAssemblies>
Expand All @@ -110,7 +112,7 @@
<!--
Executes the `GeneratePluginInfoCode` task to generate a type containing plugin metadata defined via MSBuild properties.
-->
<Target Name="_GeneratePluginInfo" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)$(MSBuildProjectName).PluginInfo.g.cs">
<Target Name="_GeneratePluginInfo" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildProjectFullPath)" Outputs="$(IntermediateOutputPath)$(MSBuildProjectName).PluginInfo.g.cs">
<ItemGroup>
<Compile Include="$(IntermediateOutputPath)$(MSBuildProjectName).PluginInfo.g.cs" />
<FileWrites Include="$$(IntermediateOutputPath)$(MSBuildProjectName).PluginInfo.g.cs" />
Expand All @@ -125,7 +127,7 @@
<!--
Executes the `GeneratePluginManifestJson` task to generate the json text of the `manifest.json` used when publishing a Thunderstore package.
-->
<Target Name="_GeneratePluginManifest" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)$(MSBuildProjectName).manifest.g.json">
<Target Name="_GeneratePluginManifest" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildProjectFullPath)" Outputs="$(IntermediateOutputPath)$(MSBuildProjectName).manifest.g.json">
<ItemGroup>
<Content Include="$(IntermediateOutputPath)$(MSBuildProjectName).manifest.g.json">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
Expand Down
8 changes: 0 additions & 8 deletions test/plugins.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
"Evaisa-HookGenPatcher": "0.0.5"
}
},
"no00ob-LCSoundTool": {
"type": "Direct",
"requested": "1.4.0",
"resolved": "1.4.0",
"dependencies": {
"BepInEx-BepInExPack": "5.4.2100"
}
},
"Evaisa-HookGenPatcher": {
"type": "Transitive",
"resolved": "0.0.5"
Expand Down

0 comments on commit 29f132f

Please sign in to comment.