Skip to content

Commit

Permalink
Build: Update release process
Browse files Browse the repository at this point in the history
  • Loading branch information
raquo committed Jan 31, 2021
1 parent cbb9c16 commit 42fa2df
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 30 deletions.
49 changes: 24 additions & 25 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,48 @@ enablePlugins(ScalaJSPlugin)
enablePlugins(ScalaJSBundlerPlugin)

libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "1.1.0",
"app.tulz" %%% "tuplez-full-light" % "0.3.3",
"org.scalatest" %%% "scalatest" % "3.2.0" % Test
"org.scala-js" %%% "scalajs-dom" % Versions.ScalaJsDom,
"app.tulz" %%% "tuplez-full-light" % Versions.Tuplez,
"org.scalatest" %%% "scalatest" % Versions.ScalaTest % Test
)

val filterScalacOptions = { options: Seq[String] =>
scalaVersion := Versions.Scala_2_13

crossScalaVersions := Seq(Versions.Scala_2_12, Versions.Scala_2_13)

scalacOptions ~= { options: Seq[String] =>
options.filterNot(Set(
"-Ywarn-value-discard",
"-Wvalue-discard"
))
}

val filterTestScalacOptions = { options: Seq[String] =>
scalacOptions in Test ~= { options: Seq[String] =>
options.filterNot { o =>
o.startsWith("-Ywarn-unused") || o.startsWith("-Wunused")
}
}

scalaVersion := "2.13.4"

crossScalaVersions := Seq("2.12.12", "2.13.4")

scalacOptions ~= filterScalacOptions

scalacOptions in Test ~= filterTestScalacOptions

// @TODO[Build] Why does this need " in (Compile, doc)" while other options don't?
scalacOptions in (Compile, doc) ++= Seq(
"-no-link-warnings" // Suppress scaladoc "Could not find any member to link for" warnings
)

version in installJsdom := Versions.JsDom

useYarn := true

requireJsDomEnv in Test := true

parallelExecution in Test := false

scalaJSUseMainModuleInitializer := true

scalaJSLinkerConfig in (Compile, fastOptJS) ~= { _.withSourceMap(false) }


// -- Code generators for N-arity functionality

val generateTupleCombinatorsFrom = 2
val generateTupleCombinatorsTo = 9

Expand Down Expand Up @@ -106,15 +117,3 @@ Test / sourceGenerators += Def.task {
).run
)
}.taskValue

version in installJsdom := "16.4.0"

useYarn := true

requireJsDomEnv in Test := true

parallelExecution in Test := false

scalaJSUseMainModuleInitializer := true

scalaJSLinkerConfig in (Compile, fastOptJS) ~= { _.withSourceMap(false) }
6 changes: 1 addition & 5 deletions project/SourceGenerator.scala
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import sbt._

import java.io.File
import java.io.FileOutputStream
import java.io.PrintStream
import java.io.{File, FileOutputStream, PrintStream}

abstract class SourceGenerator(file: File) {

Expand Down
18 changes: 18 additions & 0 deletions project/Versions.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
object Versions {

val Scala_2_11 = "2.11.12"

val Scala_2_13 = "2.13.4"

val Scala_2_12 = "2.12.12"

val Scala_3_RC1 = "3.0.0-RC1-bin-20210113-8345078-NIGHTLY"

val ScalaJsDom = "1.1.0"

val Tuplez = "0.3.3"

val ScalaTest = "3.2.0"

val JsDom = "16.4.0"
}
18 changes: 18 additions & 0 deletions release.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ releaseCrossBuild := true

pomIncludeRepository := { _ => false }

releaseProcess := {
import ReleaseTransformations._
Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)
}

//useGpg := true

releasePublishArtifactsAction := PgpKeys.publishSigned.value
Expand Down

0 comments on commit 42fa2df

Please sign in to comment.