mirror of
https://github.com/godotengine/godot.git
synced 2025-11-03 15:11:19 +00:00
Mono: Make sure the generated RootNamespace is a valid identifier
This commit is contained in:
parent
b69569415f
commit
5a4475fce3
3 changed files with 204 additions and 1 deletions
|
|
@ -140,6 +140,9 @@ namespace GodotSharpTools.Project
|
|||
|
||||
public static ProjectRootElement CreateLibraryProject(string name, out ProjectPropertyGroupElement mainGroup)
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
throw new ArgumentException($"{nameof(name)} cannot be empty", nameof(name));
|
||||
|
||||
var root = ProjectRootElement.Create();
|
||||
root.DefaultTargets = "Build";
|
||||
|
||||
|
|
@ -149,7 +152,7 @@ namespace GodotSharpTools.Project
|
|||
mainGroup.AddProperty("ProjectGuid", "{" + Guid.NewGuid().ToString().ToUpper() + "}");
|
||||
mainGroup.AddProperty("OutputType", "Library");
|
||||
mainGroup.AddProperty("OutputPath", Path.Combine("bin", "$(Configuration)"));
|
||||
mainGroup.AddProperty("RootNamespace", name);
|
||||
mainGroup.AddProperty("RootNamespace", IdentifierUtils.SanitizeQualifiedIdentifier(name, allowEmptyIdentifiers: true));
|
||||
mainGroup.AddProperty("AssemblyName", name);
|
||||
mainGroup.AddProperty("TargetFrameworkVersion", "v4.5");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue