Skip to content

Commit

Permalink
Upgrade to NUKE 7.0.2 (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma committed Jul 4, 2023
1 parent 5654b5f commit dc58113
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Build Schema",
"$ref": "#/definitions/build",
"title": "Build Schema",
"definitions": {
"build": {
"type": "object",
Expand Down Expand Up @@ -153,4 +153,4 @@
}
}
}
}
}
14 changes: 7 additions & 7 deletions build-support/nuke-build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ partial class Build : NukeBuild
readonly bool BuildEms = false;

[Parameter("Version")]
readonly string ProjectVersion = "3.0.1";
readonly string ProjectVersion = "3.0.2";

[Solution] readonly Solution Solution;
[GitRepository] readonly GitRepository GitRepository;
Expand Down Expand Up @@ -80,10 +80,10 @@ protected override void OnBuildInitialized()
.Before(Restore)
.Executes(() =>
{
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(DeleteDirectory);
EnsureCleanDirectory(ArtifactsDirectory);
EnsureCleanDirectory(BuildDirectory);
SourceDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory());
TestsDirectory.GlobDirectories("**/bin", "**/obj").ForEach(x => x.DeleteDirectory());
ArtifactsDirectory.CreateOrCleanDirectory();
BuildDirectory.CreateOrCleanDirectory();
});

Target Restore => _ => _
Expand Down Expand Up @@ -178,7 +178,7 @@ protected override void OnBuildInitialized()
.Executes(() =>
{
var binDirectory = RootDirectory / "bin";
EnsureCleanDirectory(binDirectory);
binDirectory.CreateOrCleanDirectory();
var moduleNames = new[]
{
Expand Down Expand Up @@ -219,7 +219,7 @@ protected override void OnBuildInitialized()

IEnumerable<Project> GetActiveProjects()
{
var packTargets = Solution.GetProjects("*")
var packTargets = Solution.AllProjects
.Where(x => x.Name != "Spring.Messaging.Ems" || BuildEms)
.Where(x => !x.Name.Contains("_build"));
return packTargets;
Expand Down
2 changes: 1 addition & 1 deletion build-support/nuke-build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="6.3.0" />
<PackageReference Include="Nuke.Common" Version="7.0.2" />
</ItemGroup>

</Project>
14 changes: 7 additions & 7 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:; set -eo pipefail
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
:; ${SCRIPT_DIR}/build.sh "$@"
:; exit $?

@ECHO OFF
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*
:; set -eo pipefail
:; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
:; ${SCRIPT_DIR}/build.sh "$@"
:; exit $?

@ECHO OFF
powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*
7 changes: 6 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $TempDirectory = "$PSScriptRoot\\.nuke\temp"

$DotNetGlobalFile = "$PSScriptRoot\\global.json"
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
$DotNetChannel = "Current"
$DotNetChannel = "STS"

$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
Expand Down Expand Up @@ -65,5 +65,10 @@ else {

Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"

if (Test-Path env:NUKE_ENTERPRISE_TOKEN) {
& $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null
& $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null
}

ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"

DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
DOTNET_CHANNEL="Current"
DOTNET_CHANNEL="STS"

export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
Expand Down Expand Up @@ -58,5 +58,10 @@ fi

echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"

if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "NUKE_ENTERPRISE_TOKEN" != "" ]]; then
"$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true
"$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true
fi

"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"

0 comments on commit dc58113

Please sign in to comment.