Skip to content

Commit

Permalink
Update build for new plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
RustedBones committed Oct 18, 2024
1 parent 4805e32 commit cf6c251
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
matrix:
os: [ubuntu-latest]
scala: [2.13]
java: [corretto@17]
java: [corretto@21]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
Expand All @@ -42,24 +42,24 @@ jobs:
with:
fetch-depth: 0

- name: Setup Java (corretto@17)
id: setup-java-corretto-17
if: matrix.java == 'corretto@17'
- name: Setup Java (corretto@21)
id: setup-java-corretto-21
if: matrix.java == 'corretto@21'
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
java-version: 21
cache: sbt

- name: sbt update
if: matrix.java == 'corretto@17' && steps.setup-java-corretto-17.outputs.cache-hit == 'false'
if: matrix.java == 'corretto@21' && steps.setup-java-corretto-21.outputs.cache-hit == 'false'
run: sbt +update

- name: Cache
uses: actions/cache@v4
with:
path: ~/.scio-ideaPluginIC
key: idea-2022.3.1
key: idea-242.2

- name: Check that workflows are up to date
run: sbt githubWorkflowCheck
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
java: [corretto@17]
java: [corretto@21]
runs-on: ${{ matrix.os }}
steps:
- name: Install sbt
Expand All @@ -101,24 +101,24 @@ jobs:
with:
fetch-depth: 0

- name: Setup Java (corretto@17)
id: setup-java-corretto-17
if: matrix.java == 'corretto@17'
- name: Setup Java (corretto@21)
id: setup-java-corretto-21
if: matrix.java == 'corretto@21'
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
java-version: 21
cache: sbt

- name: sbt update
if: matrix.java == 'corretto@17' && steps.setup-java-corretto-17.outputs.cache-hit == 'false'
if: matrix.java == 'corretto@21' && steps.setup-java-corretto-21.outputs.cache-hit == 'false'
run: sbt +update

- name: Cache
uses: actions/cache@v4
with:
path: ~/.scio-ideaPluginIC
key: idea-2022.3.1
key: idea-242.2

- name: Download target directories (2.13)
uses: actions/download-artifact@v4
Expand Down
17 changes: 9 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ lazy val Guava = "com.google.guava" % "guava" % "33.3.0-jre"
lazy val Scalatest = "org.scalatest" %% "scalatest" % "3.2.19"

// idea settings
lazy val intelliJVersion = "2022.3.1"
// https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#platformVersions
lazy val intellijBranchNumber = "242.2"
// https://www.jetbrains.com/idea/download/other.html
ThisBuild / intellijBuild := "242.20224.300"
ThisBuild / intellijPluginName := "scio-idea"
ThisBuild / intellijPlatform := IntelliJPlatform.IdeaCommunity
ThisBuild / intellijBuild := intelliJVersion

// project
ThisBuild / tlBaseVersion := "0.1"
ThisBuild / scalaVersion := "2.13.14"
ThisBuild / githubWorkflowTargetBranches := Seq("main")
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.corretto("17"))
ThisBuild / tlJdkRelease := Some(17)
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.corretto("21"))
ThisBuild / tlJdkRelease := Some(21)
ThisBuild / tlFatalWarnings := true
ThisBuild / tlCiHeaderCheck := true
ThisBuild / tlCiScalafmtCheck := true
Expand All @@ -60,7 +62,7 @@ ThisBuild / githubWorkflowGeneratedCacheSteps := Seq(
ref = cache,
params = Map(
"path" -> "~/.scio-ideaPluginIC",
"key" -> s"idea-$intelliJVersion"
"key" -> s"idea-$intellijBranchNumber"
)
)
)
Expand All @@ -76,14 +78,13 @@ lazy val scioIdeaPlugin: Project = project
intellijPlugins += "org.intellij.scala".toPlugin,
patchPluginXml := pluginXmlOptions { xml =>
xml.version = version.value
// https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html#platformVersions
xml.sinceBuild = "223" // for 2022.3
xml.sinceBuild = intellijBuild.value
},
pluginVerifierOptions := pluginVerifierOptions.value.copy(
// verify against latest IntelliJ IDEA Community
overrideIDEs = Seq(
intellijBaseDirectory.value.toString,
"[latest-IC]"
"[latest-release-IC]"
),
// allow experimental API usages
failureLevels = FailureLevel.ALL.asScala
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("org.jetbrains" % "sbt-idea-plugin" % "4.0.1")
addSbtPlugin("org.jetbrains" % "sbt-idea-plugin" % "4.0.1" withSources())
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.3")

0 comments on commit cf6c251

Please sign in to comment.