diff --git a/.github/workflows/server_compatibility.yaml b/.github/workflows/server_compatibility.yaml index 453b8743..5f3d4d79 100644 --- a/.github/workflows/server_compatibility.yaml +++ b/.github/workflows/server_compatibility.yaml @@ -454,6 +454,15 @@ jobs: cp ${{github.workspace}}\utils\net\utils.ps1 ${{github.workspace}}\tag\build\utils.ps1 ./hz-latest.ps1 copy-files -copy-files-source ${{github.workspace}}\utils\net\ssl + - name: Use hz.ps1 with no Java Version Check Script for Client < 5.3.1 + id: backport-no-java-check + if: ${{ ((steps.version.outputs.major == '5' && steps.version.outputs.minor < '4') || (steps.version.outputs.major == '4')) }} + shell: pwsh + working-directory: tag + run: | + cp ${{github.workspace}}\utils\net\no-java-check\hz.ps1 ${{github.workspace}}\tag\hz.ps1 + cp ${{github.workspace}}\utils\net\utils.ps1 ${{github.workspace}}\tag\build\utils.ps1 + - name: Build shell: pwsh working-directory: tag diff --git a/utils/net/no-java-check/hz.ps1 b/utils/net/no-java-check/hz.ps1 new file mode 100644 index 00000000..83dd66ca --- /dev/null +++ b/utils/net/no-java-check/hz.ps1 @@ -0,0 +1,2653 @@ +## Copyright (c) 2008-2022, Hazelcast, Inc. All Rights Reserved. +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. + +## Hazelcast.NET Build Script + +# constant +$defaultServerVersion="5.4.0-SNAPSHOT" + +# PowerShell errors can *also* be a pain +# see https://stackoverflow.com/questions/10666035 +# see https://stackoverflow.com/questions/10666101 +# don't die as soon as a command reports an error, we will take care of it! +# (and, GitHub actions tend to end up running with 'Stop' by default) +$ErrorActionPreference='Continue' + +# prepare directories +$scriptRoot = "$PSScriptRoot" +$slnRoot = [System.IO.Path]::GetFullPath("$scriptRoot") +$srcDir = [System.IO.Path]::GetFullPath("$slnRoot/src") +$tmpDir = [System.IO.Path]::GetFullPath("$slnRoot/temp") +$buildDir = [System.IO.Path]::GetFullPath("$slnRoot/build") + +# include utils +. "$buildDir/utils.ps1" + +# ensure we have the right platform +Validate-Platform + +# pwsh handling of args is... interesting +$clargs = [Environment]::GetCommandLineArgs() +$script = [IO.Path]::GetFileName($PSCommandPath) # this is always going to be 'script.ps1' +$clarg0 = [IO.Path]::GetFileName($clargs[0]) # this is always going to be the pwsh exe/dll +$clarg1 = $null +if ($clargs.Count -gt 1) { + $clarg1 = [IO.Path]::GetFileName($clargs[1]) # this is going to be either 'script.ps1' or the first arg +} +if ($script -eq $clarg1) { + # the pwsh exe/dll running the script (e.g. launched from bash, cmd...) + $ignore, $ignore, $argx = $clargs +} +else { + # the script running within pwsh (e.g. script launched from the pwsh prompt) + $argx = $args + # still, unquoted -- is stripped by pwsh no matter what + # and, --foo:bar is OK but -foo:bar is still processed by pwsh + # need to use pwsh --% escape +} + +# PowerShell args can *also* be a pain - because 'pwsh' loves to pre-handle +# args when run directly but not when run from a scrip, etc - so we have our +# own way of dealing with args + +# Tests filter. +# Can use eg "namespace==Hazelcast.Tests.Core" to only run and cover some tests. +# NUnit selection: https://docs.nunit.org/articles/nunit/running-tests/Test-Selection-Language.html +# test|name|class|namespace|method|cat ==|!=|=~|!~ 'value'|/value/|"value" +# "class == /Hazelcast.Tests.Networking.NetworkAddressTests/" +# "test == /Hazelcast.Tests.Networking.NetworkAddressTests/Parse" +# DotCover filter: https://www.jetbrains.com/help/dotcover/Running_Coverage_Analysis_from_the_Command_LIne.html#filters +# +:= separated with ';' +# eg -:module=AdditionalTests;-:type=MainTests.Unit*;-:type=MainTests.IntegrationTests;function=TestFeature1; +#