+2009-07-23 Ankit Jain <jankit@novell.com>
+
+ * Microsoft.Build.Tasks_test.dll.sources: Added
+ AssignProjectConfigurationTest.cs .
+
2009-07-22 Ankit Jain <jankit@novell.com>
* Makefile: Add System.Core .
2009-06-08 Ankit Jain <jankit@novell.com>
- * Microsoft.Build.Tasks_test.dll.sources: Added
+ * Microsoft.Build.Tasks.dll.sources: Added
ResolvedReference.cs
2009-05-14 Ankit Jain <jankit@novell.com>
//
// Author:
// Marek Sieradzki (marek.sieradzki@gmail.com)
+// Ankit Jain (jankit@novell.com)
//
// (C) 2006 Marek Sieradzki
+// Copyright 2009 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System;
using System.IO;
+using System.Collections.Generic;
+using System.Xml;
using Microsoft.Build.Framework;
+using Microsoft.Build.Utilities;
namespace Microsoft.Build.Tasks {
public class AssignProjectConfiguration : ResolveProjectBase {
[MonoTODO]
public override bool Execute ()
{
- return false;
+ if (String.IsNullOrEmpty (solutionConfigurationContents))
+ return true;
+
+ XmlReader xr = null;
+ Dictionary<Guid, string> guidToConfigPlatform = null;
+ try {
+ xr = XmlReader.Create (new StringReader (solutionConfigurationContents));
+ guidToConfigPlatform = new Dictionary<Guid, string> ();
+
+ xr.Read ();
+ while (!xr.EOF) {
+ xr.Read ();
+ if (xr.NodeType != XmlNodeType.Element)
+ continue;
+
+ string guid_str = xr.GetAttribute ("Project");
+ string config_str = xr.ReadString ();
+
+ Guid guid;
+ if (!String.IsNullOrEmpty (guid_str) && !String.IsNullOrEmpty (config_str) &&
+ TryParseGuid (guid_str, out guid))
+ guidToConfigPlatform [guid] = config_str;
+ }
+ } catch (XmlException xe) {
+ Log.LogError ("XmlException while parsing SolutionConfigurationContents: {0}",
+ xe.ToString ());
+
+ return false;
+ } finally {
+ ((IDisposable)xr).Dispose ();
+ }
+
+ List<ITaskItem> tempAssignedProjects = new List<ITaskItem> ();
+ List<ITaskItem> tempUnassignedProjects = new List<ITaskItem> ();
+ foreach (ITaskItem item in ProjectReferences) {
+ string config;
+
+ string guid_str = item.GetMetadata ("Project");
+ Guid guid;
+ if (!TryParseGuid (guid_str, out guid)) {
+ Log.LogError ("Project reference '{0}' has invalid or missing guid for metadata 'Project'.",
+ item.ItemSpec);
+ return false;
+ }
+
+ if (guidToConfigPlatform.TryGetValue (guid, out config)) {
+ string [] parts = config.Split (new char [] {'|'}, 2);
+
+ ITaskItem new_item = new TaskItem (item);
+
+ new_item.SetMetadata ("SetConfiguration", "Configuration=" + parts [0]);
+ new_item.SetMetadata ("SetPlatform", "Platform=" +
+ ((parts.Length > 1) ? parts [1] : String.Empty));
+
+ tempAssignedProjects.Add (new_item);
+ } else {
+ Log.LogWarning ("Project reference '{0}' could not be resolved.",
+ item.ItemSpec);
+ tempUnassignedProjects.Add (item);
+ }
+ }
+
+ assignedProjects = tempAssignedProjects.ToArray ();
+ unassignedProjects = tempUnassignedProjects.ToArray ();
+
+ return true;
}
-
+
+ bool TryParseGuid (string guid_str, out Guid guid)
+ {
+ guid = Guid.Empty;
+ try {
+ guid = new Guid (guid_str);
+ } catch (ArgumentNullException) {
+ return false;
+ } catch (FormatException) {
+ return false;
+ } catch (OverflowException) {
+ return false;
+ }
+
+ return true;
+ }
+
+
[Output]
public ITaskItem[] AssignedProjects {
get { return assignedProjects; }
}
}
-#endif
\ No newline at end of file
+#endif
+2009-07-23 Ankit Jain <jankit@novell.com>
+
+ * AssignProjectConfiguration.cs (Execute): Implement.
+
2009-07-22 Ankit Jain <jankit@novell.com>
Fix bug #517974.
Microsoft.Build.Tasks/ALTest.cs
Microsoft.Build.Tasks/AssignCultureTest.cs
+Microsoft.Build.Tasks/AssignProjectConfigurationTest.cs
Microsoft.Build.Tasks/AssignTargetPathTest.cs
Microsoft.Build.Tasks/CombinePathTest.cs
Microsoft.Build.Tasks/CopyTest.cs
--- /dev/null
+//
+// AssignProjectConfigurationTest.cs
+//
+// Author:
+// Ankit Jain (jankit@novell.com)
+//
+// Copyright 2009 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections;
+using Microsoft.Build.BuildEngine;
+using Microsoft.Build.Framework;
+using Microsoft.Build.Tasks;
+using Microsoft.Build.Utilities;
+using NUnit.Framework;
+using System.Text;
+
+namespace MonoTests.Microsoft.Build.Tasks
+{
+ [TestFixture]
+ public class AssignProjectConfigurationTest
+ {
+ [Test]
+ public void TestValidCase () {
+ string[] guids = new string[] {
+ "{88932AF5-A0AF-44F3-A202-5C88152F25CA}",
+ "{88932AF5-A0AF-44F3-A202-5C88152FABC1}",
+ "{3653C4D3-60C0-4657-8289-3922D0DFB933}",
+ "{DAE34193-B5C7-4488-A911-29EE15C84CB8}",
+ "{23F291D9-78DF-4133-8CF2-78CE104DDE63}",
+ "asd"
+ };
+
+ string[] project_ref_guids = new string[] {
+ "{88932AF5-A0AF-44F3-A202-5C88152F25CA}",
+ "{88932AF5-A0AF-44F3-A202-5C88152faBC1}",
+ "{3653C4D3-60C0-4657-8289-3922D0DFB933}",
+ "{DAE34193-B5C7-4488-A911-29EE15C84CB8}",
+ "{DAE34193-B5C7-4488-A911-29EE15C84CBE}"
+ };
+
+ CreateAndCheckProject (guids, project_ref_guids, new string[] {
+ "AssignedProjects : foo0.csproj;foo1.csproj;foo2.csproj;foo3.csproj: SetConfig: Configuration=Release",
+ "AssignedProjects : foo0.csproj: SetPlatform: Platform=AnyCPU0",
+ "AssignedProjects : foo1.csproj: SetPlatform: Platform=AnyCPU1",
+ "AssignedProjects : foo2.csproj: SetPlatform: Platform=AnyCPU2",
+ "AssignedProjects : foo3.csproj: SetPlatform: Platform=AnyCPU3",
+ "UnassignedProjects : foo4.csproj"},
+ true,
+ "A1#");
+ }
+
+ [Test]
+ public void TestInvalidProjectGuid ()
+ {
+ string[] guids = new string[] {
+ "{23F291D9-78DF-4133-8CF2-78CE104DDE63}",
+ };
+
+ string[] project_ref_guids = new string[] {
+ "{DAE34193-B5C7-4488-A911-29EE15C84CB8}",
+ "{23F291D9-78DF-4133-8CF2-78CE104DDE63}",
+ "invalid guid"
+ };
+
+ CreateAndCheckProject (guids, project_ref_guids, null, false, "A1#");
+ }
+
+ [Test]
+ public void TestInvalidProjectGuidInSolutionConfigContents () {
+ string[] guids = new string[] {
+ "{23F291D9-78DF-4133-8CF2-78CE104DDE63}",
+ "invalid guid"
+ };
+
+ string[] project_ref_guids = new string[] {
+ "{DAE34193-B5C7-4488-A911-29EE15C84CB8}",
+ "{23F291D9-78DF-4133-8CF2-78CE104DDE63}"
+ };
+
+ CreateAndCheckProject (guids, project_ref_guids,
+ new string [] {
+ "AssignedProjects : foo1.csproj: SetConfig: Configuration=Release",
+ "AssignedProjects : foo1.csproj: SetPlatform: Platform=AnyCPU0",
+ "UnassignedProjects : foo0.csproj"
+ }, true, "A1#");
+ }
+
+
+ void CreateAndCheckProject (string[] guids, string[] project_ref_guids, string[] messages, bool build_result, string prefix)
+ {
+ Engine engine = new Engine (Consts.BinPath);
+ Project project = engine.CreateNewProject ();
+ TestMessageLogger testLogger = new TestMessageLogger ();
+ engine.RegisterLogger (testLogger);
+
+ string projectString = CreateProject (guids, project_ref_guids);
+ project.LoadXml (projectString);
+
+ try {
+ Assert.AreEqual (build_result, project.Build (), "Build " + (build_result ? "failed" : "should've failed"));
+ testLogger.DumpMessages ();
+ if (!build_result || messages == null)
+ // build failed as expected, don't check outputs
+ return;
+ for (int i = 0; i < messages.Length; i++)
+ testLogger.CheckLoggedMessageHead (messages [i], prefix + i.ToString ());
+ Assert.AreEqual (0, testLogger.NormalMessageCount);
+ } catch (AssertionException) {
+ Console.WriteLine (projectString);
+ testLogger.DumpMessages ();
+ throw;
+ }
+ }
+
+ string CreateProject (string[] guids, string[] project_ref_guids)
+ {
+ StringBuilder sb = new StringBuilder ();
+ sb.Append (@"<Project xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">");
+ sb.Append ("\n<UsingTask TaskName=\"Microsoft.Build.Tasks.AssignProjectConfiguration\" AssemblyName=\"Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n");
+ sb.AppendFormat (@"<PropertyGroup>{0}</PropertyGroup>", CreateSolutionConfigurationProperty (guids, "Release|AnyCPU"));
+ sb.Append (CreateProjectReferencesItemGroup (project_ref_guids));
+
+ sb.Append ("\n\t<Target Name=\"1\">\n");
+ sb.Append ("\t\t<AssignProjectConfiguration ProjectReferences=\"@(ProjectReference)\" " +
+ " SolutionConfigurationContents=\"$(CurrentSolutionConfigurationContents)\">\n");
+ sb.Append ("\t\t\t<Output TaskParameter=\"AssignedProjects\" ItemName = \"AssignedProjects\" />\n");
+ sb.Append ("\t\t\t<Output TaskParameter=\"UnassignedProjects\" ItemName = \"UnassignedProjects\" />\n");
+ sb.Append ("\t\t</AssignProjectConfiguration>\n");
+ sb.Append ("<Message Text=\"AssignedProjects : @(AssignedProjects): SetConfig: %(AssignedProjects.SetConfiguration)\"/>\n");
+ sb.Append ("<Message Text=\"AssignedProjects : @(AssignedProjects): SetPlatform: %(AssignedProjects.SetPlatform)\"/>\n");
+ sb.Append ("<Message Text=\"UnassignedProjects : @(UnassignedProjects)\"/>\n");
+ sb.Append ("</Target>\n");
+ sb.Append ("</Project>");
+
+ return sb.ToString ();
+ }
+
+ string CreateSolutionConfigurationProperty (string[] guids, string config_str)
+ {
+ StringBuilder sb = new StringBuilder ();
+ sb.Append ("\n<CurrentSolutionConfigurationContents>\n");
+ sb.Append ("\t<foo xmlns=\"\">\n");
+ for (int i = 0; i < guids.Length; i++) {
+ sb.AppendFormat ("\t\t<bar Project=\"{0}\">{1}{2}</bar>\n",
+ guids[i], config_str, i);
+ }
+ sb.Append ("\t</foo>\n");
+
+ sb.Append ("</CurrentSolutionConfigurationContents>\n");
+ return sb.ToString ();
+ }
+
+ string CreateProjectReferencesItemGroup (string[] guids)
+ {
+ StringBuilder sb = new StringBuilder ();
+ sb.Append ("\n<ItemGroup>\n");
+ for (int i = 0; i < guids.Length; i ++)
+ sb.AppendFormat ("\t<ProjectReference Include=\"foo{1}.csproj\"><Project>{0}</Project></ProjectReference>\n", guids [i], i);
+ sb.Append ("</ItemGroup>\n");
+ return sb.ToString ();
+ }
+ }
+}
+2009-07-23 Ankit Jain <jankit@novell.com>
+
+ * AssignProjectConfigurationTest.cs: New.
+
2009-06-08 Ankit Jain <jankit@novell.com>
* CreateCSharpManifestResourceNameTest.cs (TestInvalidCulture): New.
+2009-07-23 Ankit Jain <jankit@novell.com>
+
+ * xbuild/Microsoft.Common.targets (AssignProjectConfigurations): New.
+ (ResolveProjectReferences): Add dependency on AssignProjectConfigurations
+ target. Also, set the config and platform properties for the msbuild task
+ being invoked.
+ * xbuild/Microsoft.Common.tasks: Add AssignProjectConfiguration .
+
2009-07-22 Ankit Jain <jankit@novell.com>
* xbuild/Microsoft.VisualBasic.targets (Vbc.References): Remove
+2009-07-23 Ankit Jain <jankit@novell.com>
+
+ * standalone/Project01: Change config mappings a bit to mix them up,
+ like Debug->Release etc. Update .proj file and final-outputs.txt.
+
2009-07-22 Ankit Jain <jankit@novell.com>
* standalone/Project01: Add references to two "external" assemblies
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {88932AF5-A0AF-44F3-A202-5C88152F25CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {88932AF5-A0AF-44F3-A202-5C88152F25CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {88932AF5-A0AF-44F3-A202-5C88152F25CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {88932AF5-A0AF-44F3-A202-5C88152F25CA}.Release|Any CPU.Build.0 = Release|Any CPU
- {041F1C17-D792-499B-973E-512E45122B4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {041F1C17-D792-499B-973E-512E45122B4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {041F1C17-D792-499B-973E-512E45122B4A}.Debug|Any CPU.ActiveCfg = Release|Any CPU
+ {041F1C17-D792-499B-973E-512E45122B4A}.Debug|Any CPU.Build.0 = Release|Any CPU
{041F1C17-D792-499B-973E-512E45122B4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{041F1C17-D792-499B-973E-512E45122B4A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {23F291D9-78DF-4133-8CF2-78CE104DDE63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {23F291D9-78DF-4133-8CF2-78CE104DDE63}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {23F291D9-78DF-4133-8CF2-78CE104DDE63}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {23F291D9-78DF-4133-8CF2-78CE104DDE63}.Release|Any CPU.Build.0 = Release|Any CPU
{3653C4D3-60C0-4657-8289-3922D0DFB933}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3653C4D3-60C0-4657-8289-3922D0DFB933}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3653C4D3-60C0-4657-8289-3922D0DFB933}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3653C4D3-60C0-4657-8289-3922D0DFB933}.Release|Any CPU.Build.0 = Release|Any CPU
- {DAE34193-B5C7-4488-A911-29EE15C84CB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DAE34193-B5C7-4488-A911-29EE15C84CB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {88932AF5-A0AF-44F3-A202-5C88152F25CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {88932AF5-A0AF-44F3-A202-5C88152F25CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {88932AF5-A0AF-44F3-A202-5C88152F25CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {88932AF5-A0AF-44F3-A202-5C88152F25CA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DAE34193-B5C7-4488-A911-29EE15C84CB8}.Debug|Any CPU.ActiveCfg = Release|Any CPU
+ {DAE34193-B5C7-4488-A911-29EE15C84CB8}.Debug|Any CPU.Build.0 = Release|Any CPU
{DAE34193-B5C7-4488-A911-29EE15C84CB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DAE34193-B5C7-4488-A911-29EE15C84CB8}.Release|Any CPU.Build.0 = Release|Any CPU
- {23F291D9-78DF-4133-8CF2-78CE104DDE63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {23F291D9-78DF-4133-8CF2-78CE104DDE63}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {23F291D9-78DF-4133-8CF2-78CE104DDE63}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {23F291D9-78DF-4133-8CF2-78CE104DDE63}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ version = 0.1
+ StartupItem = Project01\Main.csproj
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
<CurrentSolutionConfigurationContents>
<SolutionConfiguration xmlns="">
<ProjectConfiguration Project="{88932AF5-A0AF-44F3-A202-5C88152F25CA}">Debug|AnyCPU</ProjectConfiguration>
- <ProjectConfiguration Project="{041F1C17-D792-499B-973E-512E45122B4A}">Debug|AnyCPU</ProjectConfiguration>
+ <ProjectConfiguration Project="{041F1C17-D792-499B-973E-512E45122B4A}">Release|AnyCPU</ProjectConfiguration>
<ProjectConfiguration Project="{3653C4D3-60C0-4657-8289-3922D0DFB933}">Debug|AnyCPU</ProjectConfiguration>
- <ProjectConfiguration Project="{DAE34193-B5C7-4488-A911-29EE15C84CB8}">Debug|AnyCPU</ProjectConfiguration>
+ <ProjectConfiguration Project="{DAE34193-B5C7-4488-A911-29EE15C84CB8}">Release|AnyCPU</ProjectConfiguration>
<ProjectConfiguration Project="{23F291D9-78DF-4133-8CF2-78CE104DDE63}">Debug|AnyCPU</ProjectConfiguration>
</SolutionConfiguration>
</CurrentSolutionConfigurationContents>
<MSBuild Projects="Project01\Main.csproj" Targets="Publish" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') " />
</Target>
<Target Name="Lib1" Condition="'$(CurrentSolutionConfigurationContents)' != ''" DependsOnTargets="Lib2;Lib3">
- <MSBuild Projects="Lib1\Lib1.csproj" Properties="Configuration=Debug; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
+ <MSBuild Projects="Lib1\Lib1.csproj" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
<MSBuild Projects="Lib1\Lib1.csproj" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') " />
</Target>
<Target Name="Lib1:Clean" Condition="'$(CurrentSolutionConfigurationContents)' != ''" DependsOnTargets="Lib2:Clean;Lib3:Clean">
- <MSBuild Projects="Lib1\Lib1.csproj" Targets="Clean" Properties="Configuration=Debug; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
+ <MSBuild Projects="Lib1\Lib1.csproj" Targets="Clean" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
<MSBuild Projects="Lib1\Lib1.csproj" Targets="Clean" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') " />
</Target>
<Target Name="Lib1:Rebuild" Condition="'$(CurrentSolutionConfigurationContents)' != ''" DependsOnTargets="Lib2:Rebuild;Lib3:Rebuild">
- <MSBuild Projects="Lib1\Lib1.csproj" Targets="Rebuild" Properties="Configuration=Debug; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
+ <MSBuild Projects="Lib1\Lib1.csproj" Targets="Rebuild" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
<MSBuild Projects="Lib1\Lib1.csproj" Targets="Rebuild" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') " />
</Target>
<Target Name="Lib1:Publish" Condition="'$(CurrentSolutionConfigurationContents)' != ''" DependsOnTargets="Lib2:Publish;Lib3:Publish">
- <MSBuild Projects="Lib1\Lib1.csproj" Targets="Publish" Properties="Configuration=Debug; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
+ <MSBuild Projects="Lib1\Lib1.csproj" Targets="Publish" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
<MSBuild Projects="Lib1\Lib1.csproj" Targets="Publish" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') " />
</Target>
<Target Name="Lib2" Condition="'$(CurrentSolutionConfigurationContents)' != ''" DependsOnTargets="Lib4">
<MSBuild Projects="Lib2\Lib2.csproj" Targets="Publish" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') " />
</Target>
<Target Name="Lib3" Condition="'$(CurrentSolutionConfigurationContents)' != ''">
- <MSBuild Projects="Lib3\Lib3.csproj" Properties="Configuration=Debug; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
+ <MSBuild Projects="Lib3\Lib3.csproj" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
<MSBuild Projects="Lib3\Lib3.csproj" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') " />
</Target>
<Target Name="Lib3:Clean" Condition="'$(CurrentSolutionConfigurationContents)' != ''">
- <MSBuild Projects="Lib3\Lib3.csproj" Targets="Clean" Properties="Configuration=Debug; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
+ <MSBuild Projects="Lib3\Lib3.csproj" Targets="Clean" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
<MSBuild Projects="Lib3\Lib3.csproj" Targets="Clean" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') " />
</Target>
<Target Name="Lib3:Rebuild" Condition="'$(CurrentSolutionConfigurationContents)' != ''">
- <MSBuild Projects="Lib3\Lib3.csproj" Targets="Rebuild" Properties="Configuration=Debug; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
+ <MSBuild Projects="Lib3\Lib3.csproj" Targets="Rebuild" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
<MSBuild Projects="Lib3\Lib3.csproj" Targets="Rebuild" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') " />
</Target>
<Target Name="Lib3:Publish" Condition="'$(CurrentSolutionConfigurationContents)' != ''">
- <MSBuild Projects="Lib3\Lib3.csproj" Targets="Publish" Properties="Configuration=Debug; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
+ <MSBuild Projects="Lib3\Lib3.csproj" Targets="Publish" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Debug') and ('$(Platform)' == 'Any CPU') " />
<MSBuild Projects="Lib3\Lib3.csproj" Targets="Publish" Properties="Configuration=Release; Platform=AnyCPU; BuildingSolutionFile=true; CurrentSolutionConfigurationContents=$(CurrentSolutionConfigurationContents); SolutionDir=$(SolutionDir); SolutionExt=$(SolutionExt); SolutionFileName=$(SolutionFileName); SolutionName=$(SolutionName); SolutionPath=$(SolutionPath)" Condition=" ('$(Configuration)' == 'Release') and ('$(Platform)' == 'Any CPU') " />
</Target>
<Target Name="Lib4" Condition="'$(CurrentSolutionConfigurationContents)' != ''">
./Project01/bin/Debug/Project01.exe
./Project01/bin/Debug/abc.dll
./Project01/bin/Debug/bar.dll
-./Project01/bin/Debug/Lib1.dll.mdb
./Project01/bin/Debug/Lib1.dll
./Project01/bin/Debug/Lib4.dll.mdb
./Project01/bin/Debug/Project01.exe.mdb
./Project01/bin/Debug/Lib2.dll.mdb
./Project01/bin/Debug/Lib4.dll
./Project01/bin/Debug/en-US/Lib1.resources.dll
-./Lib3/bin/Debug/Lib3.dll.mdb
-./Lib3/bin/Debug/Lib3.dll
-./Lib1/bin/Debug/fr-CA/Lib1.resources.dll
-./Lib1/bin/Debug/fr-CA/Lib2.resources.dll
-./Lib1/bin/Debug/lib2_folder/Lib2.deploy.txt
-./Lib1/bin/Debug/Lib2.dll
-./Lib1/bin/Debug/fr-FR/Lib1.resources.dll
-./Lib1/bin/Debug/fr-FR/Lib2.resources.dll
-./Lib1/bin/Debug/Lib1.deploy.txt
-./Lib1/bin/Debug/Lib1.dll.mdb
-./Lib1/bin/Debug/Lib1.dll
-./Lib1/bin/Debug/Lib4.dll.mdb
-./Lib1/bin/Debug/Lib3.dll.mdb
-./Lib1/bin/Debug/Lib2.dll.mdb
-./Lib1/bin/Debug/Lib3.dll
-./Lib1/bin/Debug/Lib4.dll
-./Lib1/bin/Debug/en-US/Lib1.resources.dll
+./Lib3/bin/Release/Lib3.dll
+./Lib1/bin/Release/fr-CA/Lib1.resources.dll
+./Lib1/bin/Release/fr-CA/Lib2.resources.dll
+./Lib1/bin/Release/lib2_folder/Lib2.deploy.txt
+./Lib1/bin/Release/Lib2.dll
+./Lib1/bin/Release/fr-FR/Lib1.resources.dll
+./Lib1/bin/Release/fr-FR/Lib2.resources.dll
+./Lib1/bin/Release/Lib1.deploy.txt
+./Lib1/bin/Release/Lib1.dll
+./Lib1/bin/Release/Lib4.dll.mdb
+./Lib1/bin/Release/Lib2.dll.mdb
+./Lib1/bin/Release/Lib3.dll
+./Lib1/bin/Release/Lib4.dll
+./Lib1/bin/Release/en-US/Lib1.resources.dll
</ResolveAssemblyReference>
</Target>
+ <Target
+ Name="AssignProjectConfigurations"
+ Condition="'@(ProjectReference)' != ''">
+
+ <Message Text="projectref: @(ProjectReference) ProjectReferenceWithConfiguration: @(ProjectReferenceWithConfiguration)"/>
+ <AssignProjectConfiguration
+ ProjectReferences = "@(ProjectReference)"
+ SolutionConfigurationContents = "$(CurrentSolutionConfigurationContents)">
+
+ <Output TaskParameter = "AssignedProjects" ItemName = "ProjectReferenceWithConfiguration"/>
+ </AssignProjectConfiguration>
+ <Message Text="after, ProjectReferenceWithConfiguration: config %(ProjectReferenceWithConfiguration.SetConfiguration) %(ProjectReferenceWithConfiguration.SetPlatform)"/>
+ </Target>
+
+
<Target
Name="ResolveProjectReferences"
- Condition=" '@(ProjectReference)' != ''"
+ DependsOnTargets="AssignProjectConfigurations"
>
<!-- FIXME: don't build if building a .sln, since project ref would already have been built -->
<MSBuild
- Projects="@(ProjectReference)"
+ Projects="@(ProjectReferenceWithConfiguration)"
Targets="GetTargetPath"
- >
+ Properties="%(ProjectReferenceWithConfiguration.SetConfiguration); %(ProjectReferenceWithConfiguration.SetPlatform)"
+ Condition="'@(ProjectReferenceWithConfiguration)' != ''">
+
<Output TaskParameter="TargetOutputs" ItemName="ChildProjectReferences" />
</MSBuild>
</Target>
<UsingTask TaskName="Microsoft.Build.Tasks.AL" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.AssignTargetPath" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.AssignCulture" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+ <UsingTask TaskName="Microsoft.Build.Tasks.AssignProjectConfiguration" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CallTarget" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CombinePath" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Copy" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />