Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
shell: bash

- name: compile
run: ./build.sh compile
run: ./build.sh compile-project --project src/EventSourcingTests/EventSourcingTests.csproj
shell: bash

- name: test-event-sourcing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
# shell: bash

- name: compile
run: ./build.sh compile
run: ./build.sh compile-project --project src/EventSourcingTests/EventSourcingTests.csproj
shell: bash

- name: test-event-sourcing
Expand Down
4 changes: 4 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"Benchmarks",
"ClearInlineSamples",
"Compile",
"CompileProject",
"Connection",
"CreateFreightShippingTutorialZip",
"Detach",
Expand Down Expand Up @@ -150,6 +151,9 @@
"Profile": {
"type": "string"
},
"Project": {
"type": "string"
},
"Solution": {
"type": "string",
"description": "Path to a solution file that is automatically loaded"
Expand Down
23 changes: 23 additions & 0 deletions build/build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Build : NukeBuild
[Parameter]readonly string Framework;
[Parameter] readonly string Profile;
[Parameter] readonly string ConnectionString ="Host=localhost;Port=5432;Database=marten_testing;Username=postgres;password=postgres";
[Parameter] readonly string Project;

Target Test => _ => _
.DependsOn(TestBaseLib)
Expand Down Expand Up @@ -76,6 +77,28 @@ class Build : NukeBuild
.SetProjectFile(Solution));
});

Target CompileProject => _ => _
.DependsOn(Init)
.Executes(() =>
{
if (string.IsNullOrEmpty(Project))
{
Log.Error("Project parameter is required. Usage: --project <path-to-project>");
throw new ArgumentException("Project parameter must be specified");
}

Log.Information($"Restoring project: {Project}");
DotNetRestore(s => s
.SetProjectFile(Project));

Log.Information($"Compiling project: {Project}");
DotNetBuild(s => s
.SetProjectFile(Project)
.SetConfiguration(Configuration)
.SetFramework(Framework)
.EnableNoRestore());
});


Target TestBaseLib => _ => _
.ProceedAfterFailure()
Expand Down
Loading