Skip to content

Commit 8b169cf

Browse files
author
vp
committed
refactor: update output directory configuration to use .artifacts
1 parent 11d95c8 commit 8b169cf

8 files changed

Lines changed: 19 additions & 22 deletions

File tree

.bdk/cli/.env

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
# ------------------------------------------------------------------------------
77
# Global Settings
88
# ------------------------------------------------------------------------------
9-
OUTPUT_DIRECTORY=.tmp
10-
11-
# Reserved for future extensibilities
12-
ARTIFACTS_DIRECTORY=.artifacts
9+
OUTPUT_DIRECTORY=.artifacts
1310

1411
DOCKER_FILE_PATH=src/Presentation.Web.Server/Dockerfile
1512
DOCKER_COMPOSE_PATH=docker-compose.yml

.bdk/cli/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,7 @@ Configuration loader for `.env` file.
204204
**Supported Settings:**
205205

206206
```bash
207-
OUTPUT_DIRECTORY=.tmp
208-
ARTIFACTS_DIRECTORY=.artifacts
207+
OUTPUT_DIRECTORY=.artifacts
209208
SOURCES_DIRECTORY=src
210209
MODULES_DIRECTORY=src/Modules
211210
TESTS_DIRECTORY=tests

.bdk/cli/bdk-cli.csx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var context = new TaskContext
5757
SolutionFile = dotnetCli.SolutionFile,
5858
SolutionPath = dotnetCli.SolutionFile,
5959
RootDir = repoRoot,
60-
OutputDir = config.OutputDirectory ?? ".tmp",
60+
OutputDir = config.OutputDirectory ?? ".artifacts",
6161
TraceNoView = Environment.GetEnvironmentVariable("TRACE_NO_VIEW") ?? "",
6262
AvailableModules = availableModules,
6363
SelectedModule = selectedModule

.bdk/cli/lib/BdkConfig.csx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ using Spectre.Console;
88
/// </summary>
99
public class BdkConfig
1010
{
11-
public string OutputDirectory { get; set; } = ".tmp";
12-
public string ArtifactsDirectory { get; set; } = ".artifacts";
11+
public string OutputDirectory { get; set; } = ".artifacts";
1312
public string SourcesDirectory { get; set; } = "src";
1413
public string ModulesDirectory { get; set; } = "src/Modules";
1514
public string TestsDirectory { get; set; } = "tests";
@@ -52,9 +51,6 @@ public class BdkConfig
5251
case "OUTPUT_DIRECTORY":
5352
config.OutputDirectory = value;
5453
break;
55-
case "ARTIFACTS_DIRECTORY":
56-
config.ArtifactsDirectory = value;
57-
break;
5854
case "SOURCES_DIRECTORY":
5955
config.SourcesDirectory = value;
6056
break;

.bdk/cli/lib/Diagnostics.csx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ public static class DiagnosticsUtils
504504
return new ExecutionResult { Success = false, ExitCode = 1, Duration = DateTime.Now - startTime };
505505
}
506506

507-
var outDir = Path.Combine(ctx.RootDir, ".tmp", "diagnostics");
507+
var outDir = Path.Combine(ctx.OutputDir, "diagnostics");
508508
Directory.CreateDirectory(outDir);
509509

510510
var errors = new List<string>();
@@ -662,7 +662,7 @@ public static class DiagnosticsUtils
662662
return;
663663

664664
var projectDir = Path.GetDirectoryName(benchmarkProjectPath) ?? "";
665-
var artifactsRoot = ctx.Config.ArtifactsDirectory ?? ".artifacts";
665+
var artifactsRoot = ctx.OutputDir;
666666
var artifactRoot = ResolveBenchmarkResultsDirectory(ctx, projectDir, artifactsRoot);
667667

668668
if (string.IsNullOrEmpty(artifactRoot))

.bdk/cli/lib/DotnetCli.csx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,9 @@ public class DotnetCli
432432
public async Task<ExecutionResult> EfScriptAsync(string moduleName, string dbContext, string outputPath = "")
433433
{
434434
var moduleLower = moduleName.ToLower();
435-
var output = string.IsNullOrEmpty(outputPath) ? $".tmp/ef/efscript_{moduleLower}.sql" : outputPath;
435+
var output = string.IsNullOrEmpty(outputPath)
436+
? Path.Combine(_config.OutputDirectory, "ef", $"efscript_{moduleLower}.sql")
437+
: outputPath;
436438
var infraProject = GetInfrastructureProjectPath(moduleName);
437439

438440
var outputDir = Path.GetDirectoryName(output);
@@ -455,7 +457,9 @@ public class DotnetCli
455457
public async Task<ExecutionResult> EfBundleAsync(string moduleName, string dbContext, string outputPath = "")
456458
{
457459
var moduleLower = moduleName.ToLower();
458-
var output = string.IsNullOrEmpty(outputPath) ? $".tmp/ef/efbundle_{moduleLower}.exe" : outputPath;
460+
var output = string.IsNullOrEmpty(outputPath)
461+
? Path.Combine(_config.OutputDirectory, "ef", $"efbundle_{moduleLower}.exe")
462+
: outputPath;
459463
var infraProject = GetInfrastructureProjectPath(moduleName);
460464

461465
var outputDir = Path.GetDirectoryName(output);

.bdk/cli/lib/TaskRegistry.csx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public static class TaskRegistry
160160
AnsiConsole.MarkupLine($"[dim]RID:[/] [cyan]{rid}[/]");
161161
AnsiConsole.MarkupLine($"[dim]Single-file:[/] [cyan]{singleFile.Value}[/]");
162162
var outputDir = Path.Combine(
163-
ctx.Config.ArtifactsDirectory ?? ".artifacts",
163+
ctx.OutputDir,
164164
"publish",
165165
"server",
166166
config.ToLowerInvariant(),
@@ -210,7 +210,7 @@ public static class TaskRegistry
210210
AnsiConsole.MarkupLine($"[dim]Single-file:[/] [cyan]{singleFile.Value}[/]");
211211
var projectName = Path.GetFileNameWithoutExtension(project);
212212
var outputDir = Path.Combine(
213-
ctx.Config.ArtifactsDirectory ?? ".artifacts",
213+
ctx.OutputDir,
214214
"publish",
215215
projectName,
216216
config.ToLowerInvariant(),
@@ -1022,7 +1022,7 @@ public static class TaskRegistry
10221022
if (string.IsNullOrEmpty(dbContext))
10231023
return new ExecutionResult { Success = false, ExitCode = 1, Duration = TimeSpan.Zero };
10241024

1025-
var defaultOutput = $".tmp/ef/efscript_{module.ToLower()}.sql";
1025+
var defaultOutput = $"{ctx.OutputDir}/ef/efscript_{module.ToLower()}.sql";
10261026
var outputPath = await Prompts.PromptTextAsync("Output path:", defaultOutput);
10271027
return await ctx.DotnetCli.EfScriptAsync(module, dbContext, outputPath);
10281028
}
@@ -1044,7 +1044,7 @@ public static class TaskRegistry
10441044
if (string.IsNullOrEmpty(dbContext))
10451045
return new ExecutionResult { Success = false, ExitCode = 1, Duration = TimeSpan.Zero };
10461046

1047-
var defaultOutput = $".tmp/ef/efbundle_{module.ToLower()}.exe";
1047+
var defaultOutput = $"{ctx.OutputDir}/ef/efbundle_{module.ToLower()}.exe";
10481048
var outputPath = await Prompts.PromptTextAsync("Output path:", defaultOutput);
10491049
return await ctx.DotnetCli.EfBundleAsync(module, dbContext, outputPath);
10501050
}

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,5 +415,6 @@ FodyWeavers.xsd
415415
/.tmp/
416416
/logs/
417417
/TestOutput/
418-
/.artifacts/**
419-
/coverage-report/**
418+
/coverage-report/**
419+
/.tmp/**
420+
/.artifacts/**

0 commit comments

Comments
 (0)