Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala 3 compatible SBT Plugin #736

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions .github/workflows/sbt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
scalajs: ["1.16.0"]
java: ["openjdk@1.17.0", "graalvm@"]
scalajs: ["1.18.2"]
es2015_enabled: ["false", "true"]
steps:
- name: Configure git to disable Windows line feeds
run: "git config --global core.autocrlf false"
shell: bash
- uses: actions/checkout@master
- name: Set up JDK 1.8 and SBT
uses: olafurpg/setup-scala@v10
- name: Set up JDK and SBT
uses: olafurpg/setup-scala@v14
with:
java-version: 1.8
java-version: ${{ matrix.java }}
- name: Style checks
run: sbt styleCheck
- name: Install NPM Dependencies
Expand All @@ -47,10 +48,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up JDK 1.8 and SBT
uses: olafurpg/setup-scala@v10
- name: Set up JDK and SBT
uses: olafurpg/setup-scala@v14
with:
java-version: 1.8
java-version: openjdk@1.17.0
- name: Build Docs Site
run: sbt docs/fullLinkJS
- name: Export Next.js
Expand All @@ -59,21 +60,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up JDK 1.8 and SBT
uses: olafurpg/setup-scala@v10
- name: Set up JDK and SBT
uses: olafurpg/setup-scala@v14
with:
java-version: 1.8
java-version: openjdk@1.17.0
- name: Build IntelliJ Plugin
run: sbt coreIntellijSupport/updateIntellij coreIntellijSupport/compile
publish:
needs: [test, build-docs, build-intellij-plugin]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up JDK 1.8 and SBT
uses: olafurpg/setup-scala@v10
- name: Set up JDK and SBT
uses: olafurpg/setup-scala@v14
with:
java-version: 1.8
java-version: openjdk@1.17.0
- run: git fetch --unshallow
- name: Publish with SBT
run: export JAVA_OPTS="-Xmx4g" && bash ./publish.sh
Expand All @@ -87,10 +88,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up JDK 1.8 and SBT
uses: olafurpg/setup-scala@v10
- name: Set up JDK and SBT
uses: olafurpg/setup-scala@v14
with:
java-version: 1.8
java-version: openjdk@1.17.0
- run: git fetch --unshallow
- name: Publish to Marketplace
run: sbt coreIntellijSupport/updateIntellij coreIntellijSupport/packageArtifact coreIntellijSupport/packageArtifact coreIntellijSupport/publishAutoChannel
Expand Down
25 changes: 15 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import _root_.io.github.davidgregory084._
import org.typelevel.scalacoptions.ScalacOptions
import org.typelevel.sbt.tpolecat.DevMode

ThisBuild / organization := "me.shadaj"

addCommandAlias("style", "compile:scalafix; test:scalafix; compile:scalafmt; test:scalafmt; scalafmtSbt")
addCommandAlias("style", "compile:scalafmt; test:scalafmt; scalafmtSbt")
addCommandAlias(
"styleCheck",
"compile:scalafix --check; test:scalafix --check; compile:scalafmtCheck; test:scalafmtCheck; scalafmtSbtCheck"
"compile:scalafmtCheck; test:scalafmtCheck; scalafmtSbtCheck"
)

val scala212 = "2.12.19"
val scala212 = "2.12.20"
val scala213 = "2.13.16"
val scala3 = "3.3.3"
val scala3 = "3.3.4"

ThisBuild / scalaVersion := scala213
ThisBuild / semanticdbEnabled := true
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
ThisBuild / semanticdbVersion := "4.13.4"

ThisBuild / tpolecatDefaultOptionsMode := DevMode
ThisBuild / tpolecatExcludeOptions += ScalacOptions.warnDeadCode
Expand Down Expand Up @@ -92,10 +93,14 @@ lazy val librarySettings = Seq(
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) =>
Seq(
"-source:3.0-migration"
"-source:3.0-migration",
"-Ysemanticdb"
)
case _ =>
Seq.empty
Seq(
"-Wconf:src=src_managed/.*:silent",
"-Yrangepos"
)
})
)

Expand Down Expand Up @@ -125,7 +130,7 @@ lazy val core = project
IO.write(
rootFolder / "intellij-compat.json",
s"""{
| "artifact": "me.shadaj % slinky-core-ijext_2.12 % ${version.value}"
| "artifact": "me.shadaj % slinky-core-ijext_2.13 % ${version.value}"
|}""".stripMargin
)

Expand Down Expand Up @@ -193,7 +198,7 @@ lazy val vr =
lazy val hot = project.settings(macroAnnotationSettings, librarySettings, crossScalaSettings).dependsOn(core)

val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.6.0")
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.18.4")

lazy val scalajsReactInterop = project
.settings(
Expand Down
1 change: 1 addition & 0 deletions core/project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=1.10.6
Loading