Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ward <matt.ward@microsoft.com>2018-04-12 18:28:45 +0300
committerMatt Ward <matt.ward@microsoft.com>2018-04-12 18:28:45 +0300
commitb91895bfae3cd14c1d3b0dac652bff9ea05a6481 (patch)
treebd20d271f110344889da51ba7bec95ae3df51199 /main/src/core
parent4b6809430eee2f2345eae595a46e971a63f35333 (diff)
[Core] Support facade assemblies from a custom location
Added a OnGetFacadeAssemblies method to the DotNetProjectExtension that allows a project extension to provide the facade assemblies for a project if the default behaviour does not work for the project. This can be used by the Xamarin.Mac project extension to provide the facade assemblies when the project uses Xamarin.Mac full. A Xamarin.Mac full project will use a custom facades directory at build time but the project has a target framework of .NET Framework so the default facades assembly resolution logic will return the wrong facade assemblies that are included with Mono.
Diffstat (limited to 'main/src/core')
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs35
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs5
2 files changed, 32 insertions, 8 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
index 07b2ca1735..8186af470c 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
@@ -972,19 +972,33 @@ namespace MonoDevelop.Projects
}
if (addFacadeAssemblies) {
- var runtime = TargetRuntime ?? MonoDevelop.Core.Runtime.SystemAssemblyService.DefaultRuntime;
- var facades = runtime.FindFacadeAssembliesForPCL (TargetFramework);
- foreach (var facade in facades) {
- if (!File.Exists (facade))
- continue;
- var ar = new AssemblyReference (facade);
- if (!result.Contains (ar))
- result.Add (ar);
+ var facades = await ProjectExtension.OnGetFacadeAssemblies ();
+ if (facades != null) {
+ foreach (var facade in facades) {
+ if (!result.Contains (facade))
+ result.Add (facade);
+ }
}
}
return result;
}
+ internal protected virtual Task<List<AssemblyReference>> OnGetFacadeAssemblies ()
+ {
+ List<AssemblyReference> result = null;
+ var runtime = TargetRuntime ?? Runtime.SystemAssemblyService.DefaultRuntime;
+ var facades = runtime.FindFacadeAssembliesForPCL (TargetFramework);
+ foreach (var facade in facades) {
+ if (!File.Exists (facade))
+ continue;
+ if (result == null)
+ result = new List<AssemblyReference> ();
+ var ar = new AssemblyReference (facade);
+ result.Add (ar);
+ }
+ return Task.FromResult (result);
+ }
+
AsyncCriticalSection referenceCacheLock = new AsyncCriticalSection ();
ImmutableDictionary<string, List<AssemblyReference>> referenceCache = ImmutableDictionary<string, List<AssemblyReference>>.Empty;
bool referenceCacheNeedsRefresh;
@@ -2030,6 +2044,11 @@ namespace MonoDevelop.Projects
return Project.OnGetReferencedAssemblyProjects (configuration);
}
+ internal protected override Task<List<AssemblyReference>> OnGetFacadeAssemblies ()
+ {
+ return Project.OnGetFacadeAssemblies ();
+ }
+
#pragma warning disable 672 // Member overrides obsolete member
internal protected override ExecutionCommand OnCreateExecutionCommand (ConfigurationSelector configSel, DotNetProjectConfiguration configuration)
{
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs
index 3737d95c64..62106c0508 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectExtension.cs
@@ -88,6 +88,11 @@ namespace MonoDevelop.Projects
return next.OnGetReferencedAssemblyProjects (configuration);
}
+ internal protected virtual Task<List<AssemblyReference>> OnGetFacadeAssemblies ()
+ {
+ return next.OnGetFacadeAssemblies ();
+ }
+
[Obsolete("User overload that takes a RunConfiguration")]
internal protected virtual ExecutionCommand OnCreateExecutionCommand (ConfigurationSelector configSel, DotNetProjectConfiguration configuration)
{