views:

32

answers:

1

I want to use this task in the VS2010 Web Application package deployment process to compress the javascript files:

  <Target Name="CompressJS">
    <ItemGroup>
      <_JSFilesToCompress Include="*.js" />
    </ItemGroup>
    <Message Text="Compresing Javascript files $(_PackageTempDir)" Importance="high" />
    <JSCompress Files="@(_JSFilesToCompress)" />
  </Target>

I tried in some locations like OnAfterPipelinePreDeployCopyAllFilesToOneFolder, but it won't work. In WDP I used to have it like:

  <PropertyGroup>
    <BuildDependsOn>
      $(BuildDependsOn);
      CompressJS;
    </BuildDependsOn>
  </PropertyGroup>
A: 

Instead of trying to modify the BuildDependsOn property group, I'd try to get your target to fire after compile or before drop build. Check out c:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets for various targets to override.

<PropertyGroup>
  <AfterCompileSolutionDependsOn>
    CompressJS;
  </AfterCompileSolutionDependsOn>
</PropertyGroup>

<Target Name="AfterCompileSolution" DependsOnTargets="$(AfterCompileSolutionDependsOn)">
</Target>
MStodd
BuildDependsOn was in WDP, that doens't apply for Package Deployment for vs2010 anymore.
richard