Rename Namespace to Application, remove DotNetTemplate

This commit is contained in:
Chris Cheetham 2021-06-25 13:04:02 -04:00
Родитель 0d8c02dd11
Коммит 922c0c3493
5 изменённых файлов: 24 добавлений и 47 удалений

Просмотреть файл

@ -65,11 +65,10 @@ namespace Steeltoe.InitializrApi.Controllers
var normalizedSpec = new ProjectSpec()
{
Name = spec.Name ?? defaults?.Name?.Default,
Application = spec.Application ?? defaults?.Namespace?.Default,
Description = spec.Description ?? defaults?.Description?.Default,
Namespace = spec.Namespace ?? defaults?.Namespace?.Default,
SteeltoeVersion = spec.SteeltoeVersion ?? defaults?.SteeltoeVersion?.Default,
DotNetFramework = spec.DotNetFramework ?? defaults?.DotNetFramework?.Default,
DotNetTemplate = spec.DotNetTemplate ?? defaults?.DotNetTemplate?.Default,
Language = spec.Language ?? defaults?.Language?.Default,
Packaging = spec.Packaging ?? defaults?.Packaging?.Default,
Dependencies = spec.Dependencies ?? defaults?.Dependencies?.Default,

Просмотреть файл

@ -46,9 +46,10 @@ namespace Steeltoe.InitializrApi.Generators
.Append('&')
.Append("options=")
.Append("no-restore")
.Append(",output=").Append(spec.Name)
.Append(",description=").Append(spec.Description)
.Append(",steeltoe=").Append(spec.SteeltoeVersion)
.Append(",framework=").Append(spec.DotNetFramework)
.Append(",output=").Append(spec.Name);
.Append(",framework=").Append(spec.DotNetFramework);
if (spec.Dependencies is not null)
{
foreach (var dependency in spec.Dependencies.Split(','))

Просмотреть файл

@ -26,9 +26,9 @@ namespace Steeltoe.InitializrApi.Models
public string Description { get; set; }
/// <summary>
/// Gets or sets the project namespace.
/// Gets or sets the project application.
/// </summary>
public string Namespace { get; set; }
public string Application { get; set; }
/// <summary>
/// Gets or sets the Steeltoe version.
@ -40,11 +40,6 @@ namespace Steeltoe.InitializrApi.Models
/// </summary>
public string DotNetFramework { get; set; }
/// <summary>
/// Gets or sets the DotNet template ID.
/// </summary>
public string DotNetTemplate { get; set; }
/// <summary>
/// Gets or sets the programming language ID.
/// </summary>
@ -75,45 +70,39 @@ namespace Steeltoe.InitializrApi.Models
delim = ",";
}
if (Description != null)
if (Application != null)
{
buf.Append(delim).Append("description=").Append(Description);
buf.Append(delim).Append("app=").Append(Application);
delim = ",";
}
if (Namespace != null)
if (Description != null)
{
buf.Append(delim).Append("namespace=").Append(Namespace);
buf.Append(delim).Append("desc=").Append(Description);
delim = ",";
}
if (SteeltoeVersion != null)
{
buf.Append(delim).Append("steeltoeVersion=").Append(SteeltoeVersion);
buf.Append(delim).Append("steeltoe=").Append(SteeltoeVersion);
delim = ",";
}
if (DotNetFramework != null)
{
buf.Append(delim).Append("dotNetFramework=").Append(DotNetFramework);
delim = ",";
}
if (DotNetTemplate != null)
{
buf.Append(delim).Append("dotNetTemplate=").Append(DotNetTemplate);
buf.Append(delim).Append("framework=").Append(DotNetFramework);
delim = ",";
}
if (Language != null)
{
buf.Append(delim).Append("language=").Append(Language);
buf.Append(delim).Append("lang=").Append(Language);
delim = ",";
}
if (Packaging != null)
{
buf.Append(delim).Append("packaging=").Append(Packaging);
buf.Append(delim).Append("pkg=").Append(Packaging);
}
if (Dependencies != null)

Просмотреть файл

@ -228,14 +228,12 @@ namespace Steeltoe.InitializrApi.Test.Unit.Controllers
buffer.Append(newline);
buffer.Append("description=").Append(spec.Description ?? "<na>" );
buffer.Append(newline);
buffer.Append("namespace=").Append(spec.Namespace ?? "<na>" );
buffer.Append("namespace=").Append(spec.Application ?? "<na>" );
buffer.Append(newline);
buffer.Append("steeltoe version=").Append(spec.SteeltoeVersion ?? "<na>" );
buffer.Append(newline);
buffer.Append("dotnet framework=").Append(spec.DotNetFramework ?? "<na>" );
buffer.Append(newline);
buffer.Append("dotnet template=").Append(spec.DotNetTemplate ?? "<na>" );
buffer.Append(newline);
buffer.Append("language=").Append(spec.Language ?? "<na>" );
buffer.Append(newline);
buffer.Append("packaging=").Append(spec.Packaging ?? "<na>" );

Просмотреть файл

@ -25,10 +25,9 @@ namespace Steeltoe.InitializrApi.Test.Unit.Models
// Assert
spec.Name.Should().BeNull();
spec.Description.Should().BeNull();
spec.Namespace.Should().BeNull();
spec.Application.Should().BeNull();
spec.SteeltoeVersion.Should().BeNull();
spec.DotNetFramework.Should().BeNull();
spec.DotNetTemplate.Should().BeNull();
spec.Language.Should().BeNull();
spec.Packaging.Should().BeNull();
}
@ -64,7 +63,7 @@ namespace Steeltoe.InitializrApi.Test.Unit.Models
s = spec.ToString();
// Assert
s.Should().Be("[packaging=mypackaging]");
s.Should().Be("[pkg=mypackaging]");
// Arrange
spec.Language = "mylanguage";
@ -73,16 +72,7 @@ namespace Steeltoe.InitializrApi.Test.Unit.Models
s = spec.ToString();
// Assert
s.Should().Be("[language=mylanguage,packaging=mypackaging]");
// Arrange
spec.DotNetTemplate = "mytemplate";
// Act
s = spec.ToString();
// Assert
s.Should().Be("[dotNetTemplate=mytemplate,language=mylanguage,packaging=mypackaging]");
s.Should().Be("[lang=mylanguage,pkg=mypackaging]");
// Arrange
spec.DotNetFramework = "myframework";
@ -92,7 +82,7 @@ namespace Steeltoe.InitializrApi.Test.Unit.Models
// Assert
s.Should().Be(
"[dotNetFramework=myframework,dotNetTemplate=mytemplate,language=mylanguage,packaging=mypackaging]");
"[framework=myframework,lang=mylanguage,pkg=mypackaging]");
// Arrange
spec.SteeltoeVersion = "mysteeltoeversion";
@ -102,17 +92,17 @@ namespace Steeltoe.InitializrApi.Test.Unit.Models
// Assert
s.Should().Be(
"[steeltoeVersion=mysteeltoeversion,dotNetFramework=myframework,dotNetTemplate=mytemplate,language=mylanguage,packaging=mypackaging]");
"[steeltoe=mysteeltoeversion,framework=myframework,lang=mylanguage,pkg=mypackaging]");
// Arrange
spec.Namespace = "mynamespace";
spec.Application = "myapp";
// Act
s = spec.ToString();
// Assert
s.Should().Be(
"[namespace=mynamespace,steeltoeVersion=mysteeltoeversion,dotNetFramework=myframework,dotNetTemplate=mytemplate,language=mylanguage,packaging=mypackaging]");
"[app=myapp,steeltoe=mysteeltoeversion,framework=myframework,lang=mylanguage,pkg=mypackaging]");
// Arrange
spec.Description = "mydesc";
@ -122,7 +112,7 @@ namespace Steeltoe.InitializrApi.Test.Unit.Models
// Assert
s.Should().Be(
"[description=mydesc,namespace=mynamespace,steeltoeVersion=mysteeltoeversion,dotNetFramework=myframework,dotNetTemplate=mytemplate,language=mylanguage,packaging=mypackaging]");
"[app=myapp,desc=mydesc,steeltoe=mysteeltoeversion,framework=myframework,lang=mylanguage,pkg=mypackaging]");
// Arrange
spec.Name = "myname";
@ -132,7 +122,7 @@ namespace Steeltoe.InitializrApi.Test.Unit.Models
// Assert
s.Should().Be(
"[name=myname,description=mydesc,namespace=mynamespace,steeltoeVersion=mysteeltoeversion,dotNetFramework=myframework,dotNetTemplate=mytemplate,language=mylanguage,packaging=mypackaging]");
"[name=myname,app=myapp,desc=mydesc,steeltoe=mysteeltoeversion,framework=myframework,lang=mylanguage,pkg=mypackaging]");
}
/* ----------------------------------------------------------------- *