diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 388b146e..43bebbcb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,9 @@ jobs: uses: actions/checkout@v2 with: submodules: "true" - - uses: gradle/wrapper-validation-action@v1 + # https://cashapp.github.io/hermit/usage/ci/ + - name: Init Hermit + uses: cashapp/activate-hermit@v1 - uses: actions/setup-java@v1 with: java-version: 17 @@ -30,7 +32,7 @@ jobs: key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/versions.properties') }} - name: Run Gradle Tasks - run: ./gradlew build koverXmlReport + run: gradle build koverXmlReport - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v3 diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3e880f20..743ef699 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -32,7 +32,9 @@ jobs: os: [ ubuntu-latest ] steps: - uses: actions/checkout@v3 - - uses: gradle/wrapper-validation-action@v1 + # https://cashapp.github.io/hermit/usage/ci/ + - name: Init Hermit + uses: cashapp/activate-hermit@v1 - uses: actions/setup-java@v1 with: java-version: 17 @@ -42,7 +44,7 @@ jobs: key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/versions.properties') }} - name: Build Docs - run: ./gradlew dokkaHtmlMultiModule + run: gradle dokkaHtmlMultiModule - name: Setup Pages uses: actions/configure-pages@v3 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 93a4e21d..91a02981 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -15,7 +15,9 @@ jobs: - uses: actions/checkout@v4 with: submodules: true - - uses: gradle/wrapper-validation-action@v1 + # https://cashapp.github.io/hermit/usage/ci/ + - name: Init Hermit + uses: cashapp/activate-hermit@v1 - name: Set up Java uses: actions/setup-java@v3 with: @@ -29,9 +31,9 @@ jobs: - name: Sonatype Publish Close And Release run: | if [ -n "${{ github.event.inputs.version }}" ]; then - ./gradlew -Pversion=${{ github.event.inputs.version }} publishToSonatype closeAndReleaseSonatypeStagingRepository + gradle -Pversion=${{ github.event.inputs.version }} publishToSonatype closeAndReleaseSonatypeStagingRepository else - ./gradlew -Pversion=$(echo "${{ github.ref_name }}" | cut -c2-) publishToSonatype closeAndReleaseSonatypeStagingRepository + gradle -Pversion=$(echo "${{ github.ref_name }}" | cut -c2-) publishToSonatype closeAndReleaseSonatypeStagingRepository fi env: ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} diff --git a/README.md b/README.md index c60cd499..fdfd7f69 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,17 @@ This repo contains 2 jvm packages: tbdex sdk is consumable through Maven Central but some additional repositories are needed for transitive dependencies currently: : +# Hermit +This project uses hermit to manage tooling like gradle or openjdk. See [this page](https://cashapp.github.io/hermit/usage/get-started/) to set up Hermit on your machine. +After installing hermit and activating it, you should be able to just run `gradle clean build` to build the project locally. + +Currently, we have these packages installed via Hermit (can also view by checking out `hermit status`: +- gradle-8.2 +- openjdk-11.0.10_9 + +You can run `hermit upgrade {package}` to upgrade an existing package, or `hermit install {package}` to install a new package. +Please see [Hermit package management page](https://cashapp.github.io/hermit/usage/management/) for more details. + ## Gradle ```kotlin repositories { @@ -66,7 +77,7 @@ dependencies { Expand for complete mvn pom.xml example using kotlin pom.xml: - ``` +```xml @@ -256,9 +267,6 @@ fun main() { } ``` - - - # Development ## JSON Schemas @@ -273,8 +281,6 @@ If you've already cloned the repo without `--recurse-submodules`, you can do the git submodule update --init ``` -copying the schemas and test vectors into the protocol package's `resources` directory can be done by running `./gradlew syncSchemas` and `./gradlew syncTestVectors` respectively. - # Other Docs * [Guidelines](./CONVENTIONS.md) diff --git a/bin/.gradle-8.2.pkg b/bin/.gradle-8.2.pkg new file mode 120000 index 00000000..383f4511 --- /dev/null +++ b/bin/.gradle-8.2.pkg @@ -0,0 +1 @@ +hermit \ No newline at end of file diff --git a/bin/.openjdk-11.0.10_9.pkg b/bin/.openjdk-11.0.10_9.pkg new file mode 120000 index 00000000..383f4511 --- /dev/null +++ b/bin/.openjdk-11.0.10_9.pkg @@ -0,0 +1 @@ +hermit \ No newline at end of file diff --git a/bin/README.hermit.md b/bin/README.hermit.md new file mode 100644 index 00000000..e889550b --- /dev/null +++ b/bin/README.hermit.md @@ -0,0 +1,7 @@ +# Hermit environment + +This is a [Hermit](https://github.com/cashapp/hermit) bin directory. + +The symlinks in this directory are managed by Hermit and will automatically +download and install Hermit itself as well as packages. These packages are +local to this environment. diff --git a/bin/activate-hermit b/bin/activate-hermit new file mode 100755 index 00000000..fe28214d --- /dev/null +++ b/bin/activate-hermit @@ -0,0 +1,21 @@ +#!/bin/bash +# This file must be used with "source bin/activate-hermit" from bash or zsh. +# You cannot run it directly +# +# THIS FILE IS GENERATED; DO NOT MODIFY + +if [ "${BASH_SOURCE-}" = "$0" ]; then + echo "You must source this script: \$ source $0" >&2 + exit 33 +fi + +BIN_DIR="$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")" +if "${BIN_DIR}/hermit" noop > /dev/null; then + eval "$("${BIN_DIR}/hermit" activate "${BIN_DIR}/..")" + + if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ]; then + hash -r 2>/dev/null + fi + + echo "Hermit environment $("${HERMIT_ENV}"/bin/hermit env HERMIT_ENV) activated" +fi diff --git a/bin/gradle b/bin/gradle new file mode 120000 index 00000000..3b1d2891 --- /dev/null +++ b/bin/gradle @@ -0,0 +1 @@ +.gradle-8.2.pkg \ No newline at end of file diff --git a/bin/hermit b/bin/hermit new file mode 100755 index 00000000..7fef7692 --- /dev/null +++ b/bin/hermit @@ -0,0 +1,43 @@ +#!/bin/bash +# +# THIS FILE IS GENERATED; DO NOT MODIFY + +set -eo pipefail + +export HERMIT_USER_HOME=~ + +if [ -z "${HERMIT_STATE_DIR}" ]; then + case "$(uname -s)" in + Darwin) + export HERMIT_STATE_DIR="${HERMIT_USER_HOME}/Library/Caches/hermit" + ;; + Linux) + export HERMIT_STATE_DIR="${XDG_CACHE_HOME:-${HERMIT_USER_HOME}/.cache}/hermit" + ;; + esac +fi + +export HERMIT_DIST_URL="${HERMIT_DIST_URL:-https://github.com/cashapp/hermit/releases/download/stable}" +HERMIT_CHANNEL="$(basename "${HERMIT_DIST_URL}")" +export HERMIT_CHANNEL +export HERMIT_EXE=${HERMIT_EXE:-${HERMIT_STATE_DIR}/pkg/hermit@${HERMIT_CHANNEL}/hermit} + +if [ ! -x "${HERMIT_EXE}" ]; then + echo "Bootstrapping ${HERMIT_EXE} from ${HERMIT_DIST_URL}" 1>&2 + INSTALL_SCRIPT="$(mktemp)" + # This value must match that of the install script + INSTALL_SCRIPT_SHA256="180e997dd837f839a3072a5e2f558619b6d12555cd5452d3ab19d87720704e38" + if [ "${INSTALL_SCRIPT_SHA256}" = "BYPASS" ]; then + curl -fsSL "${HERMIT_DIST_URL}/install.sh" -o "${INSTALL_SCRIPT}" + else + # Install script is versioned by its sha256sum value + curl -fsSL "${HERMIT_DIST_URL}/install-${INSTALL_SCRIPT_SHA256}.sh" -o "${INSTALL_SCRIPT}" + # Verify install script's sha256sum + openssl dgst -sha256 "${INSTALL_SCRIPT}" | \ + awk -v EXPECTED="$INSTALL_SCRIPT_SHA256" \ + '$2!=EXPECTED {print "Install script sha256 " $2 " does not match " EXPECTED; exit 1}' + fi + /bin/bash "${INSTALL_SCRIPT}" 1>&2 +fi + +exec "${HERMIT_EXE}" --level=fatal exec "$0" -- "$@" diff --git a/bin/hermit.hcl b/bin/hermit.hcl new file mode 100644 index 00000000..e69de29b diff --git a/bin/jaotc b/bin/jaotc new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jaotc @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jar b/bin/jar new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jar @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jarsigner b/bin/jarsigner new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jarsigner @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/java b/bin/java new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/java @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/javac b/bin/javac new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/javac @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/javadoc b/bin/javadoc new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/javadoc @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/javap b/bin/javap new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/javap @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jcmd b/bin/jcmd new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jcmd @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jconsole b/bin/jconsole new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jconsole @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jdb b/bin/jdb new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jdb @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jdeprscan b/bin/jdeprscan new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jdeprscan @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jdeps b/bin/jdeps new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jdeps @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jfr b/bin/jfr new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jfr @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jhsdb b/bin/jhsdb new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jhsdb @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jimage b/bin/jimage new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jimage @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jinfo b/bin/jinfo new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jinfo @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jjs b/bin/jjs new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jjs @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jlink b/bin/jlink new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jlink @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jmap b/bin/jmap new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jmap @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jmod b/bin/jmod new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jmod @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jps b/bin/jps new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jps @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jrunscript b/bin/jrunscript new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jrunscript @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jshell b/bin/jshell new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jshell @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jstack b/bin/jstack new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jstack @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jstat b/bin/jstat new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jstat @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/jstatd b/bin/jstatd new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/jstatd @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/keytool b/bin/keytool new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/keytool @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/pack200 b/bin/pack200 new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/pack200 @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/rmic b/bin/rmic new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/rmic @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/rmid b/bin/rmid new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/rmid @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/rmiregistry b/bin/rmiregistry new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/rmiregistry @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/serialver b/bin/serialver new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/serialver @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/bin/unpack200 b/bin/unpack200 new file mode 120000 index 00000000..3b5c6d89 --- /dev/null +++ b/bin/unpack200 @@ -0,0 +1 @@ +.openjdk-11.0.10_9.pkg \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index b56be498..f5f72e50 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -46,8 +46,8 @@ buildscript { } allprojects { - group = "xyz.block" + tasks.findByName("wrapper")?.enabled = false configurations.all { /** diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 249e5832..00000000 Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index 06febab4..00000000 --- a/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists \ No newline at end of file diff --git a/gradlew b/gradlew deleted file mode 100755 index 1b6c7873..00000000 --- a/gradlew +++ /dev/null @@ -1,234 +0,0 @@ -#!/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 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 -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 - -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" -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 - -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 ;; #( - 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 - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - 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 -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -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 - -# 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" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - 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 - # 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 -fi - -# 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 \ - "$@" - -# 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/gradlew.bat b/gradlew.bat deleted file mode 100644 index 28690fe0..00000000 --- a/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@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 -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -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" - -@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 execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -: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 %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="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 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega \ No newline at end of file diff --git a/httpclient/src/test/kotlin/tbdex/sdk/httpclient/TbdexHttpClientTest.kt b/httpclient/src/test/kotlin/tbdex/sdk/httpclient/TbdexHttpClientTest.kt index b08350a2..72d2af55 100644 --- a/httpclient/src/test/kotlin/tbdex/sdk/httpclient/TbdexHttpClientTest.kt +++ b/httpclient/src/test/kotlin/tbdex/sdk/httpclient/TbdexHttpClientTest.kt @@ -2,15 +2,12 @@ package tbdex.sdk.httpclient import de.fxlae.typeid.TypeId import junit.framework.TestCase.assertEquals -import okhttp3.MediaType.Companion.toMediaType -import okhttp3.RequestBody.Companion.toRequestBody import okhttp3.mockwebserver.MockResponse import okhttp3.mockwebserver.MockWebServer import org.junit.jupiter.api.AfterEach import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import tbdex.sdk.httpclient.models.CreateExchangeRequest import tbdex.sdk.httpclient.models.ErrorDetail import tbdex.sdk.httpclient.models.TbdexResponseException import tbdex.sdk.protocol.models.Quote