Skip to content

Commit

Permalink
Move template to separate dir (#257)
Browse files Browse the repository at this point in the history
* moves template folder out of CPM folder

* version bump 0.16+
  • Loading branch information
PTKu authored Nov 21, 2023
1 parent 1f1bd51 commit 29de4aa
Show file tree
Hide file tree
Showing 92 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mode: ContinuousDeployment
next-version: 0.15.0
next-version: 0.16.0
branches:
main:
regex: ^master$|^main$
Expand Down
14 changes: 8 additions & 6 deletions cake/BuildContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class BuildContext : FrostingContext

public string ScrDir => Path.GetFullPath(Path.Combine(Environment.WorkingDirectory.FullPath, "..//src//"));

public string TemplatesDir => Path.GetFullPath(Path.Combine(Environment.WorkingDirectory.FullPath, "..//templates//"));

public Cake.Common.Tools.DotNet.Build.DotNetBuildSettings DotNetBuildSettings { get; }

public DotNetRestoreSettings DotNetRestoreTemplatesSettings { get; }
Expand Down Expand Up @@ -173,13 +175,13 @@ public void PushNugetPackages(string artifactDirectory)
{
var templates = new List<(string ax, string approject, string solution)>()
{
(Path.Combine(this.ScrDir, "AXSharp.templates\\working\\templates\\axsharpblazor\\ax\\"),
Path.Combine(this.ScrDir,"AXSharp.templates\\working\\templates\\axsharpblazor\\axsharpblazor.app\\axsharpblazor.hmi.csproj"),
Path.Combine(this.ScrDir,"AXSharp.templates\\working\\templates\\axsharpblazor\\axsharpblazor.sln")),
(Path.Combine(this.TemplatesDir, "working\\templates\\axsharpblazor\\ax\\"),
Path.Combine(this.TemplatesDir,"working\\templates\\axsharpblazor\\axsharpblazor.app\\axsharpblazor.hmi.csproj"),
Path.Combine(this.TemplatesDir,"working\\templates\\axsharpblazor\\axsharpblazor.sln")),

(Path.Combine(this.ScrDir, "AXSharp.templates\\working\\templates\\axsharpconsole\\ax"),
Path.Combine(this.ScrDir,"AXSharp.templates\\working\\templates\\axsharpconsole\\axsharpconsole\\axsharpconsole.app.csproj"),
Path.Combine(this.ScrDir,"AXSharp.templates\\working\\templates\\axsharpconsole\\axsharpconsole.sln"))
(Path.Combine(this.TemplatesDir, "working\\templates\\axsharpconsole\\ax"),
Path.Combine(this.TemplatesDir,"working\\templates\\axsharpconsole\\axsharpconsole\\axsharpconsole.app.csproj"),
Path.Combine(this.TemplatesDir,"working\\templates\\axsharpconsole\\axsharpconsole.sln"))

};

Expand Down
8 changes: 4 additions & 4 deletions cake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public override void Run(BuildContext context)
return;
}

var templatesDirectory = Path.Combine(context.ScrDir, "AXSharp.templates\\working\\templates");
var templatesDirectory = Path.Combine(context.TemplatesDir);
var templateCsProjFiles = Directory.EnumerateFiles(templatesDirectory, "*.csproj", SearchOption.AllDirectories);

foreach (var templateCsProjFile in templateCsProjFiles)
Expand Down Expand Up @@ -369,8 +369,8 @@ public override void Run(BuildContext context)

foreach (var template in context.GetTemplateProjects())
{
context.DotNetRestore(Path.Combine(context.ScrDir, template.solution), context.DotNetRestoreTemplatesSettings);
context.DotNetBuild(Path.Combine(context.ScrDir, template.solution), context.DotNetBuildSettings);
context.DotNetRestore(Path.Combine(context.TemplatesDir, template.solution), context.DotNetRestoreTemplatesSettings);
context.DotNetBuild(Path.Combine(context.TemplatesDir, template.solution), context.DotNetBuildSettings);
}
}
}
Expand Down Expand Up @@ -415,7 +415,7 @@ public override void Run(BuildContext context)
}

PackTemplatePackages(context,
Path.Combine(context.ScrDir, "AXSharp.templates\\working\\AXSharp.templates.sln"));
Path.Combine(context.TemplatesDir, "AXSharp.templates.sln"));
context.PushNugetPackages("templates");

context.CheckLicenseComplianceInArtifacts();
Expand Down
2 changes: 1 addition & 1 deletion publish-no-tests.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# run build

dotnet run --project cake/Build.csproj --do-pack --do-publish --test-level 1
dotnet run --project cake/Build.csproj --do-pack --do-publish --test-level 2
exit $LASTEXITCODE;
File renamed without changes.
File renamed without changes.

0 comments on commit 29de4aa

Please sign in to comment.