Skip to content

Commit

Permalink
Fix build target dependencies to work with no post-build event.
Browse files Browse the repository at this point in the history
  • Loading branch information
govert committed Apr 17, 2017
1 parent 5a961ee commit 80c3e9b
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Package/ExcelDna.AddIn/tools/ExcelDna.AddIn.targets
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="Windows-1252"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="ExcelDna.AddIn.Tasks.CreateExcelAddIn" AssemblyFile="ExcelDna.AddIn.Tasks.dll" />
<UsingTask TaskName="ExcelDna.AddIn.Tasks.CleanExcelAddIn" AssemblyFile="ExcelDna.AddIn.Tasks.dll" />
Expand All @@ -15,16 +16,16 @@
ExcelDnaClean;
</CleanDependsOn>
</PropertyGroup>

<!--
Extend the PostBuild target to call our ExcelDnaBuild and ExcelDnaPack targets
Extend the Build target to call our ExcelDnaBuild and ExcelDnaPack targets
-->
<PropertyGroup>
<PostBuildEventDependsOn>
$(PostBuildEventDependsOn);
<BuildDependsOn>
$(BuildDependsOn);
ExcelDnaBuild;
ExcelDnaPack;
</PostBuildEventDependsOn>
</BuildDependsOn>
</PropertyGroup>

<!--
Expand All @@ -51,7 +52,7 @@
<ExcelDna64BitAddInSuffix Condition="'$(ExcelDna64BitAddInSuffix)' == ''">64</ExcelDna64BitAddInSuffix>

<ExcelDnaToolsPath Condition="'$(ExcelDnaToolsPath)' == ''">$(MSBuildThisFileDirectory)</ExcelDnaToolsPath>

<ExcelDnaPackExePath Condition="'$(ExcelDnaPackExePath)' == ''">$(ExcelDnaToolsPath)ExcelDnaPack.exe</ExcelDnaPackExePath>
<ExcelDnaPackXllSuffix Condition="'$(ExcelDnaPackXllSuffix)' == ''">-packed</ExcelDnaPackXllSuffix>
<ExcelDnaPackCompressResources Condition="'$(ExcelDnaPackCompressResources)' == ''">true</ExcelDnaPackCompressResources>
Expand All @@ -66,7 +67,7 @@

<Error Text="ExcelDna32BitAddInSuffix and ExcelDna64BitAddInSuffix cannot be identical. Fix your ExcelDna.Build.props file"
Condition="'$(ExcelDna32BitAddInSuffix)' == '$(ExcelDna64BitAddInSuffix)'" />

<ItemGroup>
<ExcelDnaFilesInProject Include="@(None)" />
<ExcelDnaFilesInProject Include="@(Content)" />
Expand All @@ -88,7 +89,7 @@
<!--
Target that copies .dna, .xll, and .xll.config to the build output folder, for each platform
-->
<Target Name="ExcelDnaBuild" Condition="$(RunExcelDnaBuild)">
<Target Name="ExcelDnaBuild" BeforeTargets="PostBuildEvent" Condition="$(RunExcelDnaBuild)">
<Message Text="---" Importance="High" />

<Error Text="ExcelDna32BitAddInSuffix and ExcelDna64BitAddInSuffix cannot be identical. Fix your ExcelDna.Build.props file"
Expand Down Expand Up @@ -122,7 +123,7 @@
<!--
Target that runs ExcelDnaPack.exe for each .dna copied to the build output folder
-->
<Target Name="ExcelDnaPack" Condition="($(RunExcelDnaPack)) AND ('@(ExcelDnaFilesToPack->Count())' &gt; 0)" Outputs="%(ExcelDnaFilesToPack.Identity)">
<Target Name="ExcelDnaPack" DependsOnTargets="ExcelDnaBuild" BeforeTargets="PostBuildEvent" Condition="($(RunExcelDnaPack)) AND ('@(ExcelDnaFilesToPack->Count())' &gt; 0)" Outputs="%(ExcelDnaFilesToPack.Identity)">
<Error Text="ExcelDnaPack: ExcelDnaPack.exe not found: $(ExcelDnaPackExePath)" Condition="!Exists('$(ExcelDnaPackExePath)')" />

<!-- Run ExcelDnaPack.exe -->
Expand All @@ -140,7 +141,7 @@
<!-- Copy .xll.config file to -packed.xll.config (if .xll.config exists) -->
<Message Text="ExcelDnaPack: %(ExcelDnaFilesToPack.OutputXllConfigFileName) -> %(ExcelDnaFilesToPack.OutputPackedXllFileName).config" Importance="High"
Condition="Exists('%(ExcelDnaFilesToPack.OutputXllConfigFileName)')" />

<Copy SourceFiles="%(ExcelDnaFilesToPack.OutputXllConfigFileName)"
DestinationFiles="%(ExcelDnaFilesToPack.OutputPackedXllFileName).config"
Condition="Exists('%(ExcelDnaFilesToPack.OutputXllConfigFileName)')"
Expand Down

0 comments on commit 80c3e9b

Please sign in to comment.