mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-22 13:58:47 +00:00
This commit is contained in:
parent
19083ce7aa
commit
b920bc7aff
6 changed files with 249 additions and 0 deletions
98
source2/Builder/BuildOSImage.cs
Normal file
98
source2/Builder/BuildOSImage.cs
Normal file
|
|
@ -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; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
67
source2/Builder/Cosmos.MSBuild.Tasks.csproj
Normal file
67
source2/Builder/Cosmos.MSBuild.Tasks.csproj
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{71E5DE71-F7C1-4B61-B5BE-4FD64682BDB0}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Cosmos.MSBuild.Tasks</RootNamespace>
|
||||
<AssemblyName>Cosmos.MSBuild.Tasks</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Cosmos.Compiler.Builder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Cosmos.Build.Windows\bin\Debug\Cosmos.Compiler.Builder.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Indy.IL2CPU, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\Indy.IL2CPU\bin\Debug\Indy.IL2CPU.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Build.Framework" />
|
||||
<Reference Include="Microsoft.Build.Utilities" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BuildOSImage.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
10
source2/Builder/Cosmos.MSBuild.Tasks.csproj.vspscc
Normal file
10
source2/Builder/Cosmos.MSBuild.Tasks.csproj.vspscc
Normal file
|
|
@ -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"
|
||||
}
|
||||
28
source2/Builder/Cosmos.MSBuild.Tasks.sln
Normal file
28
source2/Builder/Cosmos.MSBuild.Tasks.sln
Normal file
|
|
@ -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
|
||||
10
source2/Builder/Cosmos.MSBuild.Tasks.vssscc
Normal file
10
source2/Builder/Cosmos.MSBuild.Tasks.vssscc
Normal file
|
|
@ -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"
|
||||
}
|
||||
36
source2/Builder/Properties/AssemblyInfo.cs
Normal file
36
source2/Builder/Properties/AssemblyInfo.cs
Normal file
|
|
@ -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")]
|
||||
Loading…
Reference in a new issue