README.md
    https://bitlap.org

    scala-macro-tools

    Project Stage CI Codecov
    Stage CI codecov
    Scaladex Jetbrains Plugin Nexus Snapshots
    scala-macro-tools Scala version support Version Sonatype Nexus (Snapshots)

    Motivation

    Learn Scala macro and abstract syntax tree.

    The project is currently experimental

    中文说明 | English

    Environment

    • Compile passed in Java 8、11
    • Compile passed in Scala 2.11.12、2.12.14、2.13.8

    Document

    https://bitlap.org/en-US/lab/smt

    How to use

    csv-core

    • Converter A basic CSV converter
    • CsvableBuilder Support for converting Scalacase classto one CSV line in a custom way.
    • ScalableBuilder Support for converting one CSV line to Scalacase classin a custom way.
    • Zero dependency, type-safe
    "org.bitlap" %% "smt-csv-core" % "<VERSION>" // since 0.5.2

    csv-derive

    • DeriveCsvConverter Automatically deriveConverterinstances for Scalacase class
    "org.bitlap" %% "smt-csv-derive" % "<VERSION>" // since 0.5.2

    tools

    • @toString
    • @json
    • @builder
    • @log
    • @apply
    • @constructor
    • @equalsAndHashCode
    • @jacksonEnum
    • @elapsed
    • @javaCompatible
    • ProcessorCreator

    The intellij plugin named Scala-Macro-Tools in marketplace.

    "org.bitlap" %% "smt-tools" % "<VERSION>" // named smt-tools since 0.4.0 

    cacheable-core

    A cache like Spring @Cacheable and @cacheEvict based on zio. It has no implementation of storage media.

    • @cacheable / Cache.apply
    • @cacheEvict / Cache.evict
    // cache API, include dependencies: zio, zio-streams, zio-logging
    "org.bitlap" %% "smt-cacheable-core" % "<VERSION>" // not support Scala2.11.x

    cacheable-redis

    A distributed cache based on zio and zio-redis. It needs cacheable-core module.

    TODO Not unavailable, no distributed lock

    // distributed cache, include dependencies: zio-redis, config, zio-schema, zio-schema-json, optional (zio-schema-derivation for case class)
    // dependsOn `smt-cacheable-core`
    "org.bitlap" %% "smt-cacheable-redis" % "<VERSION>" // not support Scala2.11.x

    cacheable-caffeine

    A memory cache based on zio and caffeine. It needs cacheable-core module.

    // local cache, include dependencies: config, caffeine
    // dependsOn `smt-cacheable-core`
    "org.bitlap" %% "smt-cacheable-caffeine" % "<VERSION>" // not support Scala2.11.x

    The artefacts have been uploaded to Maven Central. Importing the library into your build system (e.g gradle, sbt), is not enough. You need to follow an extra step.

    Scala 2.11 Scala 2.12 Scala 2.13
    Import macro paradise plugin Import macro paradise plugin Enable compiler flag -Ymacro-annotations required
    addCompilerPlugin("org.scalamacros" % "paradise_<your-scala-version>" % "<plugin-version>")

    Where <your-scala-version> must be the full scala version. For example 2.12.13, and not 2.12.

    If that doesn't work, google for alternatives.

    In version scala2.13.x, the functionality of macro paradise has been included in the scala compiler directly. However, you must still enable the compiler flag -Ymacro-annotations.

    项目简介

    基于Scala宏编程实现的类似Lombok的工具库。

    🚀 Github 镜像仓库 🚀

    原项目 https://github.com/bitlap/scala-macro-tools

    发行版本 26

    0.9.1

    全部发行版

    贡献者 6

    梦境迷离 @qq_34446485
    S Scala Steward @Scala Steward
    D dependabot[bot] @dependabot[bot]
    I IceMimosa @IceMimosa
    梦境迷离 @梦境迷离
    I IceMimosa @IceMimosa

    开发语言

    • Scala 100.0 %