Skip to content

Commit 51cdce5

Browse files
committed
backport build changes from main to 1.1.x
1 parent 62d4069 commit 51cdce5

File tree

13 files changed

+171
-150
lines changed

13 files changed

+171
-150
lines changed

Diff for: .github/workflows/ci.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: test
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
jobs:
8+
test:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
java: [8, 11, 17]
13+
scala: [2.11.12, 2.12.15, 2.13.8]
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
- uses: coursier/cache-action@v6
20+
- uses: actions/setup-java@v2
21+
with:
22+
distribution: temurin
23+
java-version: ${{matrix.java}}
24+
- name: Test
25+
run: sbt ++${{matrix.scala}} test headerCheck versionPolicyCheck package

Diff for: .github/workflows/release.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Release
2+
on:
3+
push:
4+
tags: ["*"]
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
with:
11+
fetch-depth: 0
12+
- uses: actions/setup-java@v2
13+
with:
14+
distribution: temurin
15+
java-version: 8
16+
- run: sbt versionCheck ci-release
17+
env:
18+
PGP_PASSPHRASE: ${{secrets.PGP_PASSPHRASE}}
19+
PGP_SECRET: ${{secrets.PGP_SECRET}}
20+
SONATYPE_PASSWORD: ${{secrets.SONATYPE_PASSWORD}}
21+
SONATYPE_USERNAME: ${{secrets.SONATYPE_USERNAME}}

Diff for: .gitignore

+9-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ build.properties
3333
/.idea
3434
/.settings
3535

36+
# vscode, metals
37+
.bloop/
38+
/.metals/
39+
/.vscode/
40+
/project/**/metals.sbt
41+
3642
# bak files produced by ./cleanup-commit
3743
*.bak
3844

@@ -42,4 +48,6 @@ qbin
4248
# Mac specific, but that is common enough a dev platform to warrant inclusion.
4349
.DS_Store
4450

45-
target/
51+
# sbt
52+
target/
53+
/.bsp/

Diff for: .mailmap

+2
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ Pavel Pavlov <pavel.e.pavlov@gmail.com>
5858
Philipp Haller <philipp.haller@typesafe.com>
5959
Philipp Haller <philipp.haller@typesafe.com> <hallerp@gmail.com>
6060
Philippe Altherr <paltherr@epfl.ch>
61+
Philippus Baalman <philippus@gmail.com>
6162
Raphaël Noir <noir@epfl.ch>
6263
Roland Kuhn <rk@rkuhn.info>
6364
Rüdiger Klaehn <rklaehn@gmail.com>
65+
Scala Steward <me@scala-steward.org>
6466
Sebastian Hack <shack@epfl.ch>
6567
Simon Ochsenreither <simon@ochsenreither.de>
6668
Stepan Koltsov <stepancheg@epfl.ch>

Diff for: .travis.yml

-34
This file was deleted.

