-
Notifications
You must be signed in to change notification settings - Fork 17
Added F# Support to BepInEx.PluginInfoProps #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,10 +1,14 @@ | ||||||
| <Project> | ||||||
| <Target Name="AddGeneratedFile" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)GeneratedFile.cs"> | ||||||
| <PropertyGroup> | ||||||
| <FileExtension Condition="$(MSBuildProjectExtension) == '.fsproj'">fs</FileExtension> | ||||||
| <FileExtension Condition="$(MSBuildProjectExtension) == '.csproj'">cs</FileExtension> | ||||||
| </PropertyGroup> | ||||||
| <Target Name="AddGeneratedFile" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)GeneratedFile.$(FileExtension)"> | ||||||
|
||||||
| <Target Name="AddGeneratedFile" BeforeTargets="BeforeCompile;CoreCompile" Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)GeneratedFile.$(FileExtension)"> | |
| <Target Name="AddGeneratedFile" BeforeTargets="BeforeCompile;CoreCompile" Condition=" '$(FileExtension)' == 'cs' Or '$(FileExtension)' == 'fs' " Inputs="$(MSBuildAllProjects)" Outputs="$(IntermediateOutputPath)GeneratedFile.$(FileExtension)"> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -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. | ||||||
|
Comment on lines
+3
to
+5
|
||||||
|
|
||||||
| ## Basic usage | ||||||
|
|
||||||
| Define the following properties in your `csproj`: | ||||||
| Define the following properties in your project file: | ||||||
|
|
||||||
| ```xml | ||||||
| <AssemblyName>Example.Plugin</AssemblyName> | ||||||
|
|
@@ -14,13 +16,23 @@ Define the following properties in your `csproj`: | |||||
|
|
||||||
| this will generate the following class: | ||||||
|
||||||
| this will generate the following class: | |
| this will generate the following code: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The target
Outputspath ($(IntermediateOutputPath)GeneratedFile.$(FileExtension)) doesn’t match the file actually written/included ($(IntermediateOutputPath)MyPluginInfo.$(FileExtension)). This prevents incremental build from correctly skipping the target and can cause it to run every build. AlignOutputswith the real generated file path (or updateGeneratedFilePathto match).