Skip to content

Commit

Permalink
Merge pull request #327 from augustoproiete/allow-package-reference-v…
Browse files Browse the repository at this point in the history
…ia-build-config

Allow devs to use PackageReference if they wish (despite current limitations)
  • Loading branch information
govert authored Jun 28, 2020
2 parents 80b8016 + abdeecb commit a762017
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Package/ExcelDna.AddIn/build/ExcelDna.AddIn.targets
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
<ExcelDna32BitAddInSuffix Condition="'$(ExcelDna32BitAddInSuffix)' == ''"></ExcelDna32BitAddInSuffix>
<ExcelDna64BitAddInSuffix Condition="'$(ExcelDna64BitAddInSuffix)' == ''">64</ExcelDna64BitAddInSuffix>

<ExcelDnaAllowPackageReferenceProjectStyle Condition="'$(ExcelDnaAllowPackageReferenceProjectStyle)' == ''">false</ExcelDnaAllowPackageReferenceProjectStyle>

<ExcelDnaPackExePath Condition="'$(ExcelDnaPackExePath)' == ''">$(ExcelDnaToolsPath)ExcelDnaPack.exe</ExcelDnaPackExePath>
<ExcelDnaPackXllSuffix Condition="'$(ExcelDnaPackXllSuffix)' == ''">-packed</ExcelDnaPackXllSuffix>
<ExcelDnaPackCompressResources Condition="'$(ExcelDnaPackCompressResources)' == ''">true</ExcelDnaPackCompressResources>
Expand All @@ -64,9 +66,9 @@
Target that checks if the project is not compatible with Excel-DNA
-->
<Target Name="ExcelDnaCheckPackageProjectStyle" BeforeTargets="CoreCompile">
<Warning Code="DNA1546"
Text="Excel-DNA is not compatible with projects that use NuGet `PackageReference`. Make sure you create a .NET Framework (Class Library) project and configure Visual Studio to use `packages.config`"
Condition=" '$(PackageReferenceCompatibleProjectStyle)' == 'true' OR '$(RestoreProjectStyle)' == 'ProjectJson' OR '$(NuGetProjectStyle)' == 'PackageReference' " />
<Error Code="DNA1546"
Text="Excel-DNA is not compatible with projects that use NuGet `PackageReference`. Make sure you create a .NET Framework (Class Library) project and configure Visual Studio to use `packages.config`"
Condition=" '$(ExcelDnaAllowPackageReferenceProjectStyle)' != 'true' AND ('$(PackageReferenceCompatibleProjectStyle)' == 'true' OR '$(RestoreProjectStyle)' == 'ProjectJson' OR '$(NuGetProjectStyle)' == 'PackageReference') " />
</Target>

<!--
Expand Down
7 changes: 7 additions & 0 deletions Package/ExcelDna.AddIn/content/ExcelDna.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
<ExcelDna64BitAddInSuffix Condition="'$(ExcelDna64BitAddInSuffix)' == ''">64</ExcelDna64BitAddInSuffix>
</PropertyGroup>

<PropertyGroup>
<!--
Enable/Disable using Excel-DNA with PackageReference projects (not officially supported)
-->
<ExcelDnaAllowPackageReferenceProjectStyle Condition="'$(ExcelDnaAllowPackageReferenceProjectStyle)' == ''">false</ExcelDnaAllowPackageReferenceProjectStyle>
</PropertyGroup>

<!--
Configuration properties for packing .dna files
-->
Expand Down

0 comments on commit a762017

Please sign in to comment.