Skip to content

Commit 94fd504

Browse files
committed
Fixed generation issues with SBT Plugin
1 parent 4455d42 commit 94fd504

File tree

34 files changed

+1351
-992
lines changed

34 files changed

+1351
-992
lines changed

.github/workflows/sbt.yml

Lines changed: 63 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,23 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
os: [ubuntu-latest, windows-latest]
18-
scalajs: ["1.16.0"]
18+
java:
19+
- { distribution: temurin, version: 17 }
20+
- { distribution: graalvm, version: 21 }
21+
scalajs: ["1.19.0"]
1922
es2015_enabled: ["false", "true"]
2023
steps:
2124
- name: Configure git to disable Windows line feeds
2225
run: "git config --global core.autocrlf false"
2326
shell: bash
24-
- uses: actions/checkout@master
25-
- name: Set up JDK 1.8 and SBT
26-
uses: olafurpg/setup-scala@v10
27+
- uses: actions/checkout@v4
28+
- name: Set up JDK
29+
uses: actions/setup-java@v4
2730
with:
28-
java-version: 1.8
31+
distribution: ${{ matrix.java.distribution }}
32+
java-version: ${{ matrix.java.version }}
33+
- name: Set up SBT
34+
uses: sbt/setup-sbt@v1
2935
- name: Style checks
3036
run: sbt styleCheck
3137
- name: Install NPM Dependencies
@@ -46,54 +52,66 @@ jobs:
4652
build-docs:
4753
runs-on: ubuntu-latest
4854
steps:
49-
- uses: actions/checkout@master
50-
- name: Set up JDK 1.8 and SBT
51-
uses: olafurpg/setup-scala@v10
52-
with:
53-
java-version: 1.8
54-
- name: Build Docs Site
55-
run: sbt docs/fullLinkJS
56-
- name: Export Next.js
57-
run: cd docs && npm install && npm run export
55+
- uses: actions/checkout@v4
56+
- name: Set up JDK
57+
uses: actions/setup-java@v4
58+
with:
59+
distribution: temurin
60+
java-version: 17
61+
- name: Set up SBT
62+
uses: sbt/setup-sbt@v1
63+
- name: Build Docs Site
64+
run: sbt docs/fullLinkJS
65+
- name: Export Next.js
66+
run: cd docs && npm install && npm run export
5867
build-intellij-plugin:
5968
runs-on: ubuntu-latest
6069
steps:
61-
- uses: actions/checkout@master
62-
- name: Set up JDK 1.8 and SBT
63-
uses: olafurpg/setup-scala@v10
64-
with:
65-
java-version: 1.8
66-
- name: Build IntelliJ Plugin
67-
run: sbt coreIntellijSupport/updateIntellij coreIntellijSupport/compile
70+
- uses: actions/checkout@v4
71+
- name: Set up JDK
72+
uses: actions/setup-java@v4
73+
with:
74+
distribution: temurin
75+
java-version: 17
76+
- name: Set up SBT
77+
uses: sbt/setup-sbt@v1
78+
- name: Build IntelliJ Plugin
79+
run: sbt coreIntellijSupport/updateIntellij coreIntellijSupport/compile
6880
publish:
6981
needs: [test, build-docs, build-intellij-plugin]
7082
runs-on: ubuntu-latest
7183
steps:
72-
- uses: actions/checkout@master
73-
- name: Set up JDK 1.8 and SBT
74-
uses: olafurpg/setup-scala@v10
75-
with:
76-
java-version: 1.8
77-
- run: git fetch --unshallow
78-
- name: Publish with SBT
79-
run: export JAVA_OPTS="-Xmx4g" && bash ./publish.sh
80-
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
81-
env:
82-
encrypted_key: ${{ secrets.key }}
83-
encrypted_iv: ${{ secrets.iv }}
84-
PGP_PASSPHRASE: ${{ secrets.pgp_passphrase }}
84+
- uses: actions/checkout@v4
85+
- name: Set up JDK
86+
uses: actions/setup-java@v4
87+
with:
88+
distribution: temurin
89+
java-version: 17
90+
- name: Set up SBT
91+
uses: sbt/setup-sbt@v1
92+
- run: git fetch --unshallow
93+
- name: Publish with SBT
94+
run: export JAVA_OPTS="-Xmx4g" && bash ./publish.sh
95+
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
96+
env:
97+
encrypted_key: ${{ secrets.key }}
98+
encrypted_iv: ${{ secrets.iv }}
99+
PGP_PASSPHRASE: ${{ secrets.pgp_passphrase }}
85100
publish-intellij-plugin:
86101
needs: [test, build-docs, build-intellij-plugin]
87102
runs-on: ubuntu-latest
88103
steps:
89-
- uses: actions/checkout@master
90-
- name: Set up JDK 1.8 and SBT
91-
uses: olafurpg/setup-scala@v10
92-
with:
93-
java-version: 1.8
94-
- run: git fetch --unshallow
95-
- name: Publish to Marketplace
96-
run: sbt coreIntellijSupport/updateIntellij coreIntellijSupport/packageArtifact coreIntellijSupport/packageArtifact coreIntellijSupport/publishAutoChannel
97-
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
98-
env:
99-
IJ_PLUGIN_REPO_TOKEN: ${{ secrets.ij_plugin_repo_token }}
104+
- uses: actions/checkout@v4
105+
- name: Set up JDK
106+
uses: actions/setup-java@v4
107+
with:
108+
distribution: temurin
109+
java-version: 17
110+
- name: Set up SBT
111+
uses: sbt/setup-sbt@v1
112+
- run: git fetch --unshallow
113+
- name: Publish to Marketplace
114+
run: sbt coreIntellijSupport/updateIntellij coreIntellijSupport/packageArtifact coreIntellijSupport/packageArtifact coreIntellijSupport/publishAutoChannel
115+
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
116+
env:
117+
IJ_PLUGIN_REPO_TOKEN: ${{ secrets.ij_plugin_repo_token }}

