Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unavailable modules #237

Merged
merged 3 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 5 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

添加库依赖,下面是如何在 SBT 中使用

> 在gradle,maven中,通常`smt-annotations`被替换为`smt-annotations_2.12`这种。其中,`2.12`表示Scala版本号。
> 在gradle,maven中,通常`smt-annotations`被替换为`smt-annotations_2.12`其中,`2.12`表示Scala版本号。

## cache

Expand Down Expand Up @@ -51,15 +51,15 @@
- 零依赖,类型安全。

```scala
"org.bitlap" %% "smt-csv" % "<VERSION>" // 从0.5.2开始
"org.bitlap" %% "smt-csv" % "<VERSION>"
```

## csv-derive

- `DeriveCsvConverter` 为Scala`case class`自动派生`Converter`实例。

```scala
"org.bitlap" %% "smt-csv-derive" % "<VERSION>" // 从0.5.2开始
"org.bitlap" %% "smt-csv-derive" % "<VERSION>"
```

## annotations
Expand All @@ -76,37 +76,7 @@
> Intellij插件 `Scala-Macro-Tools`。

```scala
"org.bitlap" %% "smt-annotations" % "<VERSION>" // 从0.6.0开始名字改成 smt-annotations
```

## cacheable [不可上生产]

基于zio的类似Spring`@Cacheable`和`@CacheEvict`注解的缓存API定义。该模块不包含具体的存储媒介。

- `@cacheable` / `Cache.apply`
- `@cacheEvict` / `Cache.evict`

```scala
// 内部包含的依赖: zio, zio-streams, zio-logging
"org.bitlap" %% "smt-cacheable" % "<VERSION>" // 不支持Scala2.11.x
```

## cacheable-redis [不可上生产]

基于zio和zio-redis的分布式缓存实现,内部依赖`cacheable`。

> TODO,目前不可用

```scala
"org.bitlap" %% "smt-cacheable-redis" % "<VERSION>" // 不支持Scala2.11.x
```

## cacheable-caffeine [不可上生产]

基于zio和caffeine的内存缓存实现,内部依赖`cacheable`。(不支持Scala2.11.x)

```scala
"org.bitlap" %% "smt-cacheable-caffeine" % "<VERSION>"
"org.bitlap" %% "smt-annotations" % "<VERSION>"
```

该库已发布到maven中央仓库,请使用最新版本。仅将本库导入构建系统(例如gradle、sbt)是不够的。你需要多走一步。
Expand Down Expand Up @@ -142,4 +112,4 @@ Thanks to JetBrains for providing me with a free license, which is a strong supp
[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
[Link-Snapshots]: https://s01.oss.sonatype.org/content/repositories/snapshots/org/bitlap/
[Link-Snapshots]: https://s01.oss.sonatype.org/content/repositories/snapshots/org/bitlap/
117 changes: 4 additions & 113 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,11 @@ ThisBuild / resolvers ++= Seq(
"New snapshots" at "https://s01.oss.sonatype.org/content/repositories/snapshots/"
)

lazy val scala212 = "2.12.14"
lazy val scala211 = "2.11.12"
lazy val scala213 = "2.13.8"
lazy val lastVersionForExamples = "0.7.3"
lazy val scala212 = "2.12.14"
lazy val scala211 = "2.11.12"
lazy val scala213 = "2.13.8"

lazy val configVersion = "1.4.2"
lazy val scalatestVersion = "3.2.13"
lazy val zioVersion = "1.0.16"
lazy val zioLoggingVersion = "0.5.14"
lazy val caffeineVersion = "2.9.3"
lazy val zioRedisVersion = "0.0.0+381-86c20614-SNAPSHOT" // 实验性质的
lazy val zioSchemaVersion = "0.1.9"
lazy val scalaLoggingVersion = "3.9.5"
lazy val log4jVersion = "2.18.0"
lazy val scalaCollectionCompatVersion = "2.8.1"
Expand Down Expand Up @@ -49,54 +42,6 @@ lazy val commonSettings =
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true)
)

lazy val `smt-cacheable` = (project in file("smt-cacheable"))
.settings(commonSettings)
.settings(Publishing.publishSettings)
.settings(
name := "smt-cacheable",
crossScalaVersions := List(scala213, scala212),
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion % Provided,
"dev.zio" %% "zio-streams" % zioVersion,
"dev.zio" %% "zio-logging" % zioLoggingVersion
)
)
.settings(paradise())
.enablePlugins(HeaderPlugin)

