Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Commit

Permalink
Merge pull request #10 from jan0sch/cross-build-for-2_13
Browse files Browse the repository at this point in the history
Enable cross building for Scala 2.11, 2.12 & 2.13
  • Loading branch information
jan0sch authored Feb 6, 2020
2 parents 70d47f2 + 4d0a857 commit 12ab23e
Show file tree
Hide file tree
Showing 33 changed files with 285 additions and 148 deletions.
77 changes: 47 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,54 @@
# sbt
lib_managed
project/project
target

# Worksheets (Eclipse or IntelliJ)
*.sc

# Eclipse
.cache*
.classpath
.project
.scala_dependencies
.settings
.target
.worksheet

# IntelliJ
.idea

# ENSIME
.ensime
.ensime_lucene
.ensime_cache

# Mac
.DS_Store

# Bloop
.bloop/
# Emacs
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
.elc
auto-save-list
tramp
# IntelliJ Idea
*.iml
*.ipr
*.iws
.idea/
# Logfiles and rotated logfiles.
*.log
*.log.[0-9]*
# MacOS
*.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Metals
.metals/
project/metals.sbt
# SBT
target/
lib_managed/
src_managed/
project/boot/
.history
.cache
# Vim
.*.sw[a-z]
*.un~
Session.vim

/tags
# Windows
Thumbs.db
Desktop.ini

4 changes: 2 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
version = "2.3.2"
# Default style with align.
style = defaultWithAlign
# Other options...
danglingParentheses = true
indentOperator = spray
indentOperator = akka
maxColumn = 100
project.excludeFilters = [".*\\.sbt"]
project.git = true
Expand All @@ -14,4 +15,3 @@ rewriteTokens = {
}
spaces.inImportCurlyBraces = true
unindentTopLevelOperators = true

6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
language: scala
scala:
- 2.11.12
- 2.12.4
- 2.12.10
- 2.13.1
jdk:
- oraclejdk8
- openjdk8
- openjdk11
script:
- sbt clean coverage test coverageReport
after_success:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ Please follow the listed conventions when editing this file:

## Unreleased

## 3.0.1 (2020-02-06)

- cross publish for Scala 2.11, 2.12 and 2.13
- adjust compiler settings
- update copyright headers

## 3.0.0 (2017-10-06)

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ automatically.
This repository contains the utils module which provides helpful functions
and data types. It depends on the dfasdl-core package.

It is cross build for scala 2.11 and 2.12.
It is cross build for scala 2.11, 2.12 and 2.13.

Releases are published on bintray and should be synced to jcenter. To use
the bintray repository directly just add the appropriate resolver to your
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
* Copyright (C) 2014 - 2020 Contributors as noted in the AUTHORS.md file
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
Expand Down
156 changes: 121 additions & 35 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ lazy val dfasdlUtils =
.settings(
name := "dfasdl-utils",
libraryDependencies ++= Seq(
library.cats,
library.dfasdlCore,
library.shapeless,
library.jaxbApi,
library.scalaCheck % Test,
library.scalaCheckTbDT % Test,
library.scalaTest % Test
Expand All @@ -48,7 +47,8 @@ lazy val benchmarks =
"-Xmx2g",
"-XX:MaxMetaspaceSize=1g"
),
fork in run := true
fork in run := true,
wartremoverWarnings in (Compile, compile) := Seq()
)
.dependsOn(dfasdlUtils)

