Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

hermitize #163

Merged
merged 8 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI it's not necessary to include bin/ here - activate-hermit will add bin to the $PATH for you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

run: gradle build koverXmlReport

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ 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.

## Gradle
```kotlin
repositories {
Expand Down Expand Up @@ -66,7 +70,7 @@ dependencies {
<summary>Expand for complete mvn pom.xml example using kotlin</summary>

pom.xml:
```
```xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
Expand Down Expand Up @@ -256,9 +260,6 @@ fun main() {
}
```




# Development

## JSON Schemas
Expand All @@ -273,8 +274,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.
KendallWeihe marked this conversation as resolved.
Show resolved Hide resolved

# Other Docs

* [Guidelines](./CONVENTIONS.md)
Expand Down
1 change: 1 addition & 0 deletions bin/.gradle-8.2.pkg
1 change: 1 addition & 0 deletions bin/.openjdk-11.0.10_9.pkg
7 changes: 7 additions & 0 deletions bin/README.hermit.md
Original file line number Diff line number Diff line change
@@ -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.
21 changes: 21 additions & 0 deletions bin/activate-hermit
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions bin/gradle
43 changes: 43 additions & 0 deletions bin/hermit
Original file line number Diff line number Diff line change
@@ -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" -- "$@"
Empty file added bin/hermit.hcl
Empty file.
1 change: 1 addition & 0 deletions bin/jaotc
1 change: 1 addition & 0 deletions bin/jar
1 change: 1 addition & 0 deletions bin/jarsigner
1 change: 1 addition & 0 deletions bin/java
1 change: 1 addition & 0 deletions bin/javac
1 change: 1 addition & 0 deletions bin/javadoc
1 change: 1 addition & 0 deletions bin/javap
1 change: 1 addition & 0 deletions bin/jcmd
1 change: 1 addition & 0 deletions bin/jconsole
1 change: 1 addition & 0 deletions bin/jdb
1 change: 1 addition & 0 deletions bin/jdeprscan
1 change: 1 addition & 0 deletions bin/jdeps
1 change: 1 addition & 0 deletions bin/jfr
1 change: 1 addition & 0 deletions bin/jhsdb
1 change: 1 addition & 0 deletions bin/jimage
1 change: 1 addition & 0 deletions bin/jinfo
1 change: 1 addition & 0 deletions bin/jjs
1 change: 1 addition & 0 deletions bin/jlink
1 change: 1 addition & 0 deletions bin/jmap
1 change: 1 addition & 0 deletions bin/jmod
1 change: 1 addition & 0 deletions bin/jps
1 change: 1 addition & 0 deletions bin/jrunscript
1 change: 1 addition & 0 deletions bin/jshell
1 change: 1 addition & 0 deletions bin/jstack
1 change: 1 addition & 0 deletions bin/jstat
1 change: 1 addition & 0 deletions bin/jstatd
1 change: 1 addition & 0 deletions bin/keytool
1 change: 1 addition & 0 deletions bin/pack200
1 change: 1 addition & 0 deletions bin/rmic
1 change: 1 addition & 0 deletions bin/rmid
1 change: 1 addition & 0 deletions bin/rmiregistry
1 change: 1 addition & 0 deletions bin/serialver
1 change: 1 addition & 0 deletions bin/unpack200
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {

allprojects {
group = "xyz.block"
tasks.findByName("wrapper")?.enabled = false
}

subprojects {
Expand Down
Binary file removed gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 0 additions & 5 deletions gradle/wrapper/gradle-wrapper.properties

This file was deleted.

Loading
Loading