Add Microsoft.Build

This commit is contained in:
femsci 2023-09-07 23:49:48 +02:00
parent e3d4478a1e
commit 0570c15c38
Signed by: femsci
GPG key ID: 08F7911F0E650C67
6 changed files with 83 additions and 0 deletions

View file

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Nyanbyte.Minime;
public class Minime
{
}

View file

@ -0,0 +1,12 @@
using Microsoft.Build.Utilities;
namespace Nyanbyte.Minime;
public class MinimeBuildTask : Microsoft.Build.Utilities.Task
{
public override bool Execute()
{
Log.LogMessage("meow");
return true;
}
}

View file

@ -1,9 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<UsingTask TaskName="Nyanbyte.Minime.MinimeBuildTask"
AssemblyFile="./bin/Debug/net7.0/Nyanbyte.Minime.dll" />
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Framework" Version="17.7.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.7.2" PrivateAssets="all" />
</ItemGroup>
<Target Name="Minime" AfterTargets="Build">
<MinimeBuildTask />
</Target>
</Project> </Project>

View file

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Nyanbyte.Minime.Processing;
public class CssProcessor : IProcessor
{
internal const string
L_COMMENT_OPEN = "/*",
L_COMMENT_CLOSE = "*/",
L_STRING = "\"",
L_STRING_C = "'",
L_SEMI = ";";
public Task Execute(FileContext ctx)
{
return Task.CompletedTask;
}
}

View file

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Build.Framework;
namespace Nyanbyte.Minime.Processing;
public class FileContext
{
public required string Path { get; init; }
public required IBuildEngine BuildEngine { get; init; }
public string? OutputPath { get; set; }
public StreamReader Reader { get; internal set; } = null!;
}

View file

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Nyanbyte.Minime.Processing;
public interface IProcessor
{
public Task Execute(FileContext ctx);
}