Skip to content

Commit

Permalink
- Typo corrections + code cleanup (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgiphil committed Mar 23, 2019
1 parent 96c320c commit 69ae4d0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 26 deletions.
38 changes: 28 additions & 10 deletions Source/Mosa.Tool.Mosactl/Application.cs
@@ -1,16 +1,16 @@
using System; // Copyright (c) MOSA Project. Licensed under the New BSD License.

using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Diagnostics; using System.Diagnostics;
using System.Reflection; using System.IO;
using System.Text.RegularExpressions; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using System.Threading; using System.Threading;


namespace Mosa.Tool.Mosactl namespace Mosa.Tool.Mosactl
{ {

public class MosaCtl public class MosaCtl
{ {
private bool IsWin = false; private bool IsWin = false;
Expand Down Expand Up @@ -45,27 +45,35 @@ public static string GetEnv(string name)
case "MOSA_ROOT": case "MOSA_ROOT":
value = Path.GetDirectoryName(Path.GetDirectoryName(new Uri(typeof(Program).Assembly.Location).AbsolutePath)); value = Path.GetDirectoryName(Path.GetDirectoryName(new Uri(typeof(Program).Assembly.Location).AbsolutePath));
break; break;

case "MOSA_BIN": case "MOSA_BIN":
value = Path.Combine(GetEnv("MOSA_ROOT"), "bin"); value = Path.Combine(GetEnv("MOSA_ROOT"), "bin");
break; break;

case "MOSA_SOURCE": case "MOSA_SOURCE":
value = Path.Combine(GetEnv("MOSA_ROOT"), "Source"); value = Path.Combine(GetEnv("MOSA_ROOT"), "Source");
break; break;

case "MOSA_TOOLS": case "MOSA_TOOLS":
value = Path.Combine(GetEnv("MOSA_ROOT"), "Tools"); value = Path.Combine(GetEnv("MOSA_ROOT"), "Tools");
break; break;

case "MOSA_NUGET": case "MOSA_NUGET":
value = Path.Combine(GetEnv("MOSA_TOOLS"), "nuget", "nuget.exe"); value = Path.Combine(GetEnv("MOSA_TOOLS"), "nuget", "nuget.exe");
break; break;

case "MOSA_MSBUILD": case "MOSA_MSBUILD":
value = appLocations.MsBuild; value = appLocations.MsBuild;
break; break;

case "MOSA_WIN_OSDIR": case "MOSA_WIN_OSDIR":
value = @"C:\Windows"; value = @"C:\Windows";
break; break;

case "MOSA_WIN_PROGRAMS": case "MOSA_WIN_PROGRAMS":
value = @"C:\Program Files"; // TODO value = @"C:\Program Files"; // TODO
break; break;

case "MOSA_WIN_PROGRAMS_X86": case "MOSA_WIN_PROGRAMS_X86":
value = @"C:\Program Files (x86)"; // TODO value = @"C:\Program Files (x86)"; // TODO
break; break;
Expand Down Expand Up @@ -99,35 +107,43 @@ public void Run(List<string> args)
if (!TaskTools(CheckType.force)) if (!TaskTools(CheckType.force))
Environment.Exit(1); Environment.Exit(1);
break; break;

case "runtime": case "runtime":
if (!TaskRuntime(CheckType.force)) if (!TaskRuntime(CheckType.force))
Environment.Exit(1); Environment.Exit(1);
break; break;

case "net": case "net":
case "dotnet": case "dotnet":
if (!TaskCILBuild(CheckType.force, args)) if (!TaskCILBuild(CheckType.force, args))
Environment.Exit(1); Environment.Exit(1);
break; break;

case "bin": case "bin":
case "binary": case "binary":
if (!TaskBinaryBuild(CheckType.force, args)) if (!TaskBinaryBuild(CheckType.force, args))
Environment.Exit(1); Environment.Exit(1);
break; break;

case "run": case "run":
if (!TaskRun(args)) if (!TaskRun(args))
Environment.Exit(1); Environment.Exit(1);
break; break;

case "test": case "test":
if (!TaskTest(args)) if (!TaskTest(args))
Environment.Exit(1); Environment.Exit(1);
break; break;

case "unittest": case "unittest":
if (!TaskUnitTest(args)) if (!TaskUnitTest(args))
Environment.Exit(1); Environment.Exit(1);
break; break;

case "debug": case "debug":
TaskDebug(args); TaskDebug(args);
break; break;

case "help": case "help":
PrintHelp("usage"); PrintHelp("usage");
break; break;
Expand Down Expand Up @@ -249,7 +265,9 @@ private PlattformAppCall PrepareNetRuntime(string netApplication, List<string> a
} }
} }


public void TaskDiskBuild() { } public void TaskDiskBuild()
{
}


public void TaskBuild(List<string> args) public void TaskBuild(List<string> args)
{ {
Expand Down Expand Up @@ -343,7 +361,6 @@ private bool CallQemu(bool nographic, Action<string, Process> OnKernelLog)
args.Add("-serial"); args.Add("-serial");
args.Add("stdio"); args.Add("stdio");



args.Add("-serial"); args.Add("-serial");
args.Add("null"); args.Add("null");


Expand Down Expand Up @@ -385,7 +402,6 @@ private bool CallQemu(bool nographic, Action<string, Process> OnKernelLog)
if (buf[0] != '\r') if (buf[0] != '\r')
sb.Append(buf[0]); sb.Append(buf[0]);
} }
} }
}); });
th.Start(); th.Start();
Expand Down Expand Up @@ -508,10 +524,13 @@ public string ExpandKernelName(string name)
{ {
case "helloworld": case "helloworld":
return "Mosa.HelloWorld.x86"; return "Mosa.HelloWorld.x86";

case "coolworld": case "coolworld":
return "Mosa.CoolWorld.x86"; return "Mosa.CoolWorld.x86";

case "testworld": case "testworld":
return "Mosa.TestWorld.x86"; return "Mosa.TestWorld.x86";

case "unittests": case "unittests":
return "Mosa.UnitTests.x86"; return "Mosa.UnitTests.x86";
} }
Expand All @@ -538,5 +557,4 @@ public string ExpandKernelBinPath(string name)
return name; return name;
} }
} }

} }
2 changes: 1 addition & 1 deletion Source/Mosa.Tool.Mosactl/Help/usage.txt
Expand Up @@ -5,7 +5,7 @@
possible name: helloworld, coolworld, testworld. possible name: helloworld, coolworld, testworld.
(Name can also be a path to a project. This feature is in development.) (Name can also be a path to a project. This feature is in development.)