build.sbt

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
import _root_.io.github.davidgregory084._
1+
import org.typelevel.scalacoptions.ScalacOptions
2+
import org.typelevel.sbt.tpolecat.DevMode
23

34
ThisBuild / organization := "me.shadaj"
45

5-
addCommandAlias("style", "compile:scalafix; test:scalafix; compile:scalafmt; test:scalafmt; scalafmtSbt")
6+
addCommandAlias("style", "compile:scalafmt; test:scalafmt; scalafmtSbt")
67
addCommandAlias(
78
"styleCheck",
8-
"compile:scalafix --check; test:scalafix --check; compile:scalafmtCheck; test:scalafmtCheck; scalafmtSbtCheck"
9+
"compile:scalafmtCheck; test:scalafmtCheck; scalafmtSbtCheck"
910
)
1011

11-
val scala212 = "2.12.19"
12+
val scala212 = "2.12.20"
1213
val scala213 = "2.13.16"
13-
val scala3 = "3.3.3"
14+
val scala3 = "3.3.6"
1415

1516
ThisBuild / scalaVersion := scala213
1617
ThisBuild / semanticdbEnabled := true
17-
ThisBuild / semanticdbVersion := scalafixSemanticdb.revision
18+
ThisBuild / semanticdbVersion := "4.13.6"
1819

1920
ThisBuild / tpolecatDefaultOptionsMode := DevMode
2021
ThisBuild / tpolecatExcludeOptions += ScalacOptions.warnDeadCode
@@ -47,7 +48,6 @@ addCommandAlias(
4748

4849
lazy val crossScalaSettings = Seq(
4950
crossScalaVersions := Seq(scala212, scala213, scala3),
50-
scalacOptions += "-Wconf:cat=unused-nowarn:s",
5151
Compile / unmanagedSourceDirectories ++= {
5252
val sourceDir = (Compile / sourceDirectory).value
5353
CrossVersion.partialVersion(scalaVersion.value) match {
@@ -92,10 +92,20 @@ lazy val librarySettings = Seq(
9292
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
9393
case Some((3, _)) =>
9494
Seq(
95-
"-source:3.0-migration"
95+
"-source:3.0-migration",
96+
"-Wconf:src=src_managed/.*:silent",
97+
"-Ysemanticdb"
98+
)
99+
case Some((2, n)) if n >= 13 =>
100+
Seq(
101+
"-Wconf:cat=unused-nowarn:s",
102+
"-Ytasty-reader"
96103
)
97104
case _ =>
98-
Seq.empty
105+
Seq(
106+
"-Wconf:cat=unused-nowarn:s",
107+
"-Yrangepos"
108+
)
99109
})
100110
)
101111

@@ -125,7 +135,7 @@ lazy val core = project
125135
IO.write(
126136
rootFolder / "intellij-compat.json",
127137
s"""{
128-
| "artifact": "me.shadaj % slinky-core-ijext_2.12 % ${version.value}"
138+
| "artifact": "me.shadaj % slinky-core-ijext_2.13 % ${version.value}"
129139
|}""".stripMargin
130140
)
131141

@@ -193,7 +203,7 @@ lazy val vr =
193203
lazy val hot = project.settings(macroAnnotationSettings, librarySettings, crossScalaSettings).dependsOn(core)
194204

195205
val scalaJSVersion =
196-
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.6.0")
206+
Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.19.0")
197207

198208
lazy val scalajsReactInterop = project
199209
.settings(

core/build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ enablePlugins(ScalaJSPlugin)
22

33
name := "slinky-core"
44

5+
libraryDependencies += "org.scala-js" %%% "scala-js-macrotask-executor" % "1.1.1"
56
libraryDependencies ++= {
67
CrossVersion.partialVersion(scalaVersion.value) match {
78
case Some((2, _)) =>

core/project/build.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=1.10.11

0 commit comments

Comments
 (0)