Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitlap/smt
🔧 Useless but cool.
https://github.com/bitlap/smt
annotations lombok macro scala transformer
Last synced: 14 days ago
JSON representation
🔧 Useless but cool.
- Host: GitHub
- URL: https://github.com/bitlap/smt
- Owner: bitlap
- License: mit
- Created: 2021-06-13T07:49:13.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-01-14T15:01:35.000Z (18 days ago)
- Last Synced: 2025-01-14T16:32:44.070Z (18 days ago)
- Topics: annotations, lombok, macro, scala, transformer
- Language: Scala
- Homepage: https://bitlap.org/lab/smt
- Size: 1.02 MB
- Stars: 14
- Watchers: 3
- Forks: 6
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smt
[![Project stage](https://img.shields.io/badge/Project%20Stage-Deprecated-red.svg)](https://github.com/bitlap/bitlap/wiki/Project-Stages)
| CI | Codecov | Scaladex | Jetbrains Plugin |
|-----------------|-------------------------------------------|---------------------------------------------------------------|-----------------------------------------------|
| ![CI][Badge-CI] | [![codecov][Badge-Codecov]][Link-Codecov] | [![smt Scala version support][Badge-Scaladex]][Link-Scaladex] | [![Version][Badge-Jetbrains]][Link-Jetbrains] |# 环境
- Scala 2.11.x
- Scala 2.12.x
- Scala 2.13.x
- Scala 3.x [bitlap/rolls](https://github.com/bitlap/rolls)# 文档
[详细文档 https://bitlap.org/lab/smt](https://bitlap.org/lab/smt)
# 如何使用
## annotations
- `@toString`
- `@builder`
- `@apply`
- `@constructor` 2.13+
- `@equalsAndHashCode`
- `@javaCompatible` 2.13+> Intellij插件 `Scala-Macro-Tools`。
```scala
"org.bitlap" %% "smt-annotations" % ""
```> 在gradle,maven中,通常`smt-annotations`被替换为`smt-annotations_2.12`,其中,`2.12`表示Scala版本号。`smt-annotations`改名自`smt-tools`
在`scala 2.13.x`版本中,需增加scalac参数`-Ymacro-annotations`。
## common
- 通用的宏操作API的封装。
- 对象转换器(零依赖,类型安全)。
- JDBC `ResultSet` 转换器。```scala
"org.bitlap" %% "smt-common" % ""
```该库已发布到[https://s01.oss.sonatype.org/](https://s01.oss.sonatype.org/)仓库,请使用最新版本。仅将本库导入构建系统(例如gradle、sbt)是不够的。不同Scala版本还需要相应配置:
| Scala 2.11 | Scala 2.12 | Scala 2.13 |
|----------------------|----------------------|--------------------------------|
| 导入 macro paradise 插件 | 导入 macro paradise 插件 | 开启 编译器标记 `-Ymacro-annotations` |```scala
// 导入 macro paradise 插件
// 必须是Scala版本号的完整编号,如2.12.13,而不是2.12。
addCompilerPlugin("org.scalamacros" % "paradise_" % "")
```如果没有仓库,可以手动添加:
```
ThisBuild / resolvers ++= Seq(
"Sonatype OSS Snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots",
"Sonatype OSS Releases" at "https://s01.oss.sonatype.org/content/repositories/releases"
)
```[Badge-CI]: https://github.com/bitlap/smt/actions/workflows/ci.yml/badge.svg
[Badge-Scaladex]: https://index.scala-lang.org/bitlap/smt/smt-annotations/latest-by-scala-version.svg?platform=jvm
[Badge-Jetbrains]: https://img.shields.io/jetbrains/plugin/v/17202-scala-macro-tools
[Badge-Codecov]: https://codecov.io/gh/bitlap/smt/branch/master/graph/badge.svg?token=IA596YRTOT[Link-Jetbrains]: https://plugins.jetbrains.com/plugin/17202-scala-macro-tools
[Link-Codecov]: https://codecov.io/gh/bitlap/smt
[Link-Scaladex]: https://index.scala-lang.org/bitlap/smt/smt-annotations