Skip to content

Latest commit

 

History

History
81 lines (53 loc) · 1.74 KB

CONTRIBUTING.md

File metadata and controls

81 lines (53 loc) · 1.74 KB

Contributing to Scalus

Pre-requisites

  • Java 11+, sbt 1.x
  • Cardano uplc CLI tool and Nix

Env setup with Nix

Make sure that you have installed Nix package manager (see https://nixos.org/ ) and enabled nix-command and flake features and IOHK binary cache.

Typical Nix config can looks like:

substituters = https://cache.iog.io https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-substituters = https://cache.iog.io https://hydra.iohk.io https://iohk.cachix.org https://cache.nixos.org/
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
experimental-features = nix-command flakes
accept-flake-config = true
allow-import-from-derivation = true

Usually you already have this setup if you have build cardano-node or cardano-cli locally.

nix develop

Build

sbt precommit

Scalus Plugin Development

During compiler plugin development you want to automatically recompile the dependencies of the plugin.

For faster development make sure that in build.sbt:

  1. scalacOptions contains -Xplugin with the path to the plugin jar with the dummy argument.
Seq(s"-Xplugin:${jar.getAbsolutePath}", s"-Jdummy=${jar.lastModified}")
  1. scalusPlugin project version is not manually set

This line should be commented out in scalusPlugin project settings:

version := "0.6.2-SNAPSHOT",

Docusaurus

Run locally

cd website
yarn install
yarn run serve

Deploy to GitHub Pages

cd website
USE_SSH=true yarn deploy

Run benchmarks

In sbt shell

jmh:run -i 1 -wi 1 -f 1 -t 1