Added Launch target.

This commit is contained in:
José Pedro 2018-05-22 20:24:14 +01:00
parent 13b4b8e755
commit 7411694499
No known key found for this signature in database
GPG key ID: B8247B9301707B83
4 changed files with 57 additions and 3 deletions

View file

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net471</TargetFramework>
<RuntimeIdentifier>win7-x86</RuntimeIdentifier>
<RuntimeIdentifier>win</RuntimeIdentifier>
<PackageId>Cosmos.Build</PackageId>
<PackageDescription>Cosmos build system.
$(CosmosDescription)</PackageDescription>
@ -10,24 +10,27 @@ $(CosmosDescription)</PackageDescription>
</PropertyGroup>
<ItemGroup>
<Content Include="runtime.json" Pack="True" PackagePath="\" />
<Content Include="build\**" Pack="True" PackagePath="build\" />
<Content Include="tools\**" Pack="True" PackagePath="tools\" />
<Content Include="runtime.json" Pack="True" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Framework" Version="15.5.180" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.5.180" PrivateAssets="All" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="1.1.7" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(IL2CPURepoRoot)source\IL2CPU.Debug.Symbols\IL2CPU.Debug.Symbols.csproj" PrivateAssets="All" />
<ProjectReference Include="..\Cosmos.Debug.Hosts\Cosmos.Debug.Hosts.csproj" PrivateAssets="All" />
</ItemGroup>
<Target Name="IncludeDependencies" BeforeTargets="_GetPackageFiles" DependsOnTargets="PrepareForPublish;ComputeFilesToPublish">
<ItemGroup>
<Content Include="@(ResolvedAssembliesToPublish)" Pack="True" PackagePath="tools\" Condition="!$([System.String]::new('%(Filename)').StartsWith('Microsoft.Build'))" />
<Content Include="@(ResolvedAssembliesToPublish)" Pack="True" PackagePath="tools\%(ResolvedAssembliesToPublish.DestinationSubPath)" Condition="!$([System.String]::new('%(Filename)').StartsWith('Microsoft.Build'))" />
<Content Pack="True" PackagePath="tools\%(Content.Link)" Condition="'%(Filename)' == 'e_sqlite3'" />
</ItemGroup>
</Target>

View file

@ -0,0 +1,35 @@
using System.Collections.Generic;
using System.IO;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
using Cosmos.Build.Common;
using Cosmos.Debug.Hosts;
namespace Cosmos.Build.Tasks
{
public class Launch : Task
{
[Required]
public string ConfigurationFile { get; set; }
[Required]
public string IsoFile { get; set; }
public override bool Execute()
{
var xParams = new Dictionary<string, string>()
{
["ISOFile"] = IsoFile,
[BuildPropertyNames.EnableBochsDebugString] = "False",
[BuildPropertyNames.StartBochsDebugGui] = "False",
["VisualStudioDebugPort"] = @"Pipe: Cosmos\Serial"
};
var xBochs = new Bochs(xParams, false, new FileInfo(ConfigurationFile));
xBochs.Start();
return true;
}
}
}

View file

@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<RunCommand>dotnet</RunCommand>
<RunArguments>msbuild /t:Launch</RunArguments>
</PropertyGroup>
</Project>

View file

@ -81,6 +81,7 @@
<UsingTask TaskName="Cosmos.Build.Tasks.CreateSyslinuxConfig" AssemblyFile="$(CosmosBuildTasksAssembly)" />
<UsingTask TaskName="Cosmos.Build.Tasks.ExtractMapFromElfFile" AssemblyFile="$(CosmosBuildTasksAssembly)" />
<UsingTask TaskName="Cosmos.Build.Tasks.IL2CPU" AssemblyFile="$(CosmosBuildTasksAssembly)" />
<UsingTask TaskName="Cosmos.Build.Tasks.Launch" AssemblyFile="$(CosmosBuildTasksAssembly)" />
<UsingTask TaskName="Cosmos.Build.Tasks.Ld" AssemblyFile="$(CosmosBuildTasksAssembly)" />
<UsingTask TaskName="Cosmos.Build.Tasks.MakeIso" AssemblyFile="$(CosmosBuildTasksAssembly)" />
<UsingTask TaskName="Cosmos.Build.Tasks.Nasm" AssemblyFile="$(CosmosBuildTasksAssembly)" />
@ -350,6 +351,13 @@
</Target>
<Target Name="Launch">
<Launch ConfigurationFile="$(OutputPath)Bochs.bxrc"
IsoFile="$(MSBuildProjectDirectory)\$(IsoFile)" />
</Target>
<PropertyGroup>
<CosmosDesignTimeTargetsPath Condition="'$(CosmosDesignTimeTargetsPath)'==''">$(MSBuildExtensionsPath)\Cosmos\Cosmos.DesignTime.targets</CosmosDesignTimeTargetsPath>
</PropertyGroup>