diff --git a/BepInEx.PluginInfoProps/BepInEx.PluginInfoProps.props b/BepInEx.PluginInfoProps/BepInEx.PluginInfoProps.props index 4b38215..9e1da17 100644 --- a/BepInEx.PluginInfoProps/BepInEx.PluginInfoProps.props +++ b/BepInEx.PluginInfoProps/BepInEx.PluginInfoProps.props @@ -1,10 +1,14 @@ - + + fs + cs + + $(AssemblyName) $(Product) $(Version) - - $(IntermediateOutputPath)MyPluginInfo.cs + ] + let PLUGIN_GUID: string = "$(BepInExPluginGuid)" + [] + let PLUGIN_NAME: string = "$(BepInExPluginName)" + [] + let PLUGIN_VERSION: string = "$(BepInExPluginVersion)" + ]]> + $(IntermediateOutputPath)MyPluginInfo.$(FileExtension) + + + + diff --git a/BepInEx.PluginInfoProps/README.md b/BepInEx.PluginInfoProps/README.md index 4603352..b29472b 100644 --- a/BepInEx.PluginInfoProps/README.md +++ b/BepInEx.PluginInfoProps/README.md @@ -1,10 +1,12 @@ ## BepInEx PluginInfo generator -Generates `MyPluginInfo.cs` based on csproj tags. +Generates a `MyPluginInfo.cs`, or `.fs`, based on project tags. + +Supports C# & F# projects, and will read the `.csproj` or `.fsproj` to determine values. ## Basic usage -Define the following properties in your `csproj`: +Define the following properties in your project file: ```xml Example.Plugin @@ -14,9 +16,8 @@ Define the following properties in your `csproj`: this will generate the following class: +**C#** ```cs -using System; - internal static class MyPluginInfo { public const string PLUGIN_GUID = "Example.Plugin"; @@ -24,3 +25,14 @@ internal static class MyPluginInfo public const string PLUGIN_VERSION = "1.0.0"; } ``` + +**F#** +```fsharp +module internal MyPluginInfo = + [] + let PLUGIN_GUID: string = "Example.Plugin" + [] + let PLUGIN_NAME: string = "My first plugin" + [] + let PLUGIN_VERSION: string = "1.0.0" +``` \ No newline at end of file