lazy val `smt-cacheable-caffeine` = (project in file("smt-cacheable-caffeine"))
.settings(commonSettings)
.settings(Publishing.publishSettings)
.settings(
name := "smt-cacheable-caffeine",
crossScalaVersions := List(scala213, scala212),
libraryDependencies ++= Seq(
"com.typesafe" % "config" % configVersion,
"com.github.ben-manes.caffeine" % "caffeine" % caffeineVersion
)
)
.dependsOn(`smt-cacheable` % "compile->compile;test->test")
.settings(paradise())
.enablePlugins(HeaderPlugin)

lazy val `smt-cacheable-redis` = (project in file("smt-cacheable-redis"))
.settings(commonSettings)
.settings(Publishing.publishSettings)
.settings(
name := "smt-cacheable-redis",
crossScalaVersions := List(scala213, scala212),
libraryDependencies ++= Seq(
"dev.zio" %% "zio-redis" % zioRedisVersion % Provided,
"com.typesafe" % "config" % configVersion,
"dev.zio" %% "zio-schema" % zioSchemaVersion,
"dev.zio" %% "zio-schema-json" % zioSchemaVersion,
"dev.zio" %% "zio-schema-derivation" % zioSchemaVersion % Test
)
)
.dependsOn(`smt-cacheable` % "compile->compile;test->test")
.settings(paradise())
.enablePlugins(HeaderPlugin)

lazy val `smt-csv` = (project in file("smt-csv"))
.settings(commonSettings)
.settings(
Expand Down Expand Up @@ -160,16 +105,10 @@ lazy val `smt-annotations` = (project in file("smt-annotations"))
lazy val `smt` = (project in file("."))
.aggregate(
`smt-annotations`,
`smt-cacheable`,
`smt-cacheable-redis`,
`smt-cacheable-caffeine`,
`smt-csv`,
`smt-csv-derive`,
`smt-cache`,
`smt-common`,
`scala2-11`,
`scala2-12`,
`scala2-13`
`smt-common`
)
.settings(
commands ++= Commands.value,
Expand All @@ -196,54 +135,6 @@ lazy val `smt` = (project in file("."))
)
)

lazy val `scala2-13` = (project in file("examples/scala2-13"))
.settings(scalaVersion := scala213)
.settings(
libraryDependencies ++= Seq(
"org.bitlap" %% "smt-annotations" % lastVersionForExamples,
"org.bitlap" %% "smt-cacheable" % lastVersionForExamples,
"org.bitlap" %% "smt-cacheable-redis" % lastVersionForExamples,
"org.bitlap" %% "smt-cacheable-caffeine" % lastVersionForExamples,
"dev.zio" %% "zio-redis" % zioRedisVersion,
"dev.zio" %% "zio" % zioVersion
)
)
.settings(
publish / skip := true,
Compile / scalacOptions ++= List("-Ymacro-annotations", "-Ywarn-unused")
)

lazy val `scala2-12` = (project in file("examples/scala2-12"))
.settings(scalaVersion := scala212)
.settings(
libraryDependencies ++= Seq(
"org.bitlap" %% "smt-annotations" % lastVersionForExamples,
"org.bitlap" %% "smt-cacheable" % lastVersionForExamples,
"org.bitlap" %% "smt-cacheable-redis" % lastVersionForExamples,
"org.bitlap" %% "smt-cacheable-caffeine" % lastVersionForExamples,
"dev.zio" %% "zio-redis" % zioRedisVersion,
"dev.zio" %% "zio" % zioVersion
)
)
.settings(
publish / skip := true,
scalacOptions ++= List("-Xlint:unused"),
paradise()
)

lazy val `scala2-11` = (project in file("examples/scala2-11"))
.settings(scalaVersion := scala211)
.settings(
libraryDependencies ++= Seq(
"org.bitlap" %% "smt-annotations" % lastVersionForExamples
)
)
.settings(
publish / skip := true,
scalacOptions ++= List("-Xlint:unused"),
paradise()
)

def paradise(): Def.Setting[Seq[ModuleID]] =
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n < 13 => Some("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full)
Expand Down
20 changes: 0 additions & 20 deletions examples/scala2-11/src/main/scala/org/bitlap/tools/Main.scala

This file was deleted.

This file was deleted.

This file was deleted.

20 changes: 0 additions & 20 deletions examples/scala2-12/src/main/scala/org/bitlap/tools/Main.scala

This file was deleted.

Loading