Skip to content

Commit 5453050

Browse files
committed
clean up build.sbt & build.sh, be more like other modules
in particular, I've come to really dislike .withoutSuffixFor(JVMPlatform), it makes the root project and the JVM project too easy to confuse with each other
1 parent 94a66be commit 5453050

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

build.sbt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
import sbtcrossproject.CrossPlugin.autoImport.crossProject
1+
lazy val root = project.in(file("."))
2+
.aggregate(parserCombinatorsJVM, parserCombinatorsJS, parserCombinatorsNative)
3+
.settings(
4+
publish / skip := true,
5+
)
26

37
lazy val parserCombinators = crossProject(JVMPlatform, JSPlatform, NativePlatform)
4-
.withoutSuffixFor(JVMPlatform).in(file("."))
5-
.settings(ScalaModulePlugin.scalaModuleSettings)
6-
.jvmSettings(ScalaModulePlugin.scalaModuleOsgiSettings)
8+
.in(file("."))
79
.settings(
10+
ScalaModulePlugin.scalaModuleSettings,
811
name := "scala-parser-combinators",
9-
scalaModuleMimaPreviousVersion := None,
12+
scalaModuleMimaPreviousVersion := None, // until we publish 1.2.0
1013

1114
apiMappings ++= scalaInstance.value.libraryJars.collect {
1215
case file if file.getName.startsWith("scala-library") && file.getName.endsWith(".jar") =>
@@ -40,6 +43,7 @@ lazy val parserCombinators = crossProject(JVMPlatform, JSPlatform, NativePlatfor
4043
}
4144
)
4245
.jvmSettings(
46+
ScalaModulePlugin.scalaModuleOsgiSettings,
4347
OsgiKeys.exportPackage := Seq(s"scala.util.parsing.*;version=${version.value}"),
4448
libraryDependencies += "junit" % "junit" % "4.13.1" % Test,
4549
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test
@@ -59,3 +63,7 @@ lazy val parserCombinators = crossProject(JVMPlatform, JSPlatform, NativePlatfor
5963
else libraryDependencies.value
6064
}
6165
)
66+
67+
lazy val parserCombinatorsJVM = parserCombinators.jvm
68+
lazy val parserCombinatorsJS = parserCombinators.js
69+
lazy val parserCombinatorsNative = parserCombinators.native

build.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ set -e
1616
# - commit the changes and tag this new revision with an arbitrary suffix after a hash, e.g.,
1717
# `v1.2.3#dotty-0.27` (the suffix is ignored, the version will be `1.2.3`)
1818

19-
# For normal tags that are cross-built, we release on JDK 8 for Scala 2.x
19+
# We release on JDK 8 (for Scala 2.x and Dotty 0.x)
2020
isReleaseJob() {
21-
if [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^2\.1[01234]\..*$ ]]; then
21+
if [[ "$ADOPTOPENJDK" == "8" ]]; then
2222
true
2323
else
2424
false
2525
fi
2626
}
2727

2828
if [[ "$SCALAJS_VERSION" != "" ]]; then
29-
projectPrefix="parserCombinatorsJS"
29+
projectPrefix="parserCombinatorsJS/"
3030
elif [[ "$SCALANATIVE_VERSION" != "" ]]; then
31-
projectPrefix="parserCombinatorsNative"
31+
projectPrefix="parserCombinatorsNative/"
3232
else
33-
projectPrefix="parserCombinators"
33+
projectPrefix="parserCombinatorsJVM/"
3434
fi
3535

3636
verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
@@ -45,12 +45,12 @@ if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
4545
fi
4646

4747
# default is +publishSigned; we cross-build with travis jobs, not sbt's crossScalaVersions
48-
export CI_RELEASE="$projectPrefix/publishSigned"
49-
export CI_SNAPSHOT_RELEASE="$projectPrefix/publish"
48+
export CI_RELEASE="${projectPrefix}publishSigned"
49+
export CI_SNAPSHOT_RELEASE="${projectPrefix}publish"
5050

5151
# default is sonatypeBundleRelease, which closes and releases the staging repo
5252
# see https://github.com/xerial/sbt-sonatype#commands
5353
# for now, until we're confident in the new release scripts, just close the staging repo.
5454
export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose"
5555

56-
sbt clean $projectPrefix/test $projectPrefix/publishLocal $releaseTask
56+
sbt clean ${projectPrefix}test ${projectPrefix}publishLocal $releaseTask

0 commit comments

Comments
 (0)