Skip to content

Commit

Permalink
[MMP] Allow resolving assemblies to the ones passed in command line args
Browse files Browse the repository at this point in the history
This reverts the recursive directory search commit and allows resolving assemblies from the ones passed.
  • Loading branch information
Therzok committed Feb 22, 2018
1 parent afd33cb commit 8aafb2e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
4 changes: 2 additions & 2 deletions tools/common/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,10 @@ public void RunRegistrar ()
var resolver = new PlatformResolver () {
FrameworkDirectory = Driver.GetPlatformFrameworkDirectory (this),
RootDirectory = Path.GetDirectoryName (RootAssembly),
};
#if MMP
resolver.RecursiveSearchDirectories.AddRange (Driver.RecursiveSearchDirectories);
CommandLineAssemblies = RootAssemblies,
#endif
};

if (Platform == ApplePlatform.iOS || Platform == ApplePlatform.MacOSX) {
if (Is32Build) {
Expand Down
8 changes: 4 additions & 4 deletions tools/common/CoreResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ public virtual AssemblyDefinition Load (string fileName)
return assembly;
}

protected AssemblyDefinition SearchDirectory (string name, string directory, string extension = ".dll", bool recursive = false)
protected AssemblyDefinition SearchDirectory (string name, string directory, string extension = ".dll")
{
var file = DirectoryGetFile (directory, name + extension, recursive);
var file = DirectoryGetFile (directory, name + extension);
if (file.Length > 0)
return Load (file);
return null;
}

static string DirectoryGetFile (string directory, string file, bool recursive)
static string DirectoryGetFile (string directory, string file)
{
var files = Directory.GetFiles (directory, file, recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly);
var files = Directory.GetFiles (directory, file);
if (files != null && files.Length > 0) {
if (files.Length > 1) {
ErrorHelper.Warning (133, "Found more than 1 assembly matching '{0}', choosing first:{1}{2}", file, Environment.NewLine, string.Join ("\n", files));
Expand Down
5 changes: 0 additions & 5 deletions tools/mmp/driver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ public static partial class Driver {
static string app_name;
static bool generate_plist;
public static RegistrarMode Registrar { get { return App.Registrar; } private set { App.Registrar = value; } }
public static List<string> RecursiveSearchDirectories { get; } = new List<string> ();
static bool no_executable;
static bool embed_mono = true;
static bool? profiling = false;
Expand Down Expand Up @@ -312,10 +311,6 @@ static void Main2 (string [] args)
}
}
},
{ "recursive-directories:", "Specify extra recursive search directories to use when probing assemblies", v => {
RecursiveSearchDirectories.AddRange (v.Split (Path.PathSeparator));
}
},
{ "sdk=", "Specifies the SDK version to compile against (version, for example \"10.9\")",
v => {
try {
Expand Down
6 changes: 0 additions & 6 deletions tools/mmp/resolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@ public override AssemblyDefinition Resolve (AssemblyNameReference reference, Rea
if (assembly != null)
return assembly;

foreach (var directory in RecursiveSearchDirectories) {
assembly = SearchDirectory (name, directory, recursive: true);
if (assembly != null)
return assembly;
}

return null;
}
}
Expand Down

0 comments on commit 8aafb2e

Please sign in to comment.