Skip to content

Commit

Permalink
adds support for Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
vagmcs committed Sep 8, 2024
1 parent 3292dae commit 563ade9
Show file tree
Hide file tree
Showing 49 changed files with 180 additions and 206 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ release: build
@gh release create v"${PROJECT_VERSION}" -F "docs/release_notes/${PROJECT_VERSION}.md" \
./target/scala-2.12/scalatikz_2.12-${PROJECT_VERSION}.jar \
./target/scala-2.13/scalatikz_2.13-${PROJECT_VERSION}.jar \
./target/scala-3.5.0/scalatikz_3-${PROJECT_VERSION}.jar \
./target/universal/ScalaTIKZ-${PROJECT_VERSION}.zip
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ScalaTIKZ is an open-source library for publication quality [PGF/TIKZ](https://e
7. High level API for declaring plot types and subplots.
8. Save generated graphics as TeX, PDF, JPEG or PNG formats.
9. Command line interface that can be used in any Unix/Linux shell script.
10. Works on the [Almond](https://github.com/almond-sh/almond) kernel.

<table>
<tr>
Expand All @@ -41,7 +40,7 @@ For more details please read the [Requirements](docs/requirements.md).

## How to get ScalaTIKZ

ScalaTIKZ is published to Maven Central for Scala 2.12 and 2.13.
ScalaTIKZ is published to Maven Central for Scala 2.12, 2.13 and 3.5.0.

Add the following dependency to your SBT build file in order to get started:

Expand Down
10 changes: 4 additions & 6 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ import sbt._
object Dependencies {

object v {
final val Logback = "1.2.11"
final val Logback = "1.5.8"
final val ScalaLogging = "3.9.5"

final val ScalaTest = "3.2.15"
final val ScalaCheck = "1.17.0"
final val ScalaTest = "3.2.19"
final val ScalaCheck = "1.18.0"

final val ScalaOpt = "4.1.0"
final val PDFBox = "2.0.27"
final val CSVParser = "2.9.1"
final val Ammonite = "0.13.3"
}

// Logging using slf4j and logback
Expand All @@ -42,7 +41,6 @@ object Dependencies {
lazy val Commons: Seq[ModuleID] = Seq(
"com.github.scopt" %% "scopt" % v.ScalaOpt,
"org.apache.pdfbox" % "pdfbox-tools" % v.PDFBox,
"com.univocity" % "univocity-parsers" % v.CSVParser,
"sh.almond" % "scala-kernel-api" % v.Ammonite % Provided cross CrossVersion.full
"com.univocity" % "univocity-parsers" % v.CSVParser
)
}
14 changes: 10 additions & 4 deletions project/ScalaTIKZBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ object ScalaTIKZBuild extends AutoPlugin {
maintainer := "Evangelos Michelioudakis",
headerLicense := Some(HeaderLicense.Custom(logo)),
headerMappings := headerMappings.value + (HeaderFileType.scala -> HeaderCommentStyle.cStyleBlockComment),
scalaVersion := "2.13.10",
crossScalaVersions := Seq("2.13.10", "2.12.17"),
scalaVersion := "3.5.0",
crossScalaVersions := Seq("3.5.0", "2.13.14", "2.12.20"),
autoScalaLibrary := true,
managedScalaInstance := true,
publishMavenStyle := true,
Expand All @@ -79,8 +79,6 @@ object ScalaTIKZBuild extends AutoPlugin {
Resolver.sonatypeOssRepos("releases"),
Resolver.sonatypeOssRepos("snapshots")
).flatten,
libraryDependencies +=
"org.scala-lang" % "scala-library" % scalaVersion.value,
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots")
Expand Down Expand Up @@ -139,6 +137,14 @@ object ScalaTIKZBuild extends AutoPlugin {
"-language:implicitConversions"
)

case "3" =>
// Scala compiler settings for Scala 3.x
Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:implicitConversions"
)
case _ => sys.error(s"Unsupported version of Scala '${scalaBinaryVersion.value}'")
}
}
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.8.2
sbt.version = 1.10.1
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.9")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.4")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.17")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.11.3")

addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")

addSbtPlugin("com.scalapenos" % "sbt-prompt" % "1.0.2")

addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")

addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")

addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.6.4")

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scalatikz/app/AppCLI.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* /___/\__/\_,_/_/\_,_//_/ /___/_/|_| /___/
*
* A PGF/TIKZ plot library for Scala.
*
*
*/

package scalatikz.app
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/scalatikz/app/Conf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* /___/\__/\_,_/_/\_,_//_/ /___/_/|_| /___/
*
* A PGF/TIKZ plot library for Scala.
*
*
*/

package scalatikz.app
Expand Down
Loading

0 comments on commit 563ade9

Please sign in to comment.