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

House cleaning - bump versions #73

Open
wants to merge 5 commits 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
7 changes: 4 additions & 3 deletions .github/workflows/sourcegraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ jobs:
name: "Upload LSIF"
steps:
- uses: actions/checkout@v2
- uses: coursier/setup-[email protected]
- uses: actions/setup-java@v3
with:
jvm: adopt:8
distribution: "temurin"
java-version: 8
- run: |
cs launch com.sourcegraph:scip-java_2.13:latest.stable -M com.sourcegraph.scip_java.ScipJava -- index
./src/main/resources/sbt-sourcegraph/coursier launch com.sourcegraph:scip-java_2.13:latest.stable -M com.sourcegraph.scip_java.ScipJava -- index
- run: yarn global add @sourcegraph/src
- run: |
src code-intel upload "-commit=${GITHUB_SHA}" "-github-token=${GITHUB_TOKEN}"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ out/
test-report.json
dump.lsif
index.scip
.bsp/
4 changes: 2 additions & 2 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version = "2.7.5"
runner.dialect=scala213
version = "3.7.3"
assumeStandardLibraryStripMargin = true
docstrings = JavaDoc
project.git=true
project.excludeFilters = [
".*scala-3*"
Expand Down
19 changes: 7 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,12 @@ import scala.jdk.CollectionConverters._
import java.util.Properties
import com.sourcegraph.sbtsourcegraph.Versions

val V = new {
def scala212 = "2.12.12"
def scalameta = "4.4.25"
}

scalaVersion := V.scala212
scalaVersion := Versions.scala212
ThisBuild / scalafixDependencies += "com.github.liancheng" %% "organize-imports" % "0.5.0-alpha.1"
ThisBuild / versionScheme := Some("early-semver")
organization := "com.sourcegraph"
semanticdbEnabled := !scalaVersion.value.startsWith("2.10")
semanticdbVersion := "4.4.26"
semanticdbVersion := Versions.scalametaVersion
homepage := Some(url("https://github.com/sourcegraph/sbt-sourcegraph"))
licenses := List(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")
Expand All @@ -39,8 +34,6 @@ commands +=
}

// Cross-building settings (see https://github.com/sbt/sbt/issues/3473#issuecomment-325729747)
def scala212 = "2.12.13"
def scala210 = "2.10.7"

sbtPlugin := true
moduleName := "sbt-sourcegraph"
Expand All @@ -51,14 +44,16 @@ Compile / resourceGenerators += Def.task {
if (!out.exists()) {
val versions = Versions.semanticdbVersionsByScalaVersion()
val props = new Properties()
props.putAll(versions.asJava)
versions.foreach { case (scalaVersion, semanticdbVersion) =>
props.put(scalaVersion, semanticdbVersion)
}
IO.write(props, "SemanticDB versions grouped by Scala version.", out)
}
List(out)
}
crossScalaVersions := Seq(scala212, scala210)
crossScalaVersions := Seq(Versions.scala212, Versions.scala210)
scalacOptions ++= {
if (scalaVersion.value == scala210) List()
if (scalaVersion.value == Versions.scala210) List()
else List("-Xlint:unused")
}

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.5.2
sbt.version=1.8.2
7 changes: 3 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.5")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.3")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.4.9-22-2d02726c")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.10.4")

libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Adaptation of the `scalafixEnable` command from sbt-scalafix with the following modifications:
* - use older SemanticDB versions instead of upgrading the Scala version.
* - configure the semanticdb-javac compiler plugin for Java projects.
* Original license: Apache 2
* Original source: https://github.com/scalacenter/sbt-scalafix/blob/cdee753f15bde75d84d93c26695d14fc3ec964f8/src/main/scala/scalafix/sbt/ScalafixEnable.scala
*/
/** Adaptation of the `scalafixEnable` command from sbt-scalafix with the
* following modifications:
* - use older SemanticDB versions instead of upgrading the Scala version.
* - configure the semanticdb-javac compiler plugin for Java projects.
* Original license: Apache 2 Original source:
* https://github.com/scalacenter/sbt-scalafix/blob/cdee753f15bde75d84d93c26695d14fc3ec964f8/src/main/scala/scalafix/sbt/ScalafixEnable.scala
*/
package com.sourcegraph.sbtsourcegraph

import sbt._
Expand Down
12 changes: 8 additions & 4 deletions src/main/scala/com/sourcegraph/sbtsourcegraph/Versions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import scala.collection.JavaConverters._
import scala.sys.process._

object Versions {
def scalametaVersion = "4.4.26"
def scalametaVersion = "4.7.7"
def scala210 = "2.10.7"
def scala211 = "2.11.12"
def scala212 = "2.12.17"
def scala213 = "2.13.10"
private def semanticdbJavacKey = "semanticdb-javac"

def semanticdbJavacVersion(): String =
Expand All @@ -26,9 +30,9 @@ object Versions {
} else {
Map(
semanticdbJavacKey -> "0.8.0",
"2.12.12" -> scalametaVersion,
"2.13.6" -> scalametaVersion,
"2.11.12" -> scalametaVersion
scala211 -> scalametaVersion,
scala212 -> scalametaVersion,
scala213 -> scalametaVersion
).withDefaultValue(scalametaVersion)
}
}
Expand Down