diff --git a/source2/Builder/BuildOSImage.cs b/source2/Builder/BuildOSImage.cs new file mode 100644 index 000000000..95b1d3bca --- /dev/null +++ b/source2/Builder/BuildOSImage.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +//using Cosmos.Compiler.Builder; + +namespace Cosmos.MSBuild.Tasks +{ + public class BuildOSImage : Task + { + private Boolean buildFailed; + public override bool Execute() + { + buildFailed = false; + + this.KernelAssemblyFile = (new System.IO.FileInfo(this.KernelAssemblyFile)).FullName; + + System.Reflection.Assembly kernelAssembly; + //Indy.IL2CPU.DebugMode compileDebugMode; + var builtEvent = new System.Threading.AutoResetEvent(false); + //var builder = new Builder(); + + if (String.IsNullOrEmpty(this.BuildPath) == false) + { + this.BuildPath = (new System.IO.DirectoryInfo(this.BuildPath)).FullName; + //builder.BuildPath = this.BuildPath; + } + //builder.UseInternalAssembler = this.UseInternalAssembler; + + //compileDebugMode = Indy.IL2CPU.DebugMode.None; + if (String.IsNullOrEmpty(this.DebugMode) == false) + { + //if( Enum.IsDefined(typeof(Indy.IL2CPU.DebugMode), this.DebugMode) == true) + //{ + // compileDebugMode = (Indy.IL2CPU.DebugMode)Enum.Parse(typeof(Indy.IL2CPU.DebugMode), this.DebugMode, true); + //}else{ + // Log.LogWarning("Unknown Cosmos debug mode, defaulted to none."); + //} + } + + //builder.CompileCompleted += delegate { builtEvent.Set(); }; + //builder.LogMessage += delegate(Indy.IL2CPU.LogSeverityEnum aSeverity, string aMessage) + // { + // switch (aSeverity) + // { + // case Indy.IL2CPU.LogSeverityEnum.Informational: + // Log.LogMessage(aMessage); + // break; + // case Indy.IL2CPU.LogSeverityEnum.Warning: + // Log.LogWarning(aMessage); + // break; + // case Indy.IL2CPU.LogSeverityEnum.Error: + // Log.LogError(aMessage); + // this.buildFailed = true; + // break; + // } + + // }; + + //kernelAssembly = System.Reflection.Assembly.LoadFile(this.KernelAssemblyFile); + //builder.TargetAssembly = kernelAssembly; + + //builder.BeginCompile(compileDebugMode, this.DebugComPort, this.GDB); + //builtEvent.WaitOne(); + + //if (this.buildFailed == true) + //{ + // builder.Assemble(); + // builder.Link(); + // builder.MakeISO(); + //} + + return this.buildFailed; + } + + [Required] + public string KernelAssemblyFile + { get; set; } + + public string BuildPath + { get; set; } + + public Boolean UseInternalAssembler + { get; set; } + + public string DebugMode + { get; set; } + + public byte DebugComPort + { get; set; } + + public Boolean GDB + { get; set; } + + } + +} diff --git a/source2/Builder/Cosmos.MSBuild.Tasks.csproj b/source2/Builder/Cosmos.MSBuild.Tasks.csproj new file mode 100644 index 000000000..fe0e1c45c --- /dev/null +++ b/source2/Builder/Cosmos.MSBuild.Tasks.csproj @@ -0,0 +1,67 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {71E5DE71-F7C1-4B61-B5BE-4FD64682BDB0} + Library + Properties + Cosmos.MSBuild.Tasks + Cosmos.MSBuild.Tasks + v3.5 + 512 + SAK + SAK + SAK + SAK + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\Cosmos.Build.Windows\bin\Debug\Cosmos.Compiler.Builder.dll + + + False + ..\Indy.IL2CPU\bin\Debug\Indy.IL2CPU.dll + + + + + + 3.5 + + + + + + + + + + + \ No newline at end of file diff --git a/source2/Builder/Cosmos.MSBuild.Tasks.csproj.vspscc b/source2/Builder/Cosmos.MSBuild.Tasks.csproj.vspscc new file mode 100644 index 000000000..feffdecaa --- /dev/null +++ b/source2/Builder/Cosmos.MSBuild.Tasks.csproj.vspscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/source2/Builder/Cosmos.MSBuild.Tasks.sln b/source2/Builder/Cosmos.MSBuild.Tasks.sln new file mode 100644 index 000000000..6a2dd6aa5 --- /dev/null +++ b/source2/Builder/Cosmos.MSBuild.Tasks.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.MSBuild.Tasks", "Cosmos.MSBuild.Tasks.csproj", "{71E5DE71-F7C1-4B61-B5BE-4FD64682BDB0}" +EndProject +Global + GlobalSection(TeamFoundationVersionControl) = preSolution + SccNumberOfProjects = 2 + SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C} + SccTeamFoundationServer = https://tfs04.codeplex.com/ + SccLocalPath0 = . + SccProjectUniqueName1 = Cosmos.MSBuild.Tasks.csproj + SccLocalPath1 = . + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {71E5DE71-F7C1-4B61-B5BE-4FD64682BDB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71E5DE71-F7C1-4B61-B5BE-4FD64682BDB0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71E5DE71-F7C1-4B61-B5BE-4FD64682BDB0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71E5DE71-F7C1-4B61-B5BE-4FD64682BDB0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/source2/Builder/Cosmos.MSBuild.Tasks.vssscc b/source2/Builder/Cosmos.MSBuild.Tasks.vssscc new file mode 100644 index 000000000..794f014c9 --- /dev/null +++ b/source2/Builder/Cosmos.MSBuild.Tasks.vssscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT" +} diff --git a/source2/Builder/Properties/AssemblyInfo.cs b/source2/Builder/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..8e289d10c --- /dev/null +++ b/source2/Builder/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Cosmos.MSBuild.Tasks")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("Copyright © 2009")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("46d21fe8-2032-40b0-b969-5df94332e7e2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")]