Skip to content

Commit

Permalink
Merge pull request #752 from SethTisue/build-tweaks
Browse files Browse the repository at this point in the history
build tweaks
  • Loading branch information
dwijnand authored Mar 31, 2023
2 parents d448863 + 2203505 commit 8be277e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ inThisBuild(Seq(
),
scmInfo := Some(ScmInfo(url("https://github.com/lightbend/mima"), "scm:git:[email protected]:lightbend/mima.git")),
dynverVTagPrefix := false,
versionScheme := Some("early-semver"),
scalaVersion := scala212,
scalacOptions ++= Seq("-feature", "-Xsource:3", "-Xlint", "-Wconf:cat=deprecation&msg=Stream|JavaConverters:s"),
resolvers ++= (if (isStaging) List(stagingResolver) else Nil),
publishTo := Some(if (isSnapshot.value) Opts.resolver.sonatypeOssSnapshots.head else Opts.resolver.sonatypeStaging),
))

def compilerOptions(scalaVersion: String): Seq[String] =
Seq("-feature", "-Wconf:cat=deprecation&msg=Stream|JavaConverters:s") ++
(CrossVersion.partialVersion(scalaVersion) match {
case Some((2, _)) => Seq("-Xsource:3", "-Xlint")
case _ => Seq()
})

// Useful to self-test releases
val stagingResolver = "Sonatype OSS Staging" at "https://oss.sonatype.org/content/repositories/staging"
def isStaging = sys.props.contains("mimabuild.staging")
Expand Down Expand Up @@ -44,6 +51,7 @@ val munit = Def.setting("org.scalameta" %%% "munit" % "1.0.0-M7")
val core = crossProject(JVMPlatform, NativePlatform).crossType(CrossType.Pure).settings(
name := "mima-core",
crossScalaVersions ++= Seq(scala213, scala3),
scalacOptions ++= compilerOptions(scalaVersion.value),
libraryDependencies += munit.value % Test,
testFrameworks += new TestFramework("munit.Framework"),
MimaSettings.mimaSettings,
Expand All @@ -62,6 +70,7 @@ val core = crossProject(JVMPlatform, NativePlatform).crossType(CrossType.Pure).s

val sbtplugin = project.enablePlugins(SbtPlugin).dependsOn(core.jvm).settings(
name := "sbt-mima-plugin",
scalacOptions ++= compilerOptions(scalaVersion.value),
// drop the previous value to drop running Test/compile
scriptedDependencies := Def.task(()).dependsOn(publishLocal, core.jvm / publishLocal).value,
scriptedLaunchOpts += s"-Dplugin.version=${version.value}",
Expand All @@ -79,6 +88,7 @@ val functionalTests = Project("functional-tests", file("functional-tests"))
libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value,
libraryDependencies += munit.value,
testFrameworks += new TestFramework("munit.Framework"),
scalacOptions ++= compilerOptions(scalaVersion.value),
//Test / run / fork := true,
//Test / run / forkOptions := (Test / run / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value),
// Test / testOnly / watchTriggers += baseDirectory.value.toGlob / "src" / "test" / **,
Expand Down

0 comments on commit 8be277e

Please sign in to comment.