Morphir is a library of tools that works to capture business logic as data.
For the first time, business logic can be shared, stored, translated and visualised, all with the reliability of standardisation ensured in the Morphir framework.
Provides Scala language bindings and JVM based tooling for Morphir.
You can install the morphir-cli
in the following ways:
Using Coursier
cs install --channel https://raw.githubusercontent.com/finos/morphir-scala/main/coursier-channel.json morphir-cli
Then run the CLI:
morphir-cli setup
We also offer an insiders channel that grants access to snapshot releases of the CLI.
cs install --channel https://raw.githubusercontent.com/finos/morphir-scala/main/coursier-channel.json morphir-insiders-cli
Then run the CLI:
morphir-cli setup
NOTE: The main channel above (non-insiders), also offers insiders builds under the name morphir-insiders-cli
:
cs install --channel https://raw.githubusercontent.com/finos/morphir-scala/main/coursier-channel.json morphir-insiders-cli
Then run the CLI:
morphir-insiders-cli setup
Click the button below to start a new development environment and start contributing right away:
Morphir-jvm use mill as its build tool.
If you are using IntelliJ IDEA to edit morphir-jvm's Scala code, you can create the IntelliJ project files via:
./mill mill.idea.GenIdea/idea
If you are using Visual Studio Code, IntelliJ, or any of the Editors which support BSP you can also generate BSP config files via:
./mill mill.bsp.BSP/install
You can also try the following to use the mill-contrib-bloop
plugin to install and use the Bloop based BSP setup.
NOTE: The recommended BSP based setup for mill is to run:
./mill mill.bsp.BSP/install
as mentioned above.
./mill __.test
or in watch mode:
./mill -w __.test
NOTE: When running tests you will want to ensure you have generated the MorphirIR for elm sources if you are running tests for the runtime. A simple way to do this is to use the
build.sh
helper script an invoke theelm-build
option../build.sh elm-build
For your convience, you can run the morphir-runtime tests using the following command:
./build.sh test-runtime-jvm
Before checking test coverage, ensure that all tests have been run using the following command:
./mill __.test
To generate a human-readable coverage report, run the following command:
./mill scoverage.htmlReportAll
To view the resulting coverage report, open out/scoverage/htmlReportAll.dest/index.html
To generate an XML coverage report, run the following command:
./mill scoverage.xmlReportAll
The report will be generated at this location out/scoverage/xmlReportAll.dest/scoverage.xml
Code needs to be formatted according to scalafmt
rules. To run scalafmt
on all the source code using:
./mill mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources
or the much shorter:
./mill reformatAll __.sources
or in watch mode to reformat changed files:
./mill -w mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources
The evaluator tests utilize elm code. To reformat the elm code for those tests:
elm-format --elm-version=0.19 examples/morphir-elm-projects/evaluator-tests/src/Morphir/Examples/App/*.elm
If you don't have elm-format installed, you can either install it through npm or a different package manager like brew:
npm install -g elm-format
Alternatively, this can be done directly via npm run format
, which is documented here
If you are using IntelliJ IDEA to edit morphir-scala's Scala code, you can create the IntelliJ project files via or use the BSP Setup option (BSP is the recommended approach):
.\mill -i mill.scalalib.GenIdea/idea
If you are using Visual Studio Code, IntelliJ, or any of the Editors which support BSP you can also generate BSP config files via:
.\mill mill.bsp.BSP/install
You can also try the following to use the mill-contrib-bloop
plugin to install and use the Bloop based BSP setup.
NOTE: The recommended BSP based setup for mill is to run:
.\mill mill.bsp.BSP/install
as mentioned above.
.\mill -i --import ivy:com.lihaoyi::mill-contrib-bloop: mill.contrib.bloop.Bloop/install
.\mill -i __.test
or in watch mode:
.\mill -i -w __.test
Documentation for the elm tests are located at examples/morphir-elm-projects/evaluator-tests/ReadMe.md
Code needs to be formatted according to scalafmt
rules. To run scalafmt
on all the source code using:
.\mill -i mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources
or in watch mode to reformat changed files:
.\mill -i -w mill.scalalib.scalafmt.ScalafmtModule/reformatAll __.sources
Watch for updates.
- Fork it (https://github.com/finos/morphir-scala/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Read our contribution guidelines and Community Code of Conduct
- Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
NOTE: Commits and pull requests to FINOS repositories will only be accepted from those contributors with an active, executed Individual Contributor License Agreement (ICLA) with FINOS OR who are covered under an existing and active Corporate Contribution License Agreement (CCLA) executed with FINOS. Commits from individuals not covered under an ICLA or CCLA will be flagged and blocked by the FINOS Clabot tool (or EasyCLA). Please note that some CCLAs require individuals/employees to be explicitly named on the CCLA.
Need an ICLA? Unsure if you are covered under an existing CCLA? Email help@finos.org
Copyright 2022 FINOS
Distributed under the Apache License, Version 2.0.
SPDX-License-Identifier: Apache-2.0