Skip to content

Commit

Permalink
Merge pull request #16 from tupol/2.0.0
Browse files Browse the repository at this point in the history
2.0.0 Cross compilation 2.12 & 2.12
  • Loading branch information
tupol authored Feb 4, 2024
2 parents 29be36b + a2e3232 commit 8e8a561
Show file tree
Hide file tree
Showing 37 changed files with 121 additions and 2,039 deletions.
46 changes: 9 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,20 @@
[![Discord](https://img.shields.io/discord/963384629572812860)](https://discord.gg/kDFsJ3y7Du)  
[![Twitter](https://img.shields.io/twitter/url/https/_tupol.svg?color=%2317A2F2)](https://twitter.com/_tupol)  


## Description

This project contains some basic utilities that can help setting up a Scala project.

The main utilities available:
- [Configuration framework](config-z/docs/configuration-framework.md)
- Conversion to byte array in the [`byteable`](core/src/main/scala/org/tupol/utils/ByteableOps.scala) package.
- `Try`, `Future`, `Either`, `Product`, `Map` and other utilities in the [`utils`](core/src/main/scala/org/tupol/utils/) package.

***Attention!*** The [Configuration framework](config-z/docs/configuration-framework.md) might be
deprecated, as the [PureConfig](https://pureconfig.github.io/) framework is much more mature and
provides a better overall solution.

## Prerequisites ##

* Java 8 or higher (matching the Scala version)
* Scala 2.12
* Scala 2.12 or 2.13


## Getting Scala Utils ##
Expand All @@ -35,11 +32,11 @@ where the latest artifacts can be found.
Usage with SBT, adding a dependency to the latest version of scala utils to your sbt build definition file:

```scala
libraryDependencies += "org.tupol" %% "scala-utils-core" % "1.0.0"
libraryDependencies += "org.tupol" %% "scala-utils-core" % "2.0.0"
```
or
```scala
libraryDependencies += "org.tupol" %% "scala-utils-core" % "1.0.0"
libraryDependencies += "org.tupol" %% "scala-utils-core" % "2.0.0"
```

For Snapshots, the Sonatype snapshots repo needs to be added as well:
Expand All @@ -49,39 +46,14 @@ For Snapshots, the Sonatype snapshots repo needs to be added as well:
```


## Usage

Some `config-z` usage examples can be found under [`config-z/src/test/scala/examples`](config-z/src/test/scala/examples).


## What's new?

**1.1.2**
- `jdbc` module - added `PreparedStatement` support
- `jdbc` module - added configuration and `ConnectionPool` support

**1.1.1**
- Added an experimental `jdbc` module

**1.1.0**
- Refactored the `configz` module
- Added a few more utility implicits to the `core` module


**1.0.0**

This new major version aims to bring a new and hopefully cleaner project structure.
The `scalaz` based configuration is moved to a different module to isolate better from the core.
In the future a `cats` based version might be added as well.

More core utilities were added and the old ones were brushed up for better consistency and clarity.

Attention! This version is no longer cross compiling across Scala 2.11 and 2.12.
Only Scala 2.12 is supported at the moment.

The previous versions are still available and can evolve independently on the **[`0.2.x`](https://github.com/tupol/scala-utils/tree/0.2.x)** branch.
**2.0.0**

For previous versions please consult the [release notes](RELEASE-NOTES.md).
- Cross compilation on Scala 2.12 and Scala 2.13
- Compiled with JDK 17 targeting Java 8
- Removed the `config-z` module
- Removed `TraversableOps` as it will be deprecated in future Scala versions


## License ##
Expand Down
24 changes: 24 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Release Notes

## 2.0.0

- Cross compilation on Scala 2.12 and Scala 2.13
- Compiled with JDK 17 targeting Java 8
- Removed the `config-z` module
- Removed `TraversableOps` as it will be deprecated in future Scala versions


## 1.1.2

- `jdbc` module - added `PreparedStatement` support
- `jdbc` module - added configuration and `ConnectionPool` support

## 1.1.1

- Added an experimental `jdbc` module

## 1.1.0

- Refactored the `configz` module
- Added a few more utility implicits to the `core` module



## 1.0.0

- Added the Collections `toOptionNel` utility
Expand Down
23 changes: 6 additions & 17 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,22 @@ lazy val publishSettings = Seq(

lazy val coverageSettings = Seq(
coverageEnabled in Test := true,
coverageMinimum in Test := 95,
coverageMinimumStmtTotal in Test := 95,
coverageMinimumBranchTotal in Test := 80,
coverageFailOnMinimum in Test := true,
coverageExcludedPackages := ".*BuildInfo.*"
)

lazy val basicSettings = Seq(
organization := "org.tupol",
name := "scala-utils",
scalaVersion := Versions.scala,
scalaVersion := Versions.scala_2_12,
crossScalaVersions := Versions.crossScala,
scalacOptions ++= Seq(
"-feature",
"-deprecation",
"-unchecked",
"-Ywarn-unused-import"
s"-release:${Versions.targetJava}"
),
updateOptions := updateOptions.value.withCachedResolution(true),
libraryDependencies ++= CoreTestDependencies,
Expand Down Expand Up @@ -99,21 +100,9 @@ lazy val jdbc = (project in file("jdbc"))
)
.dependsOn(core % "test->test;compile->compile")

lazy val config_z = (project in file("config-z"))
.enablePlugins(BuildInfoPlugin)
.settings(commonSettings: _*)
.settings(
name := "scala-utils-config-z",
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoOptions := Seq[BuildInfoOption](BuildInfoOption.BuildTime, BuildInfoOption.ToMap, BuildInfoOption.ToJson),
buildInfoPackage := "org.tupol.utils.config",
libraryDependencies ++= ConfigZDependencies
)
.dependsOn(core % "test->test;compile->compile")

lazy val scala_utils = Project(
id = "scala-utils",
base = file(".")
).settings(commonSettings: _*)
.dependsOn(core % "test->test;compile->compile", jdbc, config_z)
.aggregate(core, jdbc, config_z)
.dependsOn(core % "test->test;compile->compile", jdbc)
.aggregate(core, jdbc)
Loading

0 comments on commit 8e8a561

Please sign in to comment.