forked from CosmosOS/Cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
159 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ | |
*.vsp | ||
*.pdb | ||
*.lock.json | ||
*.nuget.props | ||
*.nuget.targets | ||
Thumbs.db | ||
build.force | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version: 0.20150918.{build} | ||
image: Visual Studio 2017 | ||
configuration: Debug | ||
platform: AnyCPU | ||
shallow_clone: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Cosmos.IL2CPU | ||
{ | ||
public class Program | ||
{ | ||
public const string CosmosRoot = ""; | ||
private const string KernelFile = CosmosRoot + ""; | ||
private const string OutputFile = CosmosRoot + ""; | ||
private static Dictionary<string, string> CmdOptions = new Dictionary<string, string>(); | ||
private static List<string> References = new List<string>(); | ||
private static List<string> AdditionalReferences = new List<string>(); | ||
private static List<string> AdditionalSearchDirs = new List<string>(); | ||
|
||
public static int Run(string[] args, Action<string> logMessage, Action<string> logError) | ||
{ | ||
if (args == null) | ||
{ | ||
throw new ArgumentNullException("args"); | ||
} | ||
if (logMessage == null) | ||
{ | ||
throw new ArgumentNullException("logMessage"); | ||
} | ||
if (logError == null) | ||
{ | ||
throw new ArgumentNullException("logError"); | ||
} | ||
|
||
try | ||
{ | ||
var tmp = ""; | ||
foreach (var s in args) | ||
{ | ||
tmp += s; | ||
string[] s1 = s.Split(':'); | ||
string argID = s1[0].ToLower(); | ||
if (argID == "References".ToLower()) | ||
{ | ||
References.Add(s.Replace(s1[0] + ":", "")); | ||
} | ||
else if (argID == "AdditionalReferences".ToLower()) | ||
{ | ||
AdditionalReferences.Add(s.Replace(s1[0] + ":", "")); | ||
} | ||
else if (argID == "AdditionalSearchDirs".ToLower()) | ||
{ | ||
AdditionalSearchDirs.Add(s.Replace(s1[0] + ":", "")); | ||
} | ||
else | ||
{ | ||
CmdOptions.Add(argID, s.Replace(s1[0] + ":", "")); | ||
} | ||
} | ||
|
||
var xTask = new CompilerEngine(); | ||
xTask.DebugEnabled = Convert.ToBoolean(CmdOptions["DebugEnabled".ToLower()]); | ||
logMessage("Loaded : DebugEnabled"); | ||
xTask.StackCorruptionDetectionEnabled = Convert.ToBoolean(CmdOptions["StackCorruptionDetectionEnabled".ToLower()]); | ||
logMessage("Loaded : StackCorruptionDetectionEnabled"); | ||
xTask.DebugMode = CmdOptions["DebugMode".ToLower()]; | ||
logMessage("Loaded : DebugMode"); | ||
xTask.StackCorruptionDetectionLevel = CmdOptions["StackCorruptionDetectionLevel".ToLower()]; | ||
logMessage("Loaded : StackCorruptionDetectionLevel"); | ||
xTask.TraceAssemblies = CmdOptions["TraceAssemblies".ToLower()]; | ||
logMessage("Loaded : TraceAssemblies"); | ||
xTask.DebugCom = Convert.ToByte(CmdOptions["DebugCom".ToLower()]); | ||
logMessage("Loaded : DebugCom"); | ||
xTask.UseNAsm = Convert.ToBoolean(CmdOptions["UseNAsm".ToLower()]); | ||
logMessage("Loaded : UseNAsm"); | ||
xTask.OutputFilename = CmdOptions["OutputFilename".ToLower()]; | ||
logMessage("Loaded : OutputFilename"); | ||
xTask.EnableLogging = Convert.ToBoolean(CmdOptions["EnableLogging".ToLower()]); | ||
logMessage("Loaded : EnableLogging"); | ||
xTask.EmitDebugSymbols = Convert.ToBoolean(CmdOptions["EmitDebugSymbols".ToLower()]); | ||
logMessage("Loaded : EmitDebugSymbols"); | ||
xTask.IgnoreDebugStubAttribute = Convert.ToBoolean(CmdOptions["IgnoreDebugStubAttribute".ToLower()]); | ||
logMessage("Loaded : IgnoreDebugStubAttribute"); | ||
xTask.References = References.ToArray(); | ||
logMessage("Loaded : References"); | ||
xTask.AdditionalSearchDirs = AdditionalSearchDirs.ToArray(); | ||
logMessage("Loaded : AdditionalSearchDirs"); | ||
xTask.AdditionalReferences = AdditionalReferences.ToArray(); | ||
logMessage("Loaded : AdditionalReferences"); | ||
|
||
xTask.OnLogError = logError; | ||
xTask.OnLogWarning = m => logMessage(String.Format("Warning: {0}", m)); | ||
xTask.OnLogMessage = logMessage; | ||
xTask.OnLogException = (m) => logError(String.Format("Exception: {0}", m.ToString())); | ||
xTask.AssemblerLog = "Cosmos.Assembler.log"; | ||
if (xTask.Execute()) | ||
{ | ||
logMessage("Executed OK"); | ||
// File.WriteAllText(@"e:\compiler.log", "OK"); | ||
return 0; | ||
} | ||
else | ||
{ | ||
logMessage("Errorred"); | ||
// File.WriteAllText(@"e:\compiler.log", "Errored"); | ||
return 2; | ||
} | ||
} | ||
catch (Exception E) | ||
{ | ||
logError(String.Format("Error occurred: " + E.ToString())); | ||
return 1; | ||
} | ||
} | ||
} | ||
} |
18 changes: 0 additions & 18 deletions
18
source/Cosmos.VS.DebugEngine/Cosmos.VS.DebugEngine.nuget.props
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
source/Cosmos.VS.DebugEngine/Cosmos.VS.DebugEngine.nuget.targets
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
source/Cosmos.VS.ProjectSystem/Cosmos.VS.ProjectSystem.nuget.props
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
source/Cosmos.VS.ProjectSystem/Cosmos.VS.ProjectSystem.nuget.targets
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.