if actions is ommited, it's always "build" if actions is omitted, it's always "build"


# builds the compiler tools. Rebuild is only required if compiler source has been changed. # builds the compiler tools. Rebuild is only required if compiler source has been changed.
tools build tools build
Expand Down
13 changes: 0 additions & 13 deletions Source/Mosa.Tool.Mosactl/Options.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Source/Mosa.Tool.Mosactl/readme.md
@@ -1,3 +1,3 @@
Try to avoid references to other Dependencies, because loaded assemblies are locked on windows. Try to avoid references to other Dependencies, because loaded assemblies are locked on windows.
If dependencies are required, try to access them as late as possible, to make rebuilds possible. If dependencies are required, try to access them as late as possible, to make rebuilds possible.
Another solution would be to have an seperate assembly and load them via reflection. Another solution would be to have an separate assembly and load them via reflection.
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -33,7 +33,7 @@ for:
after_build: after_build:
- cmd: ISCC.exe Source/Inno-Setup-Script/Mosa-Installer.iss - cmd: ISCC.exe Source/Inno-Setup-Script/Mosa-Installer.iss
- ps: ./mosactl.ps1 unittest - ps: ./mosactl.ps1 unittest
- ps: ./mosactl.ps1 test # - ps: ./mosactl.ps1 test


build_script: build_script:


Expand Down

0 comments on commit 69ae4d0

Please sign in to comment.