Add Microsoft.Build
This commit is contained in:
parent
e3d4478a1e
commit
0570c15c38
6 changed files with 83 additions and 0 deletions
11
src/Nyanbyte.Minime/Minime.cs
Normal file
11
src/Nyanbyte.Minime/Minime.cs
Normal file
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Nyanbyte.Minime;
|
||||
|
||||
public class Minime
|
||||
{
|
||||
|
||||
}
|
12
src/Nyanbyte.Minime/MinimeBuildTask.cs
Normal file
12
src/Nyanbyte.Minime/MinimeBuildTask.cs
Normal 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;
|
||||
}
|
||||
}
|
|
@ -1,9 +1,21 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<UsingTask TaskName="Nyanbyte.Minime.MinimeBuildTask"
|
||||
AssemblyFile="./bin/Debug/net7.0/Nyanbyte.Minime.dll" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</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>
|
||||
|
|
22
src/Nyanbyte.Minime/Processing/CssProcessor.cs
Normal file
22
src/Nyanbyte.Minime/Processing/CssProcessor.cs
Normal 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;
|
||||
}
|
||||
}
|
15
src/Nyanbyte.Minime/Processing/FileContext.cs
Normal file
15
src/Nyanbyte.Minime/Processing/FileContext.cs
Normal 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!;
|
||||
}
|
11
src/Nyanbyte.Minime/Processing/IProcessor.cs
Normal file
11
src/Nyanbyte.Minime/Processing/IProcessor.cs
Normal 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);
|
||||
}
|
Loading…
Reference in a new issue