Skip to content

Commit

Permalink
use custom PrepareForPluginCompile to set properties before compile (…
Browse files Browse the repository at this point in the history
…prevent pdb files in Release mode)
  • Loading branch information
Cryptoc1 committed Dec 19, 2023
1 parent 6152378 commit 1ff45ac
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/Sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>

<PluginDescription Condition=" '$(PluginDescription)' == '' ">$(Description)</PluginDescription>
<PluginId Condition=" '$(PluginId)' == '' ">$(AssemblyName)</PluginId>

Expand Down Expand Up @@ -84,6 +82,20 @@ $(PluginInfoTypeAccessModifier) class $(PluginInfoTypeName)
<Copy SourceFiles="$(_GeneratedManifestPath)" DestinationFiles="$(PublishDir)manifest.json" SkipUnchangedFiles="true" Condition=" Exists('$(_GeneratedManifestPath)') " />
</Target>

<Target Name="PrepareForPluginCompile" BeforeTargets="Compile;CoreCompile">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
</PropertyGroup>

<!-- NOTE: enforce optimizations in release mode -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
<IncludeSymbols>false</IncludeSymbols>
<Optimize>true</Optimize>
</PropertyGroup>
</Target>

<Target Name="PrepareForPluginPublish" BeforeTargets="PrepareForPublish">
<PropertyGroup>
<_PublishDir>$(PublishDir)</_PublishDir>
Expand All @@ -99,14 +111,6 @@ $(PluginInfoTypeAccessModifier) class $(PluginInfoTypeName)
<_PluginPackage Condition=" '$(PublishDir)' == '$(_PublishDir)' ">$(OutputPath)$(ThunderId)-$(PluginVersion).zip</_PluginPackage>
</PropertyGroup>

<!-- NOTE: enforce optimizations in release mode -->
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
<IncludeSymbols>false</IncludeSymbols>
<Optimize>true</Optimize>
</PropertyGroup>

<MakeDir Directories="$(_PublishDir)" />
</Target>

Expand Down

0 comments on commit 1ff45ac

Please sign in to comment.