Skip to content

Commit b19179f

Browse files
authored
feature: Support Scala Native (#73)
* feature: Support Scala Native * clean: Drop Scala 2.11 * fix: Install clang in CI * fix: Scalatest dependency to use Scala Native dep
1 parent 5728bc8 commit b19179f

File tree

16 files changed

+37
-29
lines changed

16 files changed

+37
-29
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ workflows:
2121
- run:
2222
name: Compile
2323
command: sbt +compile
24+
- run:
25+
name: Install Clang for Scala Native
26+
command: sudo apt-get update && sudo apt-get install clang
2427
- run:
2528
name: Test
2629
command: sbt +test

build.sbt

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
1-
val scala211 = "2.11.12"
2-
val scala212 = "2.12.10"
1+
val scala212 = "2.12.17"
32
val scala213 = "2.13.10"
43
val scala3 = "3.2.2"
54

6-
name := "codacy-plugins-api"
7-
organization := "com.codacy"
8-
9-
scalaVersion := scala212
10-
11-
crossScalaVersions := Seq(scala211, scala212, scala213, scala3)
12-
13-
libraryDependencies ++= Seq("wordspec", "shouldmatchers").map(m => "org.scalatest" %% s"scalatest-$m" % "3.2.14" % Test)
14-
15-
Compile / unmanagedSourceDirectories += {
16-
val sourceDir = (sourceDirectory in Compile).value
17-
CrossVersion.partialVersion(scalaVersion.value) match {
18-
case Some((major, minor)) if major > 2 || minor >= 13 =>
19-
sourceDir / "scala-2.13+"
20-
case _ =>
21-
sourceDir / "scala-2.13-"
22-
}
23-
}
24-
25-
pgpPassphrase := Option(System.getenv("SONATYPE_GPG_PASSPHRASE")).map(_.toCharArray)
26-
27-
description := "A dependency free api for Codacy Tools"
28-
29-
scmInfo := Some(
30-
ScmInfo(url("https://github.com/codacy/codacy-plugins-api"), "scm:git:[email protected]:codacy/codacy-plugins-api.git"))
31-
32-
publicMvnPublish
5+
ThisBuild / scalaVersion := scala212
6+
ThisBuild / crossScalaVersions := Seq(scala212, scala213, scala3)
7+
8+
lazy val `codacy-plugins-api` =
9+
crossProject(JVMPlatform, NativePlatform)
10+
.crossType(CrossType.Pure)
11+
.settings(name := "codacy-plugins-api",
12+
organization := "com.codacy",
13+
libraryDependencies ++= Seq("wordspec", "shouldmatchers").map(m =>
14+
"org.scalatest" %%% s"scalatest-$m" % "3.2.14" % Test),
15+
Compile / unmanagedSourceDirectories += {
16+
val sourceDir = (ThisBuild / baseDirectory).value / name.value / "src" / "main"
17+
CrossVersion.partialVersion(scalaVersion.value) match {
18+
case Some((major, minor)) if major > 2 || minor >= 13 =>
19+
sourceDir / "scala-2.13+"
20+
case _ =>
21+
sourceDir / "scala-2.13-"
22+
}
23+
},
24+
pgpPassphrase := Option(System.getenv("SONATYPE_GPG_PASSPHRASE")).map(_.toCharArray),
25+
description := "A dependency free api for Codacy Tools",
26+
scmInfo := Some(
27+
ScmInfo(url("https://github.com/codacy/codacy-plugins-api"),
28+
"scm:git:[email protected]:codacy/codacy-plugins-api.git")),
29+
publicMvnPublish)
30+
31+
lazy val root =
32+
project
33+
.in(file("."))
34+
.settings(publish / skip := true)
35+
.aggregate(`codacy-plugins-api`.jvm, `codacy-plugins-api`.native)

0 commit comments

Comments
 (0)