Diff for: CODE_OF_CONDUCT.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
all repositories in these organizations:
2+
3+
* [scala](https://github.com/scala)
4+
* [scalacenter](https://github.com/scalacenter)
5+
* [lampepfl](https://github.com/lampepfl)
6+
7+
are covered by the Scala Code of Conduct: https://scala-lang.org/conduct/

Diff for: NOTICE

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Scala parser combinators
2-
Copyright (c) 2002-2019 EPFL
3-
Copyright (c) 2011-2019 Lightbend, Inc.
2+
Copyright (c) 2002-2022 EPFL
3+
Copyright (c) 2011-2022 Lightbend, Inc.
44

55
Scala includes software developed at
66
LAMP/EPFL (https://lamp.epfl.ch/) and

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# scala-parser-combinators [<img src="https://img.shields.io/travis/scala/scala-parser-combinators.svg"/>](https://travis-ci.org/scala/scala-parser-combinators) [<img src="https://img.shields.io/maven-central/v/org.scala-lang.modules/scala-parser-combinators_2.11.svg?label=latest%20release%20for%202.11"/>](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-parser-combinators_2.11) [<img src="https://img.shields.io/maven-central/v/org.scala-lang.modules/scala-parser-combinators_2.12.svg?label=latest%20release%20for%202.12"/>](http://search.maven.org/#search%7Cga%7C1%7Cg%3Aorg.scala-lang.modules%20a%3Ascala-parser-combinators_2.12) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/scala/scala-parser-combinators)
1+
# scala-parser-combinators
22

33
### Scala Standard Parser Combinator Library
44

Diff for: build.sbt

+98-44
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,119 @@
1-
import sbtcrossproject.CrossPlugin.autoImport.crossProject
1+
// in the interest of reducing diffs between the 1.1.x branch and the
2+
// main (2.x branch), there are some Scala 3 references in here that
3+
// aren't affecting anything
4+
5+
ThisBuild / licenses += (("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0")))
6+
ThisBuild / startYear := Some(2004)
7+
8+
// I thought we could declare these in `ThisBuild` scope but no :-/
9+
val commonSettings = Seq(
10+
versionScheme := Some("early-semver"),
11+
versionPolicyIntention := {
12+
if (scalaVersion.value.startsWith("3"))
13+
Compatibility.None
14+
else
15+
Compatibility.BinaryCompatible
16+
}
17+
)
18+
19+
lazy val root = project.in(file("."))
20+
.aggregate(parserCombinatorsJVM, parserCombinatorsJS, parserCombinatorsNative)
21+
.settings(
22+
commonSettings,
23+
publish / skip := true,
24+
)
225

326
lazy val parserCombinators = crossProject(JVMPlatform, JSPlatform, NativePlatform)
4-
.withoutSuffixFor(JVMPlatform).in(file("."))
5-
.settings(ScalaModulePlugin.scalaModuleSettings)
6-
.jvmSettings(ScalaModulePlugin.scalaModuleSettingsJVM)
27+
.in(file("."))
728
.settings(
29+
ScalaModulePlugin.scalaModuleSettings,
30+
commonSettings,
831
name := "scala-parser-combinators",
32+
scalaModuleAutomaticModuleName := Some("scala.util.parsing"),
933

10-
scalaModuleMimaPreviousVersion := Some("1.1.0").filter(_ => System.getenv("SCALAJS_VERSION") != "1.0.0"),
11-
mimaBinaryIssueFilters ++= {
12-
import com.typesafe.tools.mima.core._
13-
import com.typesafe.tools.mima.core.ProblemFilters._
14-
Seq(
15-
exclude[IncompatibleSignatureProblem]("*"),
34+
crossScalaVersions := Seq("2.13.8", "2.12.15", "2.11.12"),
35+
scalaVersion := crossScalaVersions.value.head,
1636

17-
// the following 3 are due to https://github.com/lightbend/mima/issues/388
18-
exclude[DirectMissingMethodProblem]("scala.util.parsing.json.JSON.numberParser"),
19-
exclude[DirectMissingMethodProblem]("scala.util.parsing.json.JSON.defaultNumberParser"),
20-
exclude[DirectMissingMethodProblem]("scala.util.parsing.json.JSON.keywordCache")
21-
)
22-
},
37+
libraryDependencies += "junit" % "junit" % "4.13.2" % Test,
38+
libraryDependencies += "com.github.sbt" % "junit-interface" % "0.13.3" % Test,
39+
// so we can `@nowarn` in test code, but only in test code, so the dependency
40+
// doesn't leak downstream. can be dropped when we drop 2.11 from the crossbuild
41+
libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "2.7.0" % Test,
2342

24-
apiMappings += (scalaInstance.value.libraryJar ->
25-
url(s"https://www.scala-lang.org/api/${scalaVersion.value}/")),
43+
apiMappings ++= scalaInstance.value.libraryJars.collect {
44+
case file if file.getName.startsWith("scala-library") && file.getName.endsWith(".jar") =>
45+
file -> url(s"http://www.scala-lang.org/api/${scalaVersion.value}/")
46+
}.toMap,
2647

27-
scalacOptions in (Compile, doc) ++= Seq(
28-
"-diagrams",
29-
"-doc-source-url",
30-
s"https://github.com/scala/scala-parser-combinators/tree/v${version.value}€{FILE_PATH}.scala",
31-
"-sourcepath",
32-
(baseDirectory in LocalRootProject).value.absolutePath,
33-
"-doc-title",
34-
"Scala Parser Combinators",
35-
"-doc-version",
36-
version.value
37-
),
38-
unmanagedSourceDirectories in Compile ++= {
39-
(unmanagedSourceDirectories in Compile).value.map { dir =>
48+
// go nearly warning-free, but only on 2.13, it's too hard across all versions
49+
Compile / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
50+
case Some((2, 13)) => Seq("-Werror",
51+
// ideally we'd do something about this. `^?` is the responsible method
52+
"-Wconf:site=scala.util.parsing.combinator.Parsers.*&cat=lint-multiarg-infix:i",
53+
// not sure what resolving this would look like? didn't think about it too hard
54+
"-Wconf:site=scala.util.parsing.combinator.lexical.StdLexical.*&cat=other-match-analysis:i",
55+
)
56+
case _ => Seq()
57+
}),
58+
Compile / doc / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
59+
case Some((2, 13)) => Seq(
60+
// it isn't able to link to [[java.lang.NoSuchMethodError]]
61+
// scala-xml doesn't have this problem, I tried copying their apiMappings stuff
62+
// and that didn't help, I'm mystified why :-/
63+
"""-Wconf:msg=Could not find any member to link for*:i""",
64+
)
65+
case _ => Seq()
66+
}),
67+
Compile / doc / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
68+
case Some((3, _)) =>
69+
Seq() // TODO see what flags might be desirable to pass to Scala 3's Scaladoc
70+
case _ =>
71+
Seq(
72+
"-diagrams",
73+
"-doc-source-url",
74+
s"https://github.com/scala/scala-parser-combinators/tree/v${version.value}€{FILE_PATH}.scala",
75+
"-sourcepath",
76+
(LocalRootProject / baseDirectory).value.absolutePath,
77+
"-doc-title",
78+
"Scala Parser Combinators",
79+
"-doc-version",
80+
version.value
81+
)
82+
}),
83+
Compile / unmanagedSourceDirectories ++= {
84+
(Compile / unmanagedSourceDirectories).value.map { dir =>
4085
CrossVersion.partialVersion(scalaVersion.value) match {
41-
case Some((2, 13)) => file(dir.getPath ++ "-2.13")
42-
case _ => file(dir.getPath ++ "-2.11-2.12")
86+
case Some((2, 13)) => file(dir.getPath ++ "-2.13+")
87+
case Some((3, _)) => file(dir.getPath ++ "-2.13+")
88+
case _ => file(dir.getPath ++ "-2.13-")
4389
}
4490
}
4591
}
4692
)
4793
.jvmSettings(
94+
ScalaModulePlugin.scalaModuleOsgiSettings,
4895
OsgiKeys.exportPackage := Seq(s"scala.util.parsing.*;version=${version.value}"),
49-
libraryDependencies += "junit" % "junit" % "4.13" % Test,
50-
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test
5196
)
5297
.jsSettings(
98+
// mystified why https://github.com/scala-js/scala-js/issues/635 would be rearing its head,
99+
// but only on sbt 1.4 + 2.13 and only in Test config?! WEIRD
100+
Test / doc / scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
101+
case Some((2, 13)) => Seq("-Wconf:msg=dropping dependency on node with no phase object*:i")
102+
case _ => Seq()
103+
}),
53104
// Scala.js cannot run forked tests
54-
fork in Test := false
105+
Test / fork := false
55106
)
56-
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))
107+
.jsEnablePlugins(ScalaJSJUnitPlugin)
57108
.nativeSettings(
58-
skip in compile := System.getProperty("java.version").startsWith("1.6") || !scalaVersion.value.startsWith("2.11"),
59-
test := {},
60-
libraryDependencies := {
61-
if (!scalaVersion.value.startsWith("2.11"))
62-
libraryDependencies.value.filterNot(_.organization == "org.scala-native")
63-
else libraryDependencies.value
64-
}
109+
versionPolicyCheck / skip := true,
110+
versionCheck / skip := true,
111+
Test / fork := false,
112+
libraryDependencies :=
113+
libraryDependencies.value.filterNot(_.organization == "junit") :+ "org.scala-native" %%% "junit-runtime" % "0.4.4",
114+
addCompilerPlugin("org.scala-native" % "junit-plugin" % "0.4.4" cross CrossVersion.full)
65115
)
116+
117+
lazy val parserCombinatorsJVM = parserCombinators.jvm
118+
lazy val parserCombinatorsJS = parserCombinators.js
119+
lazy val parserCombinatorsNative = parserCombinators.native

Diff for: build.sh

-56
This file was deleted.

Diff for: project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.3.8
1+
sbt.version=1.6.2

Diff for: project/plugins.sbt

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
val scalaJSVersion =
2-
Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).getOrElse("0.6.32")
1+
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.1")
32

4-
val scalaNativeVersion =
5-
Option(System.getenv("SCALANATIVE_VERSION")).filter(_.nonEmpty).getOrElse("0.3.9")
3+
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
4+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.0")
65

7-
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.1.3")
8-
9-
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
10-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
11-
12-
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
13-
addSbtPlugin("org.scala-native" % "sbt-scala-native" % scalaNativeVersion)
6+
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")
7+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.4")

0 commit comments

Comments
 (0)