Ajaxmin tasks explicit filenames

Oct 31, 2012 at 10:09 PM

I would like to use a list of explicit file names rather then using a wild card list of files. Here is a snippet of the project file:

  <ItemGroup Label="WlShared">
    <WlShared Include="..\..\..\..\..\WlShared\src\Shared\lib\utils.js">
    <WlShared Include="..\..\..\..\..\WlShared\src\Shared\js\classUtility.js">

... More files omitted ...

  <Target Name="MinifyAndCombine" Condition=" '$(Configuration)' == 'Debug' ">
    <MakeDir Directories="$(OutDir)\js"/>
    <AjaxMin Switches="-clobber -kill:-1" JsSourceFiles="@(WlShared)" JsCombinedFileName="$(OutDir)\js\$(CombinedFileName)" />
    <Message Text="Done" />

When I build using this, I get a bizarre error:

Could not find a part of the path 'd:\MaxPlat\Dev\AdProducts\WlShared\WlShared\WlShared\WlShared\WlShared\WlShared\WlShared\WlShared\WlShared\src\WlShared\src\WlShared\src\WlShared\src\Shared\js\classUtility.js'

Is there something I am doing wrong, or is this a bug?


Nov 1, 2012 at 12:03 AM

Unfortunately I am wholly unfamiliar with the MSBuild syntax you're using to build up the @(WlShared) group. Seems to me that's where the problem lies, because it sure looks like the path string that it can't find is completely messed up. But again, I don't know because I've never created a group of files like that before (not that I have a lot of experience with MSBuild scripts).

If you want to create a static list of explicit files with AjaxMin, I suggest using a manifest file. A manifest is an XML file that lists one or more output JS files, each with one or more input files, settings, etc. You could then maintain the manifest file, and use the manifest build task to "build" the manifest file into your generated output files.

I was going to send you to the documentation page, but it is REALLY old! I need to update that this afternoon. But it does give you the general gist ofthe XML format, although there should be a lot more options, attributes and elements available now. http://ajaxmin.codeplex.com/wikipage?title=XML%20File%20Formats. I'll post again when I've updated it.

Nov 1, 2012 at 1:13 AM

Just wanted to add that I updated the XML Formats page I linked to above to include the latest attributes and elements. 

Now I realized that the AjaxMinTask.dll documentation doesn't even mention the manifest task. More documentation coming....

Nov 1, 2012 at 9:27 PM

I was able to get this to work. It looks like the Switches="-kill:-1" really confuses Ajaxmin Tasks. I've opened an incident with a smaller repro. If I remove this switch, and make sure all files are separated with semi-colons, it works fine.

Thanks for your help. 

Nov 1, 2012 at 9:33 PM

So removing "-kill:-1" from the Switches property fixed the input path? Those shouldnʻt be related at all; paths are exclusively the realm of the EXE and Task assemblies, and the kill switch is used only by the DLL. I would really love to have a repro for this so I can get it fixed. That sounds like a nasty bug.