Files
WoofWare.Whippet/WoofWare.Whippet.Core/Domain.fs
Patrick Stevens da609db2ce
Some checks are pending
.NET / build (Debug) (push) Waiting to run
.NET / build (Release) (push) Waiting to run
.NET / analyzers (push) Waiting to run
.NET / check-dotnet-format (push) Waiting to run
.NET / check-nix-format (push) Waiting to run
.NET / Check links (push) Waiting to run
.NET / Check flake (push) Waiting to run
.NET / nuget-pack (push) Waiting to run
.NET / expected-pack (push) Blocked by required conditions
.NET / check-accurate-generations (push) Waiting to run
.NET / all-required-checks-complete (push) Blocked by required conditions
.NET / nuget-publish (push) Blocked by required conditions
.NET / nuget-publish-fantomas (push) Blocked by required conditions
.NET / nuget-publish-json-plugin (push) Blocked by required conditions
.NET / nuget-publish-json-attrs (push) Blocked by required conditions
.NET / nuget-publish-argparser-plugin (push) Blocked by required conditions
.NET / nuget-publish-argparser-attrs (push) Blocked by required conditions
First release (#10)
2024-10-07 13:35:43 +01:00

33 lines
1.4 KiB
Forth

namespace WoofWare.Whippet.Core
open System.Collections.Generic
(*
These types should take no dependencies and should only change additively; otherwise consumers will break!
*)
/// When decorating a type, indicates that the type contains Whippet generators.
///
/// If you don't want to take a dependency on WoofWare.Whippet.Core, you can define your own attribute with this name,
/// and we'll detect it happily when running the plugin.
type WhippetGeneratorAttribute () =
inherit System.Attribute ()
/// The arguments we'll give you (a plugin) when we call you to generate some code from raw file input.
type RawSourceGenerationArgs =
{
/// Full path to the file, on disk, which you're taking as input.
FilePath : string
/// Contents of the file; you might want to `System.Text.Encoding.UTF8.GetString` this.
FileContents : byte[]
/// Extra parameters as supplied through the project file with <Whippet{ParamName}>{ParamValue}</Whippet{ParamName}>.
Parameters : IReadOnlyDictionary<string, string>
}
/// We provide this interface as a helper to give you compile-time safety, but you don't have to use it.
/// At runtime, we'll find any member with the right name and signature.
/// You must use `RawSourceGenerationArgs`, though!
type IGenerateRawFromRaw =
/// Return `null` to indicate "I don't want to do any updates".
abstract member GenerateRawFromRaw : RawSourceGenerationArgs -> string