diff --git a/weaver/common/get-fabric-protos.sh b/weaver/common/get-fabric-protos.sh index 59c95ea8e6..476c5ed728 100755 --- a/weaver/common/get-fabric-protos.sh +++ b/weaver/common/get-fabric-protos.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - WEAVER_ROOT=${1:-".."} FABRIC_PROTOS_VERSION=${FABRIC_PROTOS_VERSION:-'2.1'} diff --git a/weaver/common/protos-go/build-protos.sh b/weaver/common/protos-go/build-protos.sh index 0abbd7ac0c..23b8d99351 100644 --- a/weaver/common/protos-go/build-protos.sh +++ b/weaver/common/protos-go/build-protos.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - BUILDDIR=./ PROTOSDIR=../protos FABRIC_PROTOSDIR=../fabric-protos diff --git a/weaver/common/protos-java-kt/build.gradle b/weaver/common/protos-java-kt/build.gradle index 6d3acc5006..6ff9a3a559 100644 --- a/weaver/common/protos-java-kt/build.gradle +++ b/weaver/common/protos-java-kt/build.gradle @@ -3,7 +3,7 @@ buildscript { ext.protobuf_version = "3.11.1" ext.grpc_version = "1.29.0" // CURRENT_GRPC_VERSION ext.grpc_kotlin_version = "0.1.4" // CURRENT_GRPC_KOTLIN_VERSION - ext.kotlin_version = "1.3.72" + ext.kotlin_version = "1.4.32" dependencies { classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" diff --git a/weaver/common/protos-java-kt/gradle/wrapper/gradle-wrapper.jar b/weaver/common/protos-java-kt/gradle/wrapper/gradle-wrapper.jar index 99340b4ad1..249e5832f0 100644 Binary files a/weaver/common/protos-java-kt/gradle/wrapper/gradle-wrapper.jar and b/weaver/common/protos-java-kt/gradle/wrapper/gradle-wrapper.jar differ diff --git a/weaver/common/protos-java-kt/gradle/wrapper/gradle-wrapper.properties b/weaver/common/protos-java-kt/gradle/wrapper/gradle-wrapper.properties index fad65ec89e..2ec77e51a9 100644 --- a/weaver/common/protos-java-kt/gradle/wrapper/gradle-wrapper.properties +++ b/weaver/common/protos-java-kt/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Jul 06 09:59:13 AEST 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/weaver/common/protos-java-kt/gradlew b/weaver/common/protos-java-kt/gradlew index cccdd3d517..a69d9cb6c2 100755 --- a/weaver/common/protos-java-kt/gradlew +++ b/weaver/common/protos-java-kt/gradlew @@ -1,78 +1,129 @@ -#!/usr/bin/env sh +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# 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 +# +# https://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. +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -81,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -89,84 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" fi +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + exec "$JAVACMD" "$@" diff --git a/weaver/common/protos-java-kt/gradlew.bat b/weaver/common/protos-java-kt/gradlew.bat index f9553162f1..f127cfd49d 100755 --- a/weaver/common/protos-java-kt/gradlew.bat +++ b/weaver/common/protos-java-kt/gradlew.bat @@ -1,4 +1,20 @@ -@if "%DEBUG%" == "" @echo off +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -9,19 +25,22 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,38 +64,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/weaver/common/protos-js/build-protos.sh b/weaver/common/protos-js/build-protos.sh index 38d4f93aa7..4322b20972 100755 --- a/weaver/common/protos-js/build-protos.sh +++ b/weaver/common/protos-js/build-protos.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - BUILDDIR=./ PROTOSDIR=../protos FABRIC_PROTOSDIR=../fabric-protos diff --git a/weaver/common/protos-sol/build.sh b/weaver/common/protos-sol/build.sh index 54167aea06..e2936127bf 100755 --- a/weaver/common/protos-sol/build.sh +++ b/weaver/common/protos-sol/build.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - WEAVER_ROOT=${1:-".."} SOLIDITY_PROTOSDIR=./solidity-protos @@ -16,4 +16,4 @@ fi cp ${WEAVER_ROOT}/protos/common/asset_locks.proto ./asset_locks.proto sed -i.bak '/^package /d' ./asset_locks.proto rm -rf ./asset_locks.proto.bak -protoc --plugin ${SOLIDITY_PROTOSDIR}/bin/protoc-gen-sol --sol_out . asset_locks.proto \ No newline at end of file +protoc --plugin ${SOLIDITY_PROTOSDIR}/bin/protoc-gen-sol --sol_out . asset_locks.proto diff --git a/weaver/core/drivers/corda-driver/constants.properties b/weaver/core/drivers/corda-driver/constants.properties index 207ca5e7cb..c8a5ba74b8 100644 --- a/weaver/core/drivers/corda-driver/constants.properties +++ b/weaver/core/drivers/corda-driver/constants.properties @@ -1,11 +1,11 @@ cordaReleaseGroup=net.corda cordaCoreReleaseGroup=net.corda -cordaVersion=4.8 -cordaCoreVersion=4.8 -gradlePluginsVersion=5.0.12 -kotlinVersion=1.3.72 +cordaVersion=4.8.11 +cordaCoreVersion=4.8.11 +gradlePluginsVersion=5.0.17 +kotlinVersion=1.4.32 junitVersion=4.12 -log4jVersion=2.16.0 +log4jVersion=2.17.1 slf4jVersion=1.7.25 arrowVersion=0.10.4 grpcVersion=1.28.1 @@ -13,4 +13,4 @@ grpcKotlinVersion=0.1.3 protobufVersion=3.11.1 coroutinesVersion=1.3.3 bcprovVersion=1.53 -cactiVersion=2.0.0-alpha.2 \ No newline at end of file +cactiVersion=2.0.0-alpha.2 diff --git a/weaver/core/drivers/corda-driver/gradle/wrapper/gradle-wrapper.jar b/weaver/core/drivers/corda-driver/gradle/wrapper/gradle-wrapper.jar index f3d88b1c2f..249e5832f0 100644 Binary files a/weaver/core/drivers/corda-driver/gradle/wrapper/gradle-wrapper.jar and b/weaver/core/drivers/corda-driver/gradle/wrapper/gradle-wrapper.jar differ diff --git a/weaver/core/drivers/corda-driver/gradle/wrapper/gradle-wrapper.properties b/weaver/core/drivers/corda-driver/gradle/wrapper/gradle-wrapper.properties index 78cc5b1fe0..2ec77e51a9 100644 --- a/weaver/core/drivers/corda-driver/gradle/wrapper/gradle-wrapper.properties +++ b/weaver/core/drivers/corda-driver/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed Jul 08 14:33:54 AEST 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/weaver/core/drivers/corda-driver/gradlew b/weaver/core/drivers/corda-driver/gradlew index 2fe81a7d95..a69d9cb6c2 100755 --- a/weaver/core/drivers/corda-driver/gradlew +++ b/weaver/core/drivers/corda-driver/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,78 +17,113 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -105,79 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/weaver/core/drivers/corda-driver/gradlew.bat b/weaver/core/drivers/corda-driver/gradlew.bat index 9618d8d960..f127cfd49d 100644 --- a/weaver/core/drivers/corda-driver/gradlew.bat +++ b/weaver/core/drivers/corda-driver/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,10 +25,13 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -51,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -61,38 +64,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/weaver/core/network/corda-interop-app/constants.properties b/weaver/core/network/corda-interop-app/constants.properties index 575555e537..bacb9b5dc5 100644 --- a/weaver/core/network/corda-interop-app/constants.properties +++ b/weaver/core/network/corda-interop-app/constants.properties @@ -1,13 +1,13 @@ cordaReleaseGroup=net.corda cordaCoreReleaseGroup=net.corda -cordaVersion=4.8 -cordaCoreVersion=4.8 -gradlePluginsVersion=5.0.12 -kotlinVersion=1.3.72 +cordaVersion=4.8.11 +cordaCoreVersion=4.8.11 +gradlePluginsVersion=5.0.17 +kotlinVersion=1.4.32 junitVersion=4.12 -log4jVersion=2.16.0 +log4jVersion=2.17.1 platformVersion=10 slf4jVersion=1.7.25 nettyVersion=4.1.22.Final arrowVersion=0.10.4 -cactiVersion=2.0.0-alpha.2 \ No newline at end of file +cactiVersion=2.0.0-alpha.2 diff --git a/weaver/core/network/corda-interop-app/gradle/wrapper/gradle-wrapper.jar b/weaver/core/network/corda-interop-app/gradle/wrapper/gradle-wrapper.jar index 99340b4ad1..249e5832f0 100644 Binary files a/weaver/core/network/corda-interop-app/gradle/wrapper/gradle-wrapper.jar and b/weaver/core/network/corda-interop-app/gradle/wrapper/gradle-wrapper.jar differ diff --git a/weaver/core/network/corda-interop-app/gradle/wrapper/gradle-wrapper.properties b/weaver/core/network/corda-interop-app/gradle/wrapper/gradle-wrapper.properties index fad65ec89e..2ec77e51a9 100644 --- a/weaver/core/network/corda-interop-app/gradle/wrapper/gradle-wrapper.properties +++ b/weaver/core/network/corda-interop-app/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Jul 06 09:59:13 AEST 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/weaver/core/network/corda-interop-app/gradlew b/weaver/core/network/corda-interop-app/gradlew index cccdd3d517..a69d9cb6c2 100755 --- a/weaver/core/network/corda-interop-app/gradlew +++ b/weaver/core/network/corda-interop-app/gradlew @@ -1,78 +1,129 @@ -#!/usr/bin/env sh +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# 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 +# +# https://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. +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -81,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -89,84 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" fi +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + exec "$JAVACMD" "$@" diff --git a/weaver/core/network/corda-interop-app/gradlew.bat b/weaver/core/network/corda-interop-app/gradlew.bat index f9553162f1..f127cfd49d 100644 --- a/weaver/core/network/corda-interop-app/gradlew.bat +++ b/weaver/core/network/corda-interop-app/gradlew.bat @@ -1,4 +1,20 @@ -@if "%DEBUG%" == "" @echo off +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -9,19 +25,22 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,38 +64,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/weaver/core/network/fabric-interop-cc/scripts/build.sh b/weaver/core/network/fabric-interop-cc/scripts/build.sh index 2d556123f5..eb34c935ea 100755 --- a/weaver/core/network/fabric-interop-cc/scripts/build.sh +++ b/weaver/core/network/fabric-interop-cc/scripts/build.sh @@ -1,8 +1,8 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - cd ./contracts/interop -go build -o ../../bin/interop \ No newline at end of file +go build -o ../../bin/interop diff --git a/weaver/core/relay/docker/init.sh b/weaver/core/relay/docker/init.sh index d1d10b35ae..4bc253bdd2 100755 --- a/weaver/core/relay/docker/init.sh +++ b/weaver/core/relay/docker/init.sh @@ -1,9 +1,9 @@ +#!/bin/sh + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/sh - FINGERPRINT_PATH=$(pwd)/fingerprint.json if [ -f "${FINGERPRINT_PATH}" ]; then diff --git a/weaver/core/relay/scripts/convert-compose.sh b/weaver/core/relay/scripts/convert-compose.sh index 3d8fb3adfd..f68753bc7b 100755 --- a/weaver/core/relay/scripts/convert-compose.sh +++ b/weaver/core/relay/scripts/convert-compose.sh @@ -1,9 +1,9 @@ +#!/bin/sh + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/sh - comment () { sed -i'.scriptbak' -e "$1"' s/ - / # - /' "$2" } diff --git a/weaver/core/relay/scripts/update-protos.sh b/weaver/core/relay/scripts/update-protos.sh index 8189e6b789..09ca03ca04 100755 --- a/weaver/core/relay/scripts/update-protos.sh +++ b/weaver/core/relay/scripts/update-protos.sh @@ -1,9 +1,9 @@ +#!/bin/sh + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/sh - directory=$(dirname $0) if [ -z $WEAVER_ROOT ]; then WEAVER_ROOT=$directory/../../.. diff --git a/weaver/samples/besu/besu-cli/scripts/initAsset.sh b/weaver/samples/besu/besu-cli/scripts/initAsset.sh index 04a28cd03a..f1020d65ed 100755 --- a/weaver/samples/besu/besu-cli/scripts/initAsset.sh +++ b/weaver/samples/besu/besu-cli/scripts/initAsset.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - echo "Issuing 100 BobERC20 Tokens to Alice in network2" ./bin/besu-cli asset issue --network=network2 --account=1 --amount=100 --asset_type=ERC20 echo "Issuing 100 BobERC20 Tokens to Bob in network2" @@ -19,4 +19,4 @@ else ./bin/besu-cli asset issue --network=network1 --account=1 --token_id=0 --asset_type=ERC721 echo "Issuing AliceERC721 Token with id 1 to Bob in network1" ./bin/besu-cli asset issue --network=network1 --account=2 --token_id=1 --asset_type=ERC721 -fi \ No newline at end of file +fi diff --git a/weaver/samples/corda/corda-simple-application/.gitignore b/weaver/samples/corda/corda-simple-application/.gitignore index f6b59168da..fb3fecebdb 100644 --- a/weaver/samples/corda/corda-simple-application/.gitignore +++ b/weaver/samples/corda/corda-simple-application/.gitignore @@ -16,6 +16,7 @@ clients/src/main/resources/config/remote-network-config.json **/build/* !docs/build/* **/bin/* +clients/libs # proto files clients/src/main/proto/* diff --git a/weaver/samples/corda/corda-simple-application/clients/build.gradle b/weaver/samples/corda/corda-simple-application/clients/build.gradle index 91fa524126..0f42b43237 100644 --- a/weaver/samples/corda/corda-simple-application/clients/build.gradle +++ b/weaver/samples/corda/corda-simple-application/clients/build.gradle @@ -1,5 +1,8 @@ buildscript { - ext.clikt_version = "2.7.1" + Properties constants = new Properties() + file("$projectDir/../constants.properties").withInputStream { constants.load(it) } + + ext.clikt_version = constants.getProperty("cliktVersion") ext.coroutines_version = "1.3.7" ext.protobuf_version = "3.11.1" ext.bcprov_version = "1.53" @@ -58,6 +61,7 @@ repositories { dirs '../../../../core/network/corda-interop-app/interop-workflows/build/libs' dirs '../../../../sdks/corda/build/libs' dirs '../../../../common/protos-java-kt/build/libs' + dirs 'libs' } } } @@ -77,7 +81,7 @@ dependencies { // CorDapp dependencies. compile project(":contracts-kotlin") compile project(":workflows-kotlin") - compile "com.github.ajalt:clikt:$clikt_version" + implementation files("libs/clikt-${clikt_version}.jar") implementation(group: 'com.fungiblehousetoken', name: 'contracts', version: "1.0") implementation(group: 'com.fungiblehousetoken', name: 'workflows', version: "1.0") diff --git a/weaver/samples/corda/corda-simple-application/constants.properties b/weaver/samples/corda/corda-simple-application/constants.properties index 75d8357acd..ba331f71f1 100644 --- a/weaver/samples/corda/corda-simple-application/constants.properties +++ b/weaver/samples/corda/corda-simple-application/constants.properties @@ -1,14 +1,15 @@ cordaReleaseGroup=net.corda cordaCoreReleaseGroup=net.corda -cordaVersion=4.8 -cordaCoreVersion=4.8 -gradlePluginsVersion=5.0.12 -kotlinVersion=1.3.72 +cordaVersion=4.8.11 +cordaCoreVersion=4.8.11 +gradlePluginsVersion=5.0.17 +kotlinVersion=1.4.32 junitVersion=4.12 -log4jVersion =2.16.0 +log4jVersion=2.17.1 platformVersion=10 slf4jVersion=1.7.25 nettyVersion=4.1.22.Final cordaTokenSDKGroup=com.r3.corda.lib.tokens cordaTokenSDKVersion=1.2.5 -cactiVersion=2.0.0-alpha.2 \ No newline at end of file +cliktVersion=2.7.1 +cactiVersion=2.0.0-alpha.2 diff --git a/weaver/samples/corda/corda-simple-application/gradle/wrapper/gradle-wrapper.jar b/weaver/samples/corda/corda-simple-application/gradle/wrapper/gradle-wrapper.jar index 7a3265ee94..62d4c05355 100644 Binary files a/weaver/samples/corda/corda-simple-application/gradle/wrapper/gradle-wrapper.jar and b/weaver/samples/corda/corda-simple-application/gradle/wrapper/gradle-wrapper.jar differ diff --git a/weaver/samples/corda/corda-simple-application/gradle/wrapper/gradle-wrapper.properties b/weaver/samples/corda/corda-simple-application/gradle/wrapper/gradle-wrapper.properties index 4c46317507..2ec77e51a9 100644 --- a/weaver/samples/corda/corda-simple-application/gradle/wrapper/gradle-wrapper.properties +++ b/weaver/samples/corda/corda-simple-application/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip diff --git a/weaver/samples/corda/corda-simple-application/gradlew b/weaver/samples/corda/corda-simple-application/gradlew index cccdd3d517..4f906e0c81 100755 --- a/weaver/samples/corda/corda-simple-application/gradlew +++ b/weaver/samples/corda/corda-simple-application/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# 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 +# +# https://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. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -66,6 +82,7 @@ esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -109,10 +126,11 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath @@ -138,19 +156,19 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -159,14 +177,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/weaver/samples/corda/corda-simple-application/gradlew.bat b/weaver/samples/corda/corda-simple-application/gradlew.bat index f9553162f1..5093609d51 100644 --- a/weaver/samples/corda/corda-simple-application/gradlew.bat +++ b/weaver/samples/corda/corda-simple-application/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -13,8 +29,11 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -65,6 +84,7 @@ set CMD_LINE_ARGS=%* set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% diff --git a/weaver/samples/corda/corda-simple-application/makefile b/weaver/samples/corda/corda-simple-application/makefile index 81704a4ab8..a6782c5255 100644 --- a/weaver/samples/corda/corda-simple-application/makefile +++ b/weaver/samples/corda/corda-simple-application/makefile @@ -1,3 +1,5 @@ +CLIKT_VERSION=$(shell grep cliktVersion ./constants.properties | cut -d '=' -f 2) + .PHONY: build-local-weaver-dependencies build-local-weaver-dependencies: echo "Building local protos..." @@ -8,7 +10,7 @@ build-local-weaver-dependencies: .PHONY: build-local build-local: cd ../fungible-house-token && rm -f github.properties && make build - ./gradlew clean installDist jar + wget -P clients/libs/ https://repo1.maven.org/maven2/com/github/ajalt/clikt/${CLIKT_VERSION}/clikt-${CLIKT_VERSION}.jar && ./gradlew clean installDist jar .PHONY: build-refresh-dependencies-local build-refresh-dependencies-local: build-local-weaver-dependencies @@ -94,3 +96,4 @@ publish-cordapps: clean: ./gradlew clean rm -rf .gradle + rm -rf clients/libs diff --git a/weaver/samples/corda/corda-simple-application/scripts/getAssetStatus.sh b/weaver/samples/corda/corda-simple-application/scripts/getAssetStatus.sh index 84d33b0719..b894841d17 100755 --- a/weaver/samples/corda/corda-simple-application/scripts/getAssetStatus.sh +++ b/weaver/samples/corda/corda-simple-application/scripts/getAssetStatus.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - echo "PartyA Tokens:" CORDA_PORT=10006 ./clients/build/install/clients/bin/clients get-asset-states-by-type t1 echo -e "\n--\n" @@ -23,4 +23,4 @@ if [ "$1" = "2" ]; then echo -e "\nPartyC:" CORDA_PORT=30012 ./clients/build/install/clients/bin/clients get-asset-states-by-type t2 -fi \ No newline at end of file +fi diff --git a/weaver/samples/corda/corda-simple-application/scripts/getHouseTokenStatus.sh b/weaver/samples/corda/corda-simple-application/scripts/getHouseTokenStatus.sh index 3609d8c42f..a144a5a42f 100755 --- a/weaver/samples/corda/corda-simple-application/scripts/getHouseTokenStatus.sh +++ b/weaver/samples/corda/corda-simple-application/scripts/getHouseTokenStatus.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - echo -e "############## Corda_Network ################\n" echo "PartyA:" CORDA_PORT=10006 ./clients/build/install/clients/bin/clients house-token get-balance diff --git a/weaver/samples/corda/corda-simple-application/scripts/initAsset.sh b/weaver/samples/corda/corda-simple-application/scripts/initAsset.sh index c5438c2e57..3ad31c86fa 100755 --- a/weaver/samples/corda/corda-simple-application/scripts/initAsset.sh +++ b/weaver/samples/corda/corda-simple-application/scripts/initAsset.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - echo -e "\n\n Corda_Network:" echo "Adding 30 t1 tokens to PartyA" CORDA_PORT=10006 ./clients/build/install/clients/bin/clients issue-asset-state 30 t1 @@ -26,4 +26,4 @@ else echo -e "\n -- \n" echo "Adding 50 t2 tokens to PartyC" CORDA_PORT=30012 ./clients/build/install/clients/bin/clients issue-asset-state 50 t2 -fi \ No newline at end of file +fi diff --git a/weaver/samples/corda/corda-simple-application/scripts/initHouseToken.sh b/weaver/samples/corda/corda-simple-application/scripts/initHouseToken.sh index 14d6a35287..8b1c429a02 100755 --- a/weaver/samples/corda/corda-simple-application/scripts/initHouseToken.sh +++ b/weaver/samples/corda/corda-simple-application/scripts/initHouseToken.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - echo -e "\n\n Corda_Network:" ./clients/build/install/clients/bin/clients house-token init echo "Issue to PartyA:" @@ -24,4 +24,4 @@ else CORDA_PORT=30006 ./clients/build/install/clients/bin/clients house-token issue -p "O=PartyB, L=London, C=GB" -a 50 echo "Issue to PartyC:" CORDA_PORT=30006 ./clients/build/install/clients/bin/clients house-token issue -p "O=PartyC, L=London, C=GB" -a 50 -fi \ No newline at end of file +fi diff --git a/weaver/samples/corda/corda-simple-application/scripts/initNetworkId.sh b/weaver/samples/corda/corda-simple-application/scripts/initNetworkId.sh index 32d7729ced..416a8bc6ff 100644 --- a/weaver/samples/corda/corda-simple-application/scripts/initNetworkId.sh +++ b/weaver/samples/corda/corda-simple-application/scripts/initNetworkId.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - MEMBERS="" docker logs corda_partya_1 > /dev/null && MEMBERS+="O=PartyA, L=London, C=GB;" diff --git a/weaver/samples/corda/fungible-house-token/build.gradle b/weaver/samples/corda/fungible-house-token/build.gradle index ba7dceecb3..a728b35adf 100644 --- a/weaver/samples/corda/fungible-house-token/build.gradle +++ b/weaver/samples/corda/fungible-house-token/build.gradle @@ -24,8 +24,10 @@ buildscript { repositories { mavenLocal() mavenCentral() - jcenter() + maven { url 'https://repo1.maven.org/maven2' } maven { url 'https://download.corda.net/maven/corda-releases' } + maven { url 'https://download.corda.net/maven/corda-dependencies' } + maven { url 'https://download.corda.net/maven/corda-lib' } } dependencies { @@ -43,9 +45,10 @@ allprojects { repositories { mavenLocal() - jcenter() + maven { url 'https://repo1.maven.org/maven2' } mavenCentral() maven { url 'https://download.corda.net/maven/corda' } + maven { url 'https://download.corda.net/maven/corda-releases' } maven { url 'https://jitpack.io' } //SDK lib maven { url 'https://download.corda.net/maven/corda-lib' } diff --git a/weaver/samples/corda/fungible-house-token/constants.properties b/weaver/samples/corda/fungible-house-token/constants.properties index c05b7cc47a..3d7a002ebb 100644 --- a/weaver/samples/corda/fungible-house-token/constants.properties +++ b/weaver/samples/corda/fungible-house-token/constants.properties @@ -1,15 +1,15 @@ cordaReleaseGroup=net.corda cordaCoreReleaseGroup=net.corda -cordaVersion=4.8 -cordaCoreVersion=4.8 -gradlePluginsVersion=5.0.12 -kotlinVersion=1.2.71 +cordaVersion=4.8.11 +cordaCoreVersion=4.8.11 +gradlePluginsVersion=5.0.17 +kotlinVersion=1.4.32 junitVersion=4.12 quasarVersion=0.7.10 -log4jVersion =2.16.0 +log4jVersion=2.17.1 platformVersion=10 slf4jVersion=1.7.25 nettyVersion=4.1.22.Final cordaTokenSDKGroup=com.r3.corda.lib.tokens cordaTokenSDKVersion=1.2.5 -cactiVersion=2.0.0-alpha.2 \ No newline at end of file +cactiVersion=2.0.0-alpha.2 diff --git a/weaver/samples/corda/fungible-house-token/makefile b/weaver/samples/corda/fungible-house-token/makefile index 5a4f8d5ec9..98e50c1d6d 100644 --- a/weaver/samples/corda/fungible-house-token/makefile +++ b/weaver/samples/corda/fungible-house-token/makefile @@ -9,7 +9,7 @@ build: source cp extension-flows/*.kt source/workflows/src/main/kotlin/net/corda/samples/tokenizedhouse/flows/ cp extension-states/*.kt source/contracts/src/main/kotlin/net/corda/samples/tokenizedhouse/states/ cp build.gradle source/build.gradle - cd source && ./gradlew clean jar + cd source && ./gradlew wrapper --gradle-version 7.5 --distribution-type all && ./gradlew clean jar .PHONY: clean clean: diff --git a/weaver/sdks/corda/constants.properties b/weaver/sdks/corda/constants.properties index 207ca5e7cb..c8a5ba74b8 100644 --- a/weaver/sdks/corda/constants.properties +++ b/weaver/sdks/corda/constants.properties @@ -1,11 +1,11 @@ cordaReleaseGroup=net.corda cordaCoreReleaseGroup=net.corda -cordaVersion=4.8 -cordaCoreVersion=4.8 -gradlePluginsVersion=5.0.12 -kotlinVersion=1.3.72 +cordaVersion=4.8.11 +cordaCoreVersion=4.8.11 +gradlePluginsVersion=5.0.17 +kotlinVersion=1.4.32 junitVersion=4.12 -log4jVersion=2.16.0 +log4jVersion=2.17.1 slf4jVersion=1.7.25 arrowVersion=0.10.4 grpcVersion=1.28.1 @@ -13,4 +13,4 @@ grpcKotlinVersion=0.1.3 protobufVersion=3.11.1 coroutinesVersion=1.3.3 bcprovVersion=1.53 -cactiVersion=2.0.0-alpha.2 \ No newline at end of file +cactiVersion=2.0.0-alpha.2 diff --git a/weaver/sdks/corda/gradle/wrapper/gradle-wrapper.jar b/weaver/sdks/corda/gradle/wrapper/gradle-wrapper.jar index f3d88b1c2f..249e5832f0 100644 Binary files a/weaver/sdks/corda/gradle/wrapper/gradle-wrapper.jar and b/weaver/sdks/corda/gradle/wrapper/gradle-wrapper.jar differ diff --git a/weaver/sdks/corda/gradle/wrapper/gradle-wrapper.properties b/weaver/sdks/corda/gradle/wrapper/gradle-wrapper.properties index 78cc5b1fe0..2ec77e51a9 100644 --- a/weaver/sdks/corda/gradle/wrapper/gradle-wrapper.properties +++ b/weaver/sdks/corda/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Wed Jul 08 14:33:54 AEST 2020 -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/weaver/sdks/corda/gradlew b/weaver/sdks/corda/gradlew index 2fe81a7d95..a69d9cb6c2 100755 --- a/weaver/sdks/corda/gradlew +++ b/weaver/sdks/corda/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,78 +17,113 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -105,79 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/weaver/sdks/corda/gradlew.bat b/weaver/sdks/corda/gradlew.bat index 9618d8d960..f127cfd49d 100644 --- a/weaver/sdks/corda/gradlew.bat +++ b/weaver/sdks/corda/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,10 +25,13 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -51,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -61,38 +64,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/weaver/tests/network-setups/besu/scripts/setupNetwork.sh b/weaver/tests/network-setups/besu/scripts/setupNetwork.sh index 0375483a52..0e5e106a1e 100644 --- a/weaver/tests/network-setups/besu/scripts/setupNetwork.sh +++ b/weaver/tests/network-setups/besu/scripts/setupNetwork.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 diff --git a/weaver/tests/network-setups/corda/dev/Corda_Network/constants.properties b/weaver/tests/network-setups/corda/dev/Corda_Network/constants.properties index e0cbc6acc5..cc7009c9a0 100644 --- a/weaver/tests/network-setups/corda/dev/Corda_Network/constants.properties +++ b/weaver/tests/network-setups/corda/dev/Corda_Network/constants.properties @@ -2,8 +2,8 @@ cordaReleaseGroup=net.corda cordaCoreReleaseGroup=net.corda cordaVersion=4.8 cordaCoreVersion=4.8 -gradlePluginsVersion=5.0.12 -kotlinVersion=1.3.72 +gradlePluginsVersion=5.0.17 +kotlinVersion=1.4.32 junitVersion=4.12 log4jVersion =2.11.2 platformVersion=10 diff --git a/weaver/tests/network-setups/corda/dev/Corda_Network2/constants.properties b/weaver/tests/network-setups/corda/dev/Corda_Network2/constants.properties index aa3b4e5148..0a986fc3e9 100644 --- a/weaver/tests/network-setups/corda/dev/Corda_Network2/constants.properties +++ b/weaver/tests/network-setups/corda/dev/Corda_Network2/constants.properties @@ -2,8 +2,8 @@ cordaReleaseGroup=net.corda cordaCoreReleaseGroup=net.corda cordaVersion=4.8 cordaCoreVersion=4.8 -gradlePluginsVersion=5.0.12 -kotlinVersion=1.3.72 +gradlePluginsVersion=5.0.17 +kotlinVersion=1.4.32 junitVersion=4.12 log4jVersion =2.11.2 platformVersion=10 diff --git a/weaver/tests/network-setups/corda/gradle/wrapper/gradle-wrapper.properties b/weaver/tests/network-setups/corda/gradle/wrapper/gradle-wrapper.properties index 4c46317507..0e9a610516 100644 --- a/weaver/tests/network-setups/corda/gradle/wrapper/gradle-wrapper.properties +++ b/weaver/tests/network-setups/corda/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip diff --git a/weaver/tests/network-setups/corda/scripts/check-nodes-status.sh b/weaver/tests/network-setups/corda/scripts/check-nodes-status.sh index 17a2cc56c4..8e90e4489b 100755 --- a/weaver/tests/network-setups/corda/scripts/check-nodes-status.sh +++ b/weaver/tests/network-setups/corda/scripts/check-nodes-status.sh @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 diff --git a/weaver/tests/network-setups/corda/scripts/clean-restart.sh b/weaver/tests/network-setups/corda/scripts/clean-restart.sh index f5a91b1ae8..76e414cc01 100755 --- a/weaver/tests/network-setups/corda/scripts/clean-restart.sh +++ b/weaver/tests/network-setups/corda/scripts/clean-restart.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - docker-compose down ./gradlew clean diff --git a/weaver/tests/network-setups/corda/scripts/generate.sh b/weaver/tests/network-setups/corda/scripts/generate.sh index 9b0a77ac04..a1c9362234 100755 --- a/weaver/tests/network-setups/corda/scripts/generate.sh +++ b/weaver/tests/network-setups/corda/scripts/generate.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - directory=$(dirname $0) nw=${1:-Corda_Network} diff --git a/weaver/tests/network-setups/corda/scripts/get-cordapps.sh b/weaver/tests/network-setups/corda/scripts/get-cordapps.sh index cc042792c7..d1914d4f92 100755 --- a/weaver/tests/network-setups/corda/scripts/get-cordapps.sh +++ b/weaver/tests/network-setups/corda/scripts/get-cordapps.sh @@ -1,5 +1,9 @@ #!/bin/bash +# Copyright IBM Corp. All Rights Reserved. +# +# SPDX-License-Identifier: Apache-2.0 + directory=$(dirname $0) app=${1:-simple} local=$2 diff --git a/weaver/tests/network-setups/corda/scripts/start-nodes.sh b/weaver/tests/network-setups/corda/scripts/start-nodes.sh index f929527460..8180e2ee28 100755 --- a/weaver/tests/network-setups/corda/scripts/start-nodes.sh +++ b/weaver/tests/network-setups/corda/scripts/start-nodes.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - directory=$(dirname $0) app=${1:-simple} profile=${2:-"1-node"} diff --git a/weaver/tests/network-setups/fabric/dev/scripts/createChannel.sh b/weaver/tests/network-setups/fabric/dev/scripts/createChannel.sh index 9b54d5831c..49e1be47da 100755 --- a/weaver/tests/network-setups/fabric/dev/scripts/createChannel.sh +++ b/weaver/tests/network-setups/fabric/dev/scripts/createChannel.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - CHANNEL_NAME="$1" DELAY="$2" diff --git a/weaver/tests/network-setups/fabric/dev/scripts/deployCC.sh b/weaver/tests/network-setups/fabric/dev/scripts/deployCC.sh index fd16f38531..21dc1bbbe5 100755 --- a/weaver/tests/network-setups/fabric/dev/scripts/deployCC.sh +++ b/weaver/tests/network-setups/fabric/dev/scripts/deployCC.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - CHANNEL_NAME="$1" CC_SRC_LANGUAGE="$2" VERSION="$3" diff --git a/weaver/tests/network-setups/fabric/dev/scripts/envVar.sh b/weaver/tests/network-setups/fabric/dev/scripts/envVar.sh index 37c3e6c654..592218c36f 100755 --- a/weaver/tests/network-setups/fabric/dev/scripts/envVar.sh +++ b/weaver/tests/network-setups/fabric/dev/scripts/envVar.sh @@ -1,3 +1,5 @@ +#!/bin/bash + # # Copyright IBM Corp All Rights Reserved # diff --git a/weaver/tests/network-setups/fabric/shared/network1/ccp-generate.sh b/weaver/tests/network-setups/fabric/shared/network1/ccp-generate.sh index 3ee92cd2ae..4768340d39 100755 --- a/weaver/tests/network-setups/fabric/shared/network1/ccp-generate.sh +++ b/weaver/tests/network-setups/fabric/shared/network1/ccp-generate.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - echo $1 function one_line_pem { diff --git a/weaver/tests/network-setups/fabric/shared/network2/ccp-generate.sh b/weaver/tests/network-setups/fabric/shared/network2/ccp-generate.sh index 7d2eec7b4a..63da80fb60 100755 --- a/weaver/tests/network-setups/fabric/shared/network2/ccp-generate.sh +++ b/weaver/tests/network-setups/fabric/shared/network2/ccp-generate.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - echo $1 function one_line_pem { diff --git a/weaver/tests/network-setups/indy/docker/scripts/create_dirs_modified.sh b/weaver/tests/network-setups/indy/docker/scripts/create_dirs_modified.sh index bb6b4c2d48..28e81fb499 100755 --- a/weaver/tests/network-setups/indy/docker/scripts/create_dirs_modified.sh +++ b/weaver/tests/network-setups/indy/docker/scripts/create_dirs_modified.sh @@ -1,9 +1,9 @@ +#!/usr/bin/env bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/usr/bin/env bash - # This script is a modification of indy-node/scripts/create_dirs.sh just to remove the 'sudo' commands. # dirs to be created diff --git a/weaver/tests/network-setups/indy/docker/scripts/run_indy_nodes.sh b/weaver/tests/network-setups/indy/docker/scripts/run_indy_nodes.sh index ad293d0d78..b24d64f906 100755 --- a/weaver/tests/network-setups/indy/docker/scripts/run_indy_nodes.sh +++ b/weaver/tests/network-setups/indy/docker/scripts/run_indy_nodes.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - NODES="${INDYNODES:-4}" CLIENTS="${INDYCLIENTS:-5}" diff --git a/weaver/tests/network-setups/shared/charts/config-maps/generate-ccp/ccp-generate.sh b/weaver/tests/network-setups/shared/charts/config-maps/generate-ccp/ccp-generate.sh index e163eb585f..889c63e18e 100644 --- a/weaver/tests/network-setups/shared/charts/config-maps/generate-ccp/ccp-generate.sh +++ b/weaver/tests/network-setups/shared/charts/config-maps/generate-ccp/ccp-generate.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - function one_line_pem { echo "`awk 'NF {sub(/\\n/, ""); printf "%s\\\\\\\n",$0;}' $1`" } diff --git a/weaver/tests/network-setups/shared/charts/config-maps/scripts/initCC.sh b/weaver/tests/network-setups/shared/charts/config-maps/scripts/initCC.sh index a6f866baa0..f2482cb394 100644 --- a/weaver/tests/network-setups/shared/charts/config-maps/scripts/initCC.sh +++ b/weaver/tests/network-setups/shared/charts/config-maps/scripts/initCC.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - INIT_REQUIRED="--init-required" if [ "$CC_INIT_FCN" = "NA" ]; then INIT_REQUIRED="" diff --git a/weaver/tests/network-setups/test/fabric/charts/deploycc/bkp/initCC.sh b/weaver/tests/network-setups/test/fabric/charts/deploycc/bkp/initCC.sh index c43fae5faf..e9ec84f80f 100644 --- a/weaver/tests/network-setups/test/fabric/charts/deploycc/bkp/initCC.sh +++ b/weaver/tests/network-setups/test/fabric/charts/deploycc/bkp/initCC.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - INIT_REQUIRED="--init-required" if [ "$CC_INIT_FCN" = "NA" ]; then INIT_REQUIRED="" diff --git a/weaver/tests/network-setups/test/fabric/scripts/initCC.sh b/weaver/tests/network-setups/test/fabric/scripts/initCC.sh index bd45a0b8f3..d01906d52a 100755 --- a/weaver/tests/network-setups/test/fabric/scripts/initCC.sh +++ b/weaver/tests/network-setups/test/fabric/scripts/initCC.sh @@ -1,9 +1,9 @@ +#!/bin/bash + # Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 -#!/bin/bash - INIT_REQUIRED="--init-required" if [ "$CC_INIT_FCN" = "NA" ]; then INIT_REQUIRED=""