Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert previous settings changes + don't recursively search for file #1202

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Source/Mosa.Compiler.Framework/MosaCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ private enum CompileStage

public MosaCompiler(MosaSettings mosaSettings, CompilerHooks compilerHook, IModuleLoader moduleLoader, ITypeResolver typeResolver)
{
MosaSettings = mosaSettings;
MosaSettings = new MosaSettings();
MosaSettings.SetDefaultSettings();
MosaSettings.Merge(mosaSettings);

CompilerHooks = compilerHook;
ModuleLoader = moduleLoader;
TypeResolver = typeResolver;
Expand Down
8 changes: 4 additions & 4 deletions Source/Mosa.Utility.Configuration/AppLocationsSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ private static string TryFind(string file, IList<string> searchdirectories = nul
if (dir == null)
continue;

var location = SearchSubdirectories(dir, file);
var location = Path.Combine(dir, file);

if (location != null)
if (File.Exists(location))
return location;
}
}
Expand All @@ -441,9 +441,9 @@ private static string TryFind(string file, string searchdirectory)
if (dir == null)
return null;

var location = SearchSubdirectories(dir, file);
var location = Path.Combine(dir, file);

if (location != null)
if (File.Exists(location))
return location;

return null;
Expand Down
10 changes: 9 additions & 1 deletion Source/Mosa.Utility.Launcher/BaseLauncher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ public class BaseLauncher
public BaseLauncher(MosaSettings mosaSettings, CompilerHooks compilerHook)
{
CompilerHooks = compilerHook;
MosaSettings = mosaSettings;

MosaSettings = new MosaSettings();
MosaSettings.LoadAppLocations();
MosaSettings.SetDefaultSettings();
MosaSettings.ResolveDefaults();
MosaSettings.Merge(mosaSettings);
MosaSettings.NormalizeSettings();
MosaSettings.ResolveFileAndPathSettings();
MosaSettings.AddStandardPlugs();
}

protected void OutputStatus(string status)
Expand Down
7 changes: 0 additions & 7 deletions Source/Mosa.Utility.UnitTests/UnitTestSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@ public static class UnitTestSystem
public static int Start(string[] args)
{
var mosaSettings = new MosaSettings();
mosaSettings.LoadAppLocations();
mosaSettings.SetDefaultSettings();
mosaSettings.LoadArguments(args);
mosaSettings.NormalizeSettings();
mosaSettings.ResolveDefaults();
mosaSettings.ResolveFileAndPathSettings();
mosaSettings.AddStandardPlugs();
mosaSettings.ExpandSearchPaths();

var stopwatch = new Stopwatch();
stopwatch.Start();
Expand Down
Loading