Expand All @@ -71,21 +71,19 @@ def makeAgentOptions(cp: Classpath): Seq[String] = {
lazy val library =
new {
object Version {
val cats = "0.9.0"
val dfasdlCore = "1.0"
val dfasdlCore = "1.0.1"
val jai = "3.0.1"
val jamm = "0.3.2"
val scalaCheck = "1.13.5"
val scalaCheckTb = "0.2.2"
val scalaTest = "3.0.4"
val shapeless = "2.3.2"
val jaxbApi = "2.3.2" // Disabled in JDK 9+, Removed in 11+
val scalaCheck = "1.14.3"
val scalaCheckTb = "0.3.1"
val scalaTest = "3.0.8"
}
val cats = "org.typelevel" %% "cats" % Version.cats
val dfasdlCore = "org.dfasdl" %% "dfasdl-core" % Version.dfasdlCore
val jaxbApi = "jakarta.xml.bind" % "jakarta.xml.bind-api" % Version.jaxbApi
val scalaCheck = "org.scalacheck" %% "scalacheck" % Version.scalaCheck
val scalaCheckTbDT = "com.47deg" %% "scalacheck-toolbox-datetime" % Version.scalaCheckTb
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
val shapeless = "com.chuusai" %% "shapeless" % Version.shapeless
// Dependencies for instrumenting and profiling.
val jai = "com.google.code.java-allocation-instrumenter" % "java-allocation-instrumenter" % Version.jai
val jamm = "com.github.jbellis" % "jamm" % Version.jamm
Expand All @@ -103,40 +101,131 @@ publishSettings ++
resolverSettings ++
scalafmtSettings

lazy val commonSettings =
Seq(
scalaVersion in ThisBuild := "2.12.4",
crossScalaVersions := Seq("2.12.4", "2.11.12"),
organization := "org.dfasdl",
organizationName := "Wegtam GmbH",
startYear := Option(2014),
licenses += ("AGPL-V3", url("https://www.gnu.org/licenses/agpl.html")),
headerLicense := Some(
HeaderLicense.AGPLv3(s"2014 - $currentYear", "Contributors as noted in the AUTHORS.md file")
),
scalacOptions ++= Seq(
def compilerSettings(sv: String) =
CrossVersion.partialVersion(sv) match {
case Some((2, 13)) =>
Seq(
"-deprecation",
"-explaintypes",
"-feature",
"-language:higherKinds",
"-unchecked",
"-Xcheckinit",
"-Xfatal-warnings",
"-Xlint:adapted-args",
"-Xlint:constant",
"-Xlint:delayedinit-select",
"-Xlint:doc-detached",
"-Xlint:inaccessible",
"-Xlint:infer-any",
"-Xlint:missing-interpolator",
"-Xlint:nullary-override",
"-Xlint:nullary-unit",
"-Xlint:option-implicit",
"-Xlint:package-object-classes",
"-Xlint:poly-implicit-overload",
"-Xlint:private-shadow",
"-Xlint:stars-align",
"-Xlint:type-parameter-shadow",
"-Ywarn-dead-code",
"-Ywarn-extra-implicit",
"-Ywarn-numeric-widen",
"-Ywarn-unused:implicits",
"-Ywarn-unused:imports",
"-Ywarn-unused:locals",
"-Ywarn-unused:params",
"-Ywarn-unused:patvars",
"-Ywarn-unused:privates",
"-Ywarn-value-discard",
"-Ycache-plugin-class-loader:last-modified",
"-Ycache-macro-class-loader:last-modified",
)
case Some((2, 11)) =>
Seq(
"-deprecation",
"-encoding", "UTF-8",
"-explaintypes",
"-feature",
"-language:_",
"-language:higherKinds",
"-target:jvm-1.8",
"-unchecked",
"-Xcheckinit",
"-Xfatal-warnings",
"-Xfuture",
"-Xlint",
"-Xlint:adapted-args",
"-Xlint:by-name-right-associative",
"-Xlint:delayedinit-select",
"-Xlint:doc-detached",
"-Xlint:inaccessible",
"-Xlint:infer-any",
"-Xlint:missing-interpolator",
"-Xlint:nullary-override",
"-Xlint:nullary-unit",
"-Xlint:option-implicit",
"-Xlint:package-object-classes",
"-Xlint:poly-implicit-overload",
"-Xlint:private-shadow",
"-Xlint:stars-align",
"-Xlint:type-parameter-shadow",
"-Xlint:unsound-match",
"-Ydelambdafy:method",
// "-Ypartial-unification",
"-Yno-adapted-args",
"-Xmax-classfile-name", "78", // Workaround for SI-3623.
"-Ypartial-unification",
"-Ywarn-numeric-widen",
"-Ywarn-unused-import",
"-Ywarn-value-discard"
)
case _ =>
Seq(
"-deprecation",
"-encoding", "UTF-8",
"-explaintypes",
"-feature",
"-language:higherKinds",
"-target:jvm-1.8",
"-unchecked",
"-Xcheckinit",
"-Xfatal-warnings",
"-Xfuture",
"-Xlint:adapted-args",
"-Xlint:by-name-right-associative",
"-Xlint:constant",
"-Xlint:delayedinit-select",
"-Xlint:doc-detached",
"-Xlint:inaccessible",
"-Xlint:infer-any",
"-Xlint:missing-interpolator",
"-Xlint:nullary-override",
"-Xlint:nullary-unit",
"-Xlint:option-implicit",
"-Xlint:package-object-classes",
"-Xlint:poly-implicit-overload",
"-Xlint:private-shadow",
"-Xlint:stars-align",
"-Xlint:type-parameter-shadow",
"-Xlint:unsound-match",
"-Ydelambdafy:method",
"-Yno-adapted-args",
"-Ypartial-unification",
"-Ywarn-numeric-widen",
"-Ywarn-unused-import",
"-Ywarn-value-discard"
)
}

lazy val commonSettings =
Seq(
scalaVersion in ThisBuild := "2.13.1",
crossScalaVersions := Seq(scalaVersion.value, "2.12.10", "2.11.12"),
organization := "org.dfasdl",
organizationName := "Wegtam GmbH",
startYear := Option(2014),
licenses += ("AGPL-V3", url("https://www.gnu.org/licenses/agpl.html")),
headerLicense := Some(
HeaderLicense.AGPLv3(s"2014 - $currentYear", "Contributors as noted in the AUTHORS.md file")
),
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 11)) => Seq("-Xmax-classfile-name", "78") // Workaround for SI-3623.
case _ => Seq()
}
},
scalacOptions ++= compilerSettings(scalaVersion.value),
unmanagedSourceDirectories.in(Compile) := Seq(scalaSource.in(Compile).value),
unmanagedSourceDirectories.in(Test) := Seq(scalaSource.in(Test).value),
wartremoverWarnings in (Compile, compile) ++= Warts.unsafe
Expand Down Expand Up @@ -186,7 +275,4 @@ lazy val resolverSettings =
lazy val scalafmtSettings =
Seq(
scalafmtOnCompile := true,
scalafmtOnCompile.in(Sbt) := false,
scalafmtVersion := "1.3.0"
)

2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.2.1
sbt.version = 1.3.8
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.1")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.4.0")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.3")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.12")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.0")
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.2.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.0")
addSbtPlugin("org.wartremover" % "sbt-wartremover" % "2.4.3")

libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.25" // Needed by sbt-git

2 changes: 1 addition & 1 deletion src/main/scala/org/dfasdl/utils/AttributeNames.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 - 2017 Contributors as noted in the AUTHORS.md file
* Copyright (C) 2014 - 2020 Contributors as noted in the AUTHORS.md file
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
Expand Down
Loading

0 comments on commit 12ab23e

Please sign in to comment.