Skip to content

Commit

Permalink
Revert "Make Name and Version const and use them in the plugin attrib…
Browse files Browse the repository at this point in the history
…ute (#2)"

This reverts commit 979ff6b.
  • Loading branch information
js6pak authored Feb 20, 2024
1 parent 979ff6b commit 3280cdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions BepInEx.AutoPlugin/AutoPluginGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void Execute(GeneratorExecutionContext context)
var source = SourceText.From($@"// <auto-generated />
namespace {typeSymbol.ContainingNamespace.ToDisplayString()}
{{
[{attributeName}({typeSymbol.Name}.Id, {typeSymbol.Name}.Name, {typeSymbol.Name}.Version)]
[{attributeName}({typeSymbol.Name}.Id, ""{name}"", ""{version}"")]
public partial class {typeSymbol.Name}
{{
/// <summary>
Expand All @@ -133,12 +133,12 @@ public partial class {typeSymbol.Name}
/// <summary>
/// Gets the name of the <see cref=""{typeSymbol.Name}""/>.
/// </summary>
public const Name = ""{name}"";
public static string Name => ""{name}"";
/// <summary>
/// Gets the version of the <see cref=""{typeSymbol.Name}""/>.
/// </summary>
public const Version = ""{version}"";
public static string Version => ""{version}"";
}}
}}
", Encoding.UTF8);
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public partial class ExamplePlugin : BaseUnityPlugin
into

```cs
[BepInEx.BepInPlugin(ExamplePlugin.Id, ExamplePlugin.Name, ExamplePlugin.Version)]
[BepInEx.BepInPlugin(ExamplePlugin.Id, "ExamplePlugin", "0.1.0")]
public class ExamplePlugin : BaseUnityPlugin
{
public const string Id = "com.example.ExamplePlugin";
public const string Name = "ExamplePlugin";
public const string Version = "0.1.0";
public static string Name => "ExamplePlugin";
public static string Version => "0.1.0";
}
```

0 comments on commit 3280cdf

Please sign in to comment.