Skip to content

DmytroOrlov/zio-macros

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZIO-MACROS

CI Release Issues Discord
Build Status Release Artifacts Average time to resolve an issue badge-discord

Scrap boilerplate in your ZIO projects. Learn more about ZIO at:

This project is a loose collection of different macro-based solutions to simplify your code. Head to the specific docs to learn more about the ones that interest you.

  • accessible - Generate public accessors for ZIO services.
  • mockable - Automatically derive mockable implementations for your services.
  • delegate - Generate proxies for arbitrary traits / classes.
  • mix - Derive rules to combine instances of traits into a compound type.

Installation

The macros have been split into two subprojects.

  • zio-macros-core has no dependencies other than zio, it contains accessible, delegate and mix
"dev.zio" %% "zio-macros-core" % "<version>"
  • zio-macros-test depends on zio-test and zio-macros-core, it contains mockable
"dev.zio" %% "zio-macros-test" % "<version>"

As this project is heavily using macros you will need to enable them:

  • If using a scala version < 2.13 you need to add the macro paradise compiler plugin.
compilerPlugin(("org.scalamacros" % "paradise"  % "2.1.1") cross CrossVersion.full)
  • If using scala 2.13 you need to add the macro annotation compiler options.
scalacOptions += "-Ymacro-annotations"

About

Macros to scrap ZIO boilerplate

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Scala 79.1%
  • Shell 20.9%