Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,42 @@
//
// ProjectChangedEventArgs.cs
//
// Author:
// Atsushi Enomoto <atsushi@xamarin.com>
//
// Copyright (C) 2013 Xamarin Inc.
//
// 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.Linq;
namespace Microsoft.Build.Evaluation
{
public class ProjectChangedEventArgs : EventArgs
{
internal ProjectChangedEventArgs (Project project)
{
Project = project;
}
public Project Project { get; private set; }
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
using System;
using Microsoft.Build.Construction;
namespace Microsoft.Build.Evaluation
{
public class ProjectCollectionChangedEventArgs : EventArgs
{
public ProjectCollectionChangedEventArgs (ProjectCollectionChangedState state)
{
State = state;
}
public ProjectCollectionChangedState State { get; private set; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using Microsoft.Build.Construction;
namespace Microsoft.Build.Evaluation
{
public enum ProjectCollectionChangedState
{
DefaultToolsVersion,
DisableMarkDirty,
GlobalProperties,
HostServices,
IsBuildEnabled,
Loggers,
OnlyLogCriticalEvents,
SkipEvaluation,
Toolsets
}
}

View File

@@ -0,0 +1,157 @@
//
// ProjectItem.cs
//
// Author:
// Leszek Ciesielski (skolima@gmail.com)
// Rolf Bjarne Kvinge (rolf@xamarin.com)
// Atsushi Enomoto (atsushi@xamarin.com)
//
// (C) 2011 Leszek Ciesielski
// Copyright (C) 2011,2013 Xamarin Inc.
//
// 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.Generic;
using System.Diagnostics;
using System.Linq;
using Microsoft.Build.Construction;
using System.IO;
using Microsoft.Build.Framework;
namespace Microsoft.Build.Evaluation
{
[DebuggerDisplay ("{ItemType}={EvaluatedInclude} [{UnevaluatedInclude}] #DirectMetadata={DirectMetadataCount}")]
public class ProjectItem
{
internal ProjectItem (Project project, ProjectItemElement xml, string evaluatedInclude)
{
this.project = project;
this.xml = xml;
if (project.ItemDefinitions.ContainsKey (ItemType))
foreach (var md in project.ItemDefinitions [ItemType].Metadata)
metadata.Add (md);
foreach (var md in xml.Metadata)
metadata.Add (new ProjectMetadata (project, ItemType, metadata, m => metadata.Remove (m), md));
this.evaluated_include = evaluatedInclude;
is_imported = project.ProjectCollection.OngoingImports.Any ();
}
readonly Project project;
readonly ProjectItemElement xml;
readonly List<ProjectMetadata> metadata = new List<ProjectMetadata> ();
readonly bool is_imported;
readonly string evaluated_include;
internal string RecursiveDir { get; set; }
public ProjectMetadata GetMetadata (string name)
{
return metadata.FirstOrDefault (m => m.Name == name);
}
public string GetMetadataValue (string name)
{
if (name == null)
throw new ArgumentNullException ("name");
var wk = ProjectCollection.GetWellKnownMetadata (name, EvaluatedInclude, project.GetFullPath, RecursiveDir);
if (wk != null)
return wk;
var m = GetMetadata (name);
return m != null ? m.EvaluatedValue : string.Empty;
}
public bool HasMetadata (string name)
{
return GetMetadata (name) != null;
}
public bool RemoveMetadata (string name)
{
var m = GetMetadata (name);
if (m == null)
return false;
return metadata.Remove (m);
}
public void Rename (string name)
{
throw new NotImplementedException ();
}
public ProjectMetadata SetMetadataValue (string name, string unevaluatedValue)
{
// This has to do several tasks:
// - it cannot directly change Xml.Metadata because the ProjectItemElement might be shared
// among multiple ProjectItems.
// - hence it has to create another ProjectItemElement instance and add it to the project
// XML construction, with specific Include value that is assigned to this instance, and
// metadata values that are assigned to this instance.
throw new NotImplementedException ();
}
public IEnumerable<ProjectMetadata> DirectMetadata {
get {
var list = new List<ProjectMetadata> ();
foreach (var xm in xml.Metadata)
yield return new ProjectMetadata (project, ItemType, list, p => list.Remove (p), xm);
}
}
public int DirectMetadataCount {
get { return xml.Metadata.Count; }
}
public string EvaluatedInclude {
get { return evaluated_include; }
}
public bool IsImported {
get { return is_imported; }
}
public string ItemType {
get { return Xml.ItemType; }
set { Xml.ItemType = value; }
}
public ICollection<ProjectMetadata> Metadata {
get { return metadata; }
}
public int MetadataCount {
get { return metadata.Count; }
}
public Project Project {
get { return project; }
}
public string UnevaluatedInclude {
get { return Xml.Include; }
set { Xml.Include = value; }
}
public ProjectItemElement Xml {
get { return xml; }
}
}
}

View File

@@ -0,0 +1,69 @@
// ProjectItemDefinition.cs
//
// Author:
// Rolf Bjarne Kvinge (rolf@xamarin.com)
// Atsushi Enomoto (atsushi@xamarin.com)
//
// Copyright (C) 2011,2013 Xamarin Inc.
//
// 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.Generic;
using Microsoft.Build.Construction;
namespace Microsoft.Build.Evaluation
{
public class ProjectItemDefinition
{
internal ProjectItemDefinition (Project project, string itemType)
{
this.project = project;
this.item_type = itemType;
}
Project project;
string item_type;
List<ProjectMetadata> metadata = new List<ProjectMetadata> ();
public string ItemType {
get { return item_type; }
}
public IEnumerable<ProjectMetadata> Metadata {
get { return metadata; }
}
public int MetadataCount {
get { return metadata.Count; }
}
public Project Project {
get { return project; }
}
internal void AddItems (ProjectItemDefinitionElement xml)
{
foreach (var item in xml.Metadata)
metadata.Add (new ProjectMetadata (project, ItemType, metadata, m => metadata.Remove (m), item));
}
}
}

View File

@@ -0,0 +1,41 @@
//
// ProjectLoadSettings.cs
//
// Author:
// Leszek Ciesielski (skolima@gmail.com)
//
// (C) 2011 Leszek Ciesielski
//
// 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;
namespace Microsoft.Build.Evaluation
{
[Flags]
public enum ProjectLoadSettings
{
Default = 0,
IgnoreMissingImports = 1,
RecordDuplicateButNotCircularImports = 2,
RejectCircularImports = 4
}
}

View File

@@ -0,0 +1,88 @@
// Toolset.cs
//
// Author:
// Rolf Bjarne Kvinge (rolf@xamarin.com)
// Atsushi Enomoto (atsushi@xamarin.com)
//
// Copyright (C) 2011,2013 Xamarin Inc.
//
// 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 Microsoft.Build.Construction;
using System;
using System.Collections.Generic;
using System.Linq;
namespace Microsoft.Build.Evaluation
{
public class ProjectMetadata
{
internal ProjectMetadata (Project project, string itemType, IEnumerable<ProjectMetadata> existingMetadata, Action<ProjectMetadata> remover, ProjectMetadataElement xml)
{
this.xml = xml;
this.project = project;
item_type = itemType;
predecessor = existingMetadata.FirstOrDefault (m => m.Name == xml.Name);
if (predecessor != null)
remover (predecessor);
is_imported = Project.ProjectCollection.OngoingImports.Any ();
}
readonly Project project;
readonly string item_type;
readonly ProjectMetadataElement xml;
readonly ProjectMetadata predecessor;
readonly bool is_imported;
public string EvaluatedValue {
get { return project.ExpandString (xml.Value); }
}
public bool IsImported {
get { return is_imported; }
}
public string ItemType {
get { return item_type; }
}
public string Name {
get { return xml.Name; }
}
public ProjectMetadata Predecessor {
get { return predecessor; }
}
public Project Project {
get { return project; }
}
public string UnevaluatedValue {
get { return xml.Value; }
}
public ProjectMetadataElement Xml {
get { return xml; }
}
}
}

View File

@@ -0,0 +1,288 @@
// ProjectProperty.cs
//
// Author:
// Rolf Bjarne Kvinge (rolf@xamarin.com)
// Atsushi Enomoto (atsushi@xamarin.com)
//
// Copyright (C) 2011,2013 Xamarin Inc.
//
// 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.Linq;
using Microsoft.Build.Construction;
using Microsoft.Build.Internal;
using System.Collections.Generic;
using System.Reflection;
using System.IO;
namespace Microsoft.Build.Evaluation
{
// In .NET 4.0 MSDN says it is non-abstract, but some of those
// members are abstract and had been there since 4.0.
// I take this as doc bug, as non-abstract to abstract is a
// breaking change and I'd rather believe API designer's sanity.
public abstract class ProjectProperty
{
internal ProjectProperty (Project project) // hide default ctor
{
Project = project;
}
public string EvaluatedValue {
get { return InternalEvaluatedValue; }
}
public abstract bool IsEnvironmentProperty { get; }
public abstract bool IsGlobalProperty { get; }
[MonoTODO]
public abstract bool IsImported { get; }
public abstract bool IsReservedProperty { get; }
internal virtual bool IsWellKnownProperty {
get { return false; }
}
public abstract string Name { get; }
public abstract ProjectProperty Predecessor { get; }
public Project Project { get; private set; }
public abstract string UnevaluatedValue { get; set; }
public abstract ProjectPropertyElement Xml { get; }
internal abstract string InternalEvaluatedValue { get; }
}
// copy from MS.Build.Engine/BuildProperty.cs
internal enum PropertyType {
Reserved,
Global,
Normal,
Environment
}
internal abstract class BaseProjectProperty : ProjectProperty
{
public BaseProjectProperty (Project project, PropertyType propertyType, string name)
: base (project)
{
property_type = propertyType;
this.name = name;
predecessor = project.Properties.FirstOrDefault (p => p.Name.Equals (name, StringComparison.OrdinalIgnoreCase));
if (predecessor != null)
project.RemoveProperty (predecessor);
}
PropertyType property_type;
readonly string name;
public override string Name {
get { return name; }
}
public override bool IsEnvironmentProperty {
get { return property_type == PropertyType.Environment; }
}
public override bool IsGlobalProperty {
get { return property_type == PropertyType.Global; }
}
public override bool IsImported {
get { return false; }
}
public override bool IsReservedProperty {
get { return property_type == PropertyType.Reserved; }
}
readonly ProjectProperty predecessor;
public override ProjectProperty Predecessor {
get { return predecessor; }
}
}
internal abstract class ImmutableProjectProperty : BaseProjectProperty
{
public ImmutableProjectProperty (Project project, PropertyType propertyType, string name)
: base (project, propertyType, name)
{
}
internal override string InternalEvaluatedValue {
get { return UnevaluatedValue; }
}
}
internal abstract class MutableProjectProperty : BaseProjectProperty
{
public MutableProjectProperty (Project project, PropertyType propertyType, string name)
: base (project, propertyType, name)
{
}
string evaluated_value; // see UpdateEvaluatedValue().
internal void UpdateEvaluatedValue ()
{
evaluated_value = Project.ExpandString (UnevaluatedValue);
}
internal override string InternalEvaluatedValue {
get { return evaluated_value; }
}
}
internal class XmlProjectProperty : MutableProjectProperty
{
public XmlProjectProperty (Project project, ProjectPropertyElement xml, PropertyType propertyType, bool isImported)
: base (project, propertyType, xml.Name)
{
this.xml = xml;
this.is_imported = isImported;
UpdateEvaluatedValue ();
}
readonly ProjectPropertyElement xml;
readonly bool is_imported;
public override bool IsImported {
get { return is_imported; }
}
public override string UnevaluatedValue {
get { return xml.Value; }
set { xml.Value = value; }
}
public override ProjectPropertyElement Xml {
get { return xml; }
}
}
internal class EnvironmentProjectProperty : ImmutableProjectProperty
{
static string extensions_path;
internal static string DefaultExtensionsPath {
get {
if (extensions_path == null) {
// NOTE: code from mcs/tools/gacutil/driver.cs
PropertyInfo gac = typeof (System.Environment).GetProperty (
"GacPath", BindingFlags.Static | BindingFlags.NonPublic);
if (gac != null) {
MethodInfo get_gac = gac.GetGetMethod (true);
string gac_path = (string) get_gac.Invoke (null, null);
extensions_path = Path.GetFullPath (Path.Combine (
gac_path, Path.Combine ("..", "xbuild")));
}
}
return extensions_path;
}
}
public EnvironmentProjectProperty (Project project, string name, string value, bool wellknown = false)
: base (project, PropertyType.Environment, name)
{
this.value = value;
this.wellknown = wellknown;
}
readonly string value;
readonly bool wellknown;
internal override bool IsWellKnownProperty {
get { return wellknown; }
}
// It can override possible another environment vairable property BUT never gives Predecessor.
public override ProjectProperty Predecessor {
get { return null; }
}
public override string UnevaluatedValue {
get { return value; }
set { throw new InvalidOperationException (string.Format ("You cannot change value of environment property '{0}'.", Name)); }
}
public override ProjectPropertyElement Xml {
get { return null; }
}
}
internal class GlobalProjectProperty : ImmutableProjectProperty
{
public GlobalProjectProperty (Project project, string name, string value)
: base (project, PropertyType.Global, name)
{
this.value = value;
}
readonly string value;
public override string UnevaluatedValue {
get { return value; }
set { throw new InvalidOperationException (string.Format ("You cannot change value of global property '{0}'.", Name)); }
}
public override ProjectPropertyElement Xml {
get { return null; }
}
}
internal class ManuallyAddedProjectProperty : MutableProjectProperty
{
public ManuallyAddedProjectProperty (Project project, string name, string value)
: base (project, PropertyType.Normal, name)
{
this.UnevaluatedValue = value;
}
public override string UnevaluatedValue { get; set; }
public override ProjectPropertyElement Xml {
get { return null; }
}
}
internal class ReservedProjectProperty : ImmutableProjectProperty
{
public ReservedProjectProperty (Project project, string name, Func<string> value)
: base (project, PropertyType.Reserved, name)
{
this.value = value;
}
// make sure it does not give access to any possible attempted overrrides.
public override ProjectProperty Predecessor {
get { return null; }
}
readonly Func<string> value;
public override string UnevaluatedValue {
get { return value (); }
set { throw new InvalidOperationException (string.Format ("You cannot change value of reserved property '{0}'.", Name)); }
}
public override ProjectPropertyElement Xml {
get { return null; }
}
}
}

View File

@@ -0,0 +1,45 @@
//
// ProjectXmlChangedEventArgs.cs
//
// Author:
// Atsushi Enomoto <atsushi@xamarin.com>
//
// Copyright (C) 2013 Xamarin Inc.
//
// 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 Microsoft.Build.Construction;
using System;
using System.Linq;
namespace Microsoft.Build.Evaluation
{
public class ProjectXmlChangedEventArgs : EventArgs
{
internal ProjectXmlChangedEventArgs (ProjectRootElement projectXml, string reason)
{
ProjectXml = projectXml;
Reason = reason;
}
public ProjectRootElement ProjectXml { get; private set; }
public string Reason { get; private set; }
}
}

View File

@@ -0,0 +1,60 @@
// ResolvedImport.cs
//
// Author:
// Rolf Bjarne Kvinge (rolf@xamarin.com)
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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 Microsoft.Build.Construction;
using System;
namespace Microsoft.Build.Evaluation
{
[System.Runtime.InteropServices.StructLayout (System.Runtime.InteropServices.LayoutKind.Sequential)]
public struct ResolvedImport
{
internal ResolvedImport (ProjectImportElement import, ProjectRootElement root, bool isImported)
{
this.import = import;
this.root = root;
this.imported = isImported;
}
readonly ProjectImportElement import;
readonly ProjectRootElement root;
readonly bool imported;
public ProjectImportElement ImportingElement {
get { return import; }
}
public ProjectRootElement ImportedProject {
get { return root; }
}
public bool IsImported {
get { return imported; }
}
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using Microsoft.Build.Execution;
namespace Microsoft.Build.Evaluation
{
#if NET_4_5
public
#endif
class SubToolset
{
internal SubToolset (IDictionary<string, ProjectPropertyInstance> properties, string subToolsetVersion)
{
Properties = properties;
SubToolsetVersion = subToolsetVersion;
}
public IDictionary<string, ProjectPropertyInstance> Properties { get; private set; }
public string SubToolsetVersion { get; private set; }
}
}

View File

@@ -0,0 +1,81 @@
// Toolset.cs
//
// Author:
// Rolf Bjarne Kvinge (rolf@xamarin.com)
// Atsushi Enomoto (atsushi@xamarin.com)
//
// Copyright (C) 2011,2013 Xamarin Inc.
//
// 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.Generic;
using System.Linq;
using Microsoft.Build.Execution;
namespace Microsoft.Build.Evaluation
{
public class Toolset
{
public Toolset (string toolsVersion, string toolsPath,
ProjectCollection projectCollection, string msbuildOverrideTasksPath)
: this (toolsVersion, toolsPath, null, projectCollection, msbuildOverrideTasksPath)
{
}
public Toolset (string toolsVersion, string toolsPath,
IDictionary<string, string> buildProperties, ProjectCollection projectCollection,
string msbuildOverrideTasksPath)
: this (toolsVersion, toolsPath, buildProperties, projectCollection, null, msbuildOverrideTasksPath)
{
}
#if NET_4_5
public
#endif
Toolset (string toolsVersion, string toolsPath, IDictionary<string, string> buildProperties,
ProjectCollection projectCollection, IDictionary<string, SubToolset> subToolsets,
string msbuildOverrideTasksPath)
{
ToolsVersion = toolsVersion;
ToolsPath = toolsPath;
Properties =
buildProperties == null ?
new Dictionary<string, ProjectPropertyInstance> () :
buildProperties.Select (p => new ProjectPropertyInstance (p.Key, true, p.Value)).ToDictionary (e => e.Name);
#if NET_4_5
SubToolsets = subToolsets ?? new Dictionary<string, SubToolset> ();
#endif
}
#if NET_4_5
public string DefaultSubToolsetVersion { get; private set; }
public IDictionary<string, SubToolset> SubToolsets { get; private set; }
#endif
public IDictionary<string, ProjectPropertyInstance> Properties { get; private set; }
public string ToolsPath { get; private set; }
public string ToolsVersion { get; private set; }
}
}

View File

@@ -0,0 +1,40 @@
// ToolsetDefinitionLocations.cs
//
// Author:
// Rolf Bjarne Kvinge (rolf@xamarin.com)
//
// Copyright (C) 2011 Xamarin Inc.
//
// 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;
namespace Microsoft.Build.Evaluation
{
[Flags ()]
public enum ToolsetDefinitionLocations
{
None,
ConfigurationFile,
Registry,
}
}