Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move template to separate dir #257

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Loading