Merge pull request #716 from sbwalker/master

enhanced Module Creator to allow developer to specify framework reference version so that modules can target any version including the local development environment
This commit is contained in:
Shaun Walker 2020-08-29 11:30:53 -04:00 committed by GitHub
commit 98cd361fc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 79 additions and 51 deletions

View File

@ -42,6 +42,20 @@
</select>
</td>
</tr>
<tr>
<td>
<Label For="reference" HelpText="Select a framework reference version">Framework Reference: </Label>
</td>
<td>
<select id="reference" class="form-control" @bind="@_reference">
@foreach (string version in Constants.ReleaseVersions.Split(','))
{
<option value="@(version)">@(version)</option>
}
<option value="local">Local</option>
</select>
</td>
</tr>
@if (!string.IsNullOrEmpty(_location))
{
<tr>
@ -62,6 +76,7 @@
private string _module = string.Empty;
private string _description = string.Empty;
private string _template = "-";
public string _reference = Constants.Version;
private string _location = string.Empty;
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
@ -77,7 +92,7 @@
{
if (!string.IsNullOrEmpty(_owner) && !string.IsNullOrEmpty(_module) && _template != "-")
{
var moduleDefinition = new ModuleDefinition { Owner = _owner.Replace(" ", ""), Name = _module.Replace(" ", ""), Description = _description, Template = _template };
var moduleDefinition = new ModuleDefinition { Owner = _owner.Replace(" ", ""), Name = _module.Replace(" ", ""), Description = _description, Template = _template, Version = _reference };
await ModuleDefinitionService.CreateModuleDefinitionAsync(moduleDefinition, ModuleState.ModuleId);
}
else

View File

@ -240,7 +240,20 @@ namespace Oqtane.Controllers
text = text.Replace("[ServerManagerType]", moduleDefinition.ServerManagerType);
text = text.Replace("[Folder]", folderPath);
text = text.Replace("[File]", Path.GetFileName(filePath));
if (moduleDefinition.Version == "local")
{
text = text.Replace("[FrameworkVersion]", Constants.Version);
text = text.Replace("[ClientReference]", "<Reference Include=\"Oqtane.Client\"><HintPath>..\\..\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\netcoreapp3.1\\Oqtane.Client.dll</HintPath></Reference>");
text = text.Replace("[ServerReference]", "<Reference Include=\"Oqtane.Server\"><HintPath>..\\..\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\netcoreapp3.1\\Oqtane.Server.dll</HintPath></Reference>");
text = text.Replace("[SharedReference]", "<Reference Include=\"Oqtane.Shared\"><HintPath>..\\..\\oqtane.framework\\Oqtane.Server\\bin\\Debug\\netcoreapp3.1\\Oqtane.Shared.dll</HintPath></Reference>");
}
else
{
text = text.Replace("[FrameworkVersion]", moduleDefinition.Version);
text = text.Replace("[ClientReference]", "<PackageReference Include=\"Oqtane.Client\" Version=\"" + moduleDefinition.Version + "\" />");
text = text.Replace("[ServerReference]", "<PackageReference Include=\"Oqtane.Server\" Version=\"" + moduleDefinition.Version + "\" />");
text = text.Replace("[SharedReference]", "<PackageReference Include=\"Oqtane.Shared\" Version=\"" + moduleDefinition.Version + "\" />");
}
System.IO.File.WriteAllText(filePath, text);
}

View File

@ -25,8 +25,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Oqtane.Client" Version="1.0.3" />
<PackageReference Include="Oqtane.Shared" Version="1.0.3" />
[ClientReference]
[SharedReference]
</ItemGroup>
<PropertyGroup>

View File

@ -31,7 +31,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Oqtane.Server" Version="1.0.3" />
<PackageReference Include="Oqtane.Shared" Version="1.0.3" />
[ServerReference]
[SharedReference]
</ItemGroup>
</Project>

View File

@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Oqtane.Shared" Version="1.0.3" />
[SharedReference]
</ItemGroup>
</Project>

View File

@ -6,7 +6,7 @@ namespace Oqtane.Shared
{
public const string PackageId = "Oqtane.Framework";
public const string Version = "1.0.3";
public const string ReleaseVersions = "0.9.0,0.9.1,0.9.2,1.0.0,1.0.1,1.0.2,1.0.3";
public const string ReleaseVersions = "1.0.0,1.0.1,1.0.2,1.0.3";
public const string PageComponent = "Oqtane.UI.ThemeBuilder, Oqtane.Client";
public const string ContainerComponent = "Oqtane.UI.ContainerBuilder, Oqtane.Client";