简体   繁体   中英

Visual Studio 2010 Deployment package

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>

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM