Skip to content

Commit

Permalink
Add support for slick 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gonmarques authored Aug 9, 2023
1 parent 9f52914 commit 7168e0d
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 310 deletions.
17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2.1
jobs:
build:
machine:
image: ubuntu-2004:202010-01
working_directory: ~/build
steps:
- checkout
- run:
name: Build and test
command: >
sbt compile &&
sbt "project db2" docker &&
sbt "project itsetup" dockerComposeUp &&
sbt coverage test coverageReport coveralls &&
sbt alldbs:test &&
sbt "project itsetup" dockerComposeStop
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/.idea/
target/
slick-repo.iml
src/docker/oracle-build/docker-images/
derbyDB/
derby.log
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
|Database|CI |Build status|
|--------|---|------------|
|MySQL, Oracle, DB2, PostgreSQL, Derby, H2, Hsql|Travis CI|[![Build status](https://travis-ci.org/gonmarques/slick-repo.svg?branch=master)](https://travis-ci.org/gonmarques/slick-repo)|
|MySQL, Oracle, DB2, PostgreSQL, Derby, H2, Hsql|CircleCI|[![Build status](https://circleci.com/gh/gonmarques/slick-repo.svg?style=shield)](https://circleci.com/gh/gonmarques/slick-repo)|
|SQLServer|AppVeyor|[![Build status](https://ci.appveyor.com/api/projects/status/3httes30fa1foes1/branch/master?svg=true)](https://ci.appveyor.com/project/gonmarques/slick-repo)|

[![Coverage Status](https://coveralls.io/repos/github/gonmarques/slick-repo/badge.svg?branch=master)](https://coveralls.io/github/gonmarques/slick-repo)   [![Latest Release](https://img.shields.io/badge/release-v1.6.1-007ec6.svg)](https://search.maven.org/#search%7Cga%7C1%7Cbyteslounge%20slick-repo)   [![MIT License](https://img.shields.io/badge/license-MIT-7c39ef.svg)](http://opensource.org/licenses/MIT)
[![Coverage Status](https://coveralls.io/repos/github/gonmarques/slick-repo/badge.svg?branch=master)](https://coveralls.io/github/gonmarques/slick-repo)   [![Latest Release](https://img.shields.io/badge/release-v1.7.1-007ec6.svg)](https://search.maven.org/#search%7Cga%7C1%7Cbyteslounge%20slick-repo)   [![MIT License](https://img.shields.io/badge/license-MIT-7c39ef.svg)](http://opensource.org/licenses/MIT)

# slick-repo

Expand All @@ -20,7 +20,7 @@ Slick Repositories is an aggregation of common database operations in ready-to-b
The library releases are available at [Maven Central](https://search.maven.org/#search%7Cga%7C1%7Cbyteslounge%20slick-repo) for Scala **2.10**, **2.11**, **2.12** and **2.13**. In order to add the library as a dependency to your project:

```scala
libraryDependencies += "com.byteslounge" %% "slick-repo" % "1.6.1"
libraryDependencies += "com.byteslounge" %% "slick-repo" % "1.7.1"
```

## Introduction
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ install:
Add-Type -AssemblyName System.IO.Compression.FileSystem
if (!(Test-Path -Path "C:\sbt" )) {
(new-object System.Net.WebClient).DownloadFile(
'https://dl.bintray.com/sbt/native-packages/sbt/0.13.11/sbt-0.13.11.zip',
'https://github.com/sbt/sbt/releases/download/v0.13.18/sbt-0.13.18.zip',
'C:\sbt.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\sbt.zip", "C:\sbt")
Expand Down
49 changes: 21 additions & 28 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import sbt.Keys._
import sbt._
import scoverage.ScoverageKeys._
import org.scoverage.coveralls.Imports.CoverallsKeys._
import com.typesafe.sbt.pgp.PgpKeys._

object Build extends Build {
Expand All @@ -33,7 +34,7 @@ object Build extends Build {

val dependencies = Seq(
"org.scalatest" %% "scalatest" % "3.0.8" % "test",
"com.h2database" % "h2" % "1.4.192" % "test",
"com.h2database" % "h2" % "2.2.220" % "test",
"mysql" % "mysql-connector-java" % "5.1.38" % "test",
"org.postgresql" % "postgresql" % "9.4.1211" % "test",
"org.slf4j" % "slf4j-simple" % "1.7.21" % "test",
Expand All @@ -44,18 +45,17 @@ object Build extends Build {

lazy val project: Project =
Project("root", file("."))
.configs(AllDbsTest, Db2Test, SqlServerTest)
.configs(AllDbsTest, SqlServerTest)
.settings(inConfig(AllDbsTest)(Defaults.testTasks): _*)
.settings(inConfig(Db2Test)(Defaults.testTasks): _*)
.settings(inConfig(SqlServerTest)(Defaults.testTasks): _*)
.settings(

name := "slick-repo",
description := "CRUD Repositories for Slick based persistence Scala projects",
version := "1.6.2-SNAPSHOT",
version := "1.7.1",

scalaVersion := "2.12.6",
crossScalaVersions := Seq("2.13.0", "2.12.6", "2.11.12", "2.10.7"),
crossScalaVersions := Seq("2.13.11", "2.12.6", "2.11.12", "2.10.7"),

libraryDependencies ++= dependencies,
libraryDependencies <++= scalaVersion (
Expand All @@ -70,10 +70,11 @@ object Build extends Build {
resolvers ++= dependencyResolvers,

parallelExecution in Test := false,

coverageEnabled := true,
coverallsToken := Some("w171Cv0CW3ekjA5ASwb0mzWcUDoNaw93X"),

testOptions in Test := Seq(Tests.Filter(baseFilter)),
testOptions in Db2Test := Seq(Tests.Filter(db2Filter)),
testOptions in AllDbsTest := Seq(Tests.Filter(allDbsFilter)),
testOptions in SqlServerTest := Seq(Tests.Filter(sqlServerFilter)),

Expand Down Expand Up @@ -135,16 +136,10 @@ object Build extends Build {

)

lazy val mysql: Project =
Project("mysql", file("src/docker/mysql"))
.settings(
name := "mysql"
)

lazy val oracleBuild: Project =
Project("oracle-build", file("src/docker/oracle-build"))
lazy val itsetup: Project =
Project("itsetup", file("src/docker/itsetup"))
.settings(
name := "oracle-build"
name := "itsetup"
)

lazy val db2: Project =
Expand All @@ -153,32 +148,30 @@ object Build extends Build {
name := "db2"
)

lazy val postgres: Project =
Project("postgres", file("src/docker/postgres"))
.settings(
name := "postgres"
)

val dbPrefixes = Seq("MySQL", "Oracle", "Postgres", "Derby", "Hsql")
val db2Prefix = Seq("DB2")
val dbPrefixes = Seq("MySQL", "Oracle", "Postgres", "Derby", "Hsql", "DB2")
val sqlServerPrefix = Seq("SQLServer")
lazy val AllDbsTest: Configuration = config("alldbs") extend Test
lazy val Db2Test: Configuration = config("db2") extend Test
lazy val SqlServerTest: Configuration = config("sqlserver") extend Test

def testName(name: String): String = name.substring(name.lastIndexOf('.') + 1)

def allDbsFilter(name: String): Boolean = dbPrefixes.exists(p => testName(name) startsWith p)

def db2Filter(name: String): Boolean = db2Prefix.exists(p => testName(name) startsWith p)

def sqlServerFilter(name: String): Boolean = sqlServerPrefix.exists(p => testName(name) startsWith p)

def baseFilter(name: String): Boolean = !allDbsFilter(name) && !db2Filter(name) && !sqlServerFilter(name)
def baseFilter(name: String): Boolean = !allDbsFilter(name) && !sqlServerFilter(name)

def getSlickDependency(slickComponent: String, version: String): ModuleID = {
"com.typesafe.slick" %
(slickComponent + "_" + version.substring(0, version.lastIndexOf('.'))) %
(if(version.startsWith("2.10")) {"3.1.1"} else {"3.3.2"})
(
if(version.startsWith("2.10")) {
"3.1.1"
} else if(version.startsWith("2.11")) {
"3.3.3"
} else {
"3.5.0-M4"
}
)
}
}
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.4.1")

addSbtPlugin("com.tapad" % "sbt-docker-compose" % "1.0.19")
addSbtPlugin("com.tapad" % "sbt-docker-compose" % "1.0.35")

addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "1.6.0")

Expand Down
5 changes: 1 addition & 4 deletions src/docker/db2/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,11 @@
*/

enablePlugins(DockerPlugin)
enablePlugins(com.tapad.docker.DockerComposePlugin)

dockerfile in docker := {
new sbtdocker.mutable.Dockerfile {
from("ibmcom/db2express-c:10.5.0.5-3.10.0")
from("ibmoms/db2express-c:10.5.0.5-3.10.0")
expose(50000)
copy(baseDirectory(_ / "start.sh").value, file("start.sh"))
}
}

dockerImageCreationTask := docker.value
32 changes: 0 additions & 32 deletions src/docker/db2/docker-compose.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
* SOFTWARE.
*/

addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.4.0")
enablePlugins(com.tapad.docker.DockerComposePlugin)
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,33 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

version: '3.3'
version: '3.2'
services:
mysql:
image: mysql/mysql
image: mysql:5.7.43
ports:
- "22222:3306"
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_DATABASE=SLICKREPO
oracle:
image: oracle/database:11.2.0.2-xe
image: gvenzl/oracle-xe:11
shm_size: '1gb'
ports:
- "22223:1521"
environment:
- ORACLE_PWD=oracle
- ORACLE_PASSWORD=oracle
postgres:
image: postgres/postgres
image: postgres:9.6.0
ports:
- "22225:5432"
environment:
- POSTGRES_PASSWORD=123456
db2:
image: db2/db2
ports:
- "22224:50000"
environment:
- DB2INST1_PASSWORD=345TrEdcvb
- LICENSE=accept
command: ./start.sh
File renamed without changes.
35 changes: 0 additions & 35 deletions src/docker/mysql/build.sbt

This file was deleted.

Loading

0 comments on commit 7168e0d

Please sign in to comment.