Bug 4193 - ItemGroup's Condition attribute not used when compiling...
Summary: ItemGroup's Condition attribute not used when compiling...
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: General ()
Version: 2.8.6
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-04-02 15:17 UTC by Peter Kornfeld
Modified: 2012-05-10 18:33 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample project to see the problem... (243.83 KB, application/octet-stream)
2012-04-02 15:17 UTC, Peter Kornfeld
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_ON_ROADMAP

Description Peter Kornfeld 2012-04-02 15:17:33 UTC
Created attachment 1612 [details]
Sample project to see the problem...

Hi,

When I have embedded js files in my project I put the minified and the plain version under different ItemGroups in the project file and add some conditions to embed them only with the right dll.

   <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
        <EmbeddedResource Include="js\jquery.js">
            <Generator>GoogleClosureCompiler</Generator>
            <LastGenOutput>jquery.min.js</LastGenOutput>
        </EmbeddedResource>
    </ItemGroup>
    <ItemGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
        <EmbeddedResource Include="js\jquery.min.js">
            <AutoGen>True</AutoGen>
            <DesignTime>True</DesignTime>
            <DependentUpon>jquery.js</DependentUpon>
        </EmbeddedResource>
    </ItemGroup>

(see http://msdn.microsoft.com/en-us/library/646dk05y.aspx for schema details)

When compiling from VS2010 it works perfect, however when compiling from MonoDevelop it always include both minified and plain files...
Comment 1 Mikayla Hutchinson [MSFT] 2012-04-02 16:51:14 UTC
MonoDevelop's internal build engine has limited support for evaluating MSBuild conditions on items, but not item groups. We have no plans to add this feature to the MD internal build engine.

In future we plan to migrate to the "real" MSBuild build engine, which will fix it. This is available as an experimental option in the Preferences->Build options panel - it does not yet work for all project types.
Comment 2 Peter Kornfeld 2012-04-03 02:10:38 UTC
Thanks.

I've checked in version 2.8.6.5 and worked perfectly.
How this will work on Linux? There is no .NET framework installation there...
Comment 3 Mikayla Hutchinson [MSFT] 2012-04-03 02:25:24 UTC
Mono has an MSBuild implementation called "xbuild", and MD can use that.
Comment 4 Peter Kornfeld 2012-05-10 18:33:55 UTC
Just for information...

tested on:

Fedora 16
mono 2.10.5
MD 2.8.1
Apache 2.22.2
mod_mono 2.10

Compile as expected...