From 647dafc00cefce62995aaf01c90631693c00430a Mon Sep 17 00:00:00 2001 From: wwwDayDream <13383838+wwwDayDream@users.noreply.github.com> Date: Sat, 31 Aug 2024 16:15:50 -0500 Subject: [PATCH 1/2] Added Language detection to PluginInfoProps and provided alternate .fs file for F# --- .../BepInEx.PluginInfoProps.props | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) 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) + + + + From 2128a2b56a6e92a8f9b5fa67cbd7666d89023c7f Mon Sep 17 00:00:00 2001 From: wwwDayDream <13383838+wwwDayDream@users.noreply.github.com> Date: Sat, 31 Aug 2024 16:42:00 -0500 Subject: [PATCH 2/2] Updated BepInEx.PluginInfoProps/README.md to encapsulate changes and new features. --- BepInEx.PluginInfoProps/README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) 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