Browse Source
Merge pull request #19474 from abpframework/issue-17263
CLI: Fix change theme step for basic theme.
pull/19476/head
Gizem Mutu Kurt
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
28 additions and
1 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/ChangeThemeStep.cs
|
|
|
@ -556,7 +556,7 @@ public class ChangeThemeStep : ProjectBuildPipelineStep |
|
|
|
{ |
|
|
|
if (!lines[i].Contains(oldKeyword)) |
|
|
|
{ |
|
|
|
continue;; |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
lines[i] = lines[i].Replace(oldKeyword, newKeyword); |
|
|
|
@ -565,6 +565,26 @@ public class ChangeThemeStep : ProjectBuildPipelineStep |
|
|
|
file.SetLines(lines); |
|
|
|
} |
|
|
|
|
|
|
|
private static void AddNamespaces(ProjectBuildContext context, string targetModuleFilePath, params string[] namespaces) |
|
|
|
{ |
|
|
|
var file = context.Files.FirstOrDefault(x => x.Name.Contains(targetModuleFilePath)); |
|
|
|
if (file == null) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
file.NormalizeLineEndings(); |
|
|
|
|
|
|
|
var lines = file.GetLines().ToList(); |
|
|
|
|
|
|
|
foreach (var @namespace in namespaces) |
|
|
|
{ |
|
|
|
lines.AddFirst(@namespace); |
|
|
|
} |
|
|
|
|
|
|
|
file.SetLines(lines); |
|
|
|
} |
|
|
|
|
|
|
|
private static void ChangeThemeToBasicForMvcProjects(ProjectBuildContext context, string defaultThemeName) |
|
|
|
{ |
|
|
|
var projectNames = new[] |
|
|
|
@ -601,6 +621,13 @@ public class ChangeThemeStep : ProjectBuildPipelineStep |
|
|
|
defaultThemeName, |
|
|
|
Basic |
|
|
|
); |
|
|
|
|
|
|
|
AddNamespaces( |
|
|
|
context, |
|
|
|
moduleFile.Name, |
|
|
|
"using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic;", |
|
|
|
"using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling;" |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|