开发者

dotless: how to process a list of LESS files using dotless.Compiler.exe

I wanted to know how to proc开发者_如何学编程ess a list of LESS files using the exe binaries, for example:

./dotless.Compiler.exe -m *.less

Right now I only can do individual files, but can't do wildcard.

The reason why I asked about this is that I want to create a target in MSBuild, which is to process an item collection (which is a list of files). I couldn't find a way to loop a task in side MSBuild. If anyone knows how to loop a task for each file, that would solve my problem too.


Use an ItemGroup to get a list of files like this:

<ItemGroup>
    <MyFiles Include="[path to less files]\*" />
</ItemGroup>

Call the compiler once for each file by using %(MyFiles.FullPath) syntax (also known as Task Batching)

<Target Name="CompileLess">
   <Exec Command="$(dotLessCompiler) -m %(MyFiles.FullPath)" />
</Target>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