[Mono-list] Porting MSBuild script to XBuild with ItemGroup

Mike Christensen mike at kitchenpc.com
Thu Aug 4 04:33:45 EDT 2011


(For thread archive purposes since I hate finding a thread on Google
with my exact same problem and no one ever bothered to post the
solution)

Here's the XBuild compatible way of doing what I had below:

<CreateItem Include="$(BuildDir)/WWW/Scripts/kpc*.js;$(BuildDir)/WWW/Styles/*.css">
  <Output TaskParameter="Include" ItemName="ToCrunch" />
</CreateItem>

Mike

On Wed, Aug 3, 2011 at 7:54 PM, Jonathan Pobst <monkey at jpobst.com> wrote:
> You need to use the old way of doing thing, the CreateItem task.
>
> http://msdn.microsoft.com/en-us/library/s2y3e43x.aspx
>
> Jonathan
>
>
> On 8/3/2011 8:29 PM, Mike Christensen wrote:
>>
>> What's the best way to port this code over:
>>
>>   <Target Name="Build">
>>
>> ** Bunch of stuff here **
>>
>>     <!-- Crunch Files -->
>>     <ItemGroup>
>>        <ToCrunch
>> Include="$(BuildDir)/WWW/Scripts/kpc*.js;$(BuildDir)/WWW/Styles/*.css"
>> />
>>     </ItemGroup>
>>     <Message Importance="High" Text="Crunching Script Files..." />
>>     <Exec WorkingDirectory="Crunch" Command="java -jar
>> yuicompressor-2.4.2.jar %(ToCrunch.Fullpath) -o %(ToCrunch.Fullpath)
>> --charset utf-8" />
>>   </Target>
>>
>> If I run this, I get the error:
>>
>>
>>  : error : Error initializing task ItemGroup: Not registered task
>> ItemGroup.
>>
>> Which I believe is a known limitation in XBuild.  However, if I move
>> the ItemGroup outside the project, the set of files is empty because
>> those files have not been build yet.  Thanks!
>>
>> Mike
>> _______________________________________________
>> Mono-list maillist  -  Mono-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>>
>
>


More information about the Mono-list mailing list