1
- import com .typesafe .tools .mima .plugin .MimaPlugin .mimaDefaultSettings
2
- import com .typesafe .tools .mima .core ._
1
+ import com .typesafe .sbt .SbtGit .GitKeys ._
3
2
import com .typesafe .tools .mima .core .ProblemFilters ._
4
-
5
- import com .typesafe .sbt .SbtGit ._
6
- import GitKeys ._
7
-
8
- import sbtcrossproject .CrossPlugin .autoImport .{CrossType , crossProject }
3
+ import com .typesafe .tools .mima .core ._
4
+ import sbtcrossproject .CrossPlugin .autoImport .crossProject
9
5
import sbtcrossproject .CrossProject
10
6
11
7
val Scala211 = " 2.11.12"
@@ -27,11 +23,10 @@ ThisBuild / githubWorkflowBuildPreamble := Seq(
27
23
WorkflowStep .Run (List (" sudo apt install clang libunwind-dev libgc-dev libre2-dev" ))
28
24
)
29
25
ThisBuild / githubWorkflowJavaVersions
:= Seq (
" [email protected] " )
30
- ThisBuild / githubWorkflowBuildMatrixAdditions +=
31
- " platform" -> List (" jvm" , " js" , " native" )
32
-
33
26
ThisBuild / githubWorkflowArtifactUpload := false
27
+ ThisBuild / githubWorkflowBuildMatrixAdditions += " platform" -> List (" jvm" , " js" , " native" )
34
28
ThisBuild / githubWorkflowBuildMatrixFailFast := Some (false )
29
+ ThisBuild / githubWorkflowTargetBranches := Seq (" **" ) // match all branches, including slashes
35
30
36
31
val JvmCond = s " matrix.platform == 'jvm' "
37
32
val JsCond = s " matrix.platform == 'js' "
@@ -167,14 +162,18 @@ lazy val CrossTypeMixed: sbtcrossproject.CrossType = new sbtcrossproject.CrossTy
167
162
Some (projectBase.getParentFile / " src" / conf / " scala" )
168
163
}
169
164
165
+ val boilerplate = Def .taskDyn {
166
+ (sourceManaged in Compile ).map(Boilerplate .gen(scalaBinaryVersion.value))
167
+ }
168
+
170
169
lazy val core = crossProject(JSPlatform , JVMPlatform , NativePlatform ).crossType(CrossTypeMixed )
171
170
.configureCross(configureJUnit)
172
171
.settings(moduleName := " shapeless" )
173
172
.settings(coreSettings:_* )
174
173
.configureCross(buildInfoSetup)
175
174
.enablePlugins(SbtOsgi )
176
175
.settings(coreOsgiSettings:_* )
177
- .settings(sourceGenerators in Compile += (sourceManaged in Compile ).map( Boilerplate .gen) .taskValue)
176
+ .settings(sourceGenerators in Compile += boilerplate .taskValue)
178
177
.settings(mimaSettings:_* )
179
178
.jsSettings(commonJsSettings:_* )
180
179
.jvmSettings(commonJvmSettings:_* )
@@ -312,68 +311,22 @@ lazy val noPublishSettings =
312
311
313
312
enablePlugins(MimaPlugin )
314
313
lazy val mimaSettings = Seq (
315
- mimaPreviousArtifacts := {
316
- val previousVersion = if (scalaVersion.value.startsWith(" 2.13." )) " 2.3.3" else " 2.3.2"
317
- Set (organization.value %% moduleName.value % previousVersion)
318
- },
319
- mimaBinaryIssueFilters := Seq (
314
+ mimaPreviousArtifacts := Set (organization.value %% moduleName.value % " 2.3.3" ),
315
+ mimaBinaryIssueFilters := {
320
316
// Macro internals - ignore
321
- exclude[InheritedNewAbstractMethodProblem ](" shapeless.CaseClassMacros.varargTC" ),
322
- exclude[InheritedNewAbstractMethodProblem ](" shapeless.CaseClassMacros.varargTpt" ),
323
- exclude[InheritedNewAbstractMethodProblem ](" shapeless.CaseClassMacros.shapeless$CaseClassMacrosVersionSpecifics$_setter_$varargTC_=" ),
324
- exclude[InheritedNewAbstractMethodProblem ](" shapeless.CaseClassMacros.shapeless$CaseClassMacrosVersionSpecifics$_setter_$varargTpt_=" ),
325
- exclude[InheritedNewAbstractMethodProblem ](" shapeless.IsCons1Macros.varargTC" ),
326
- exclude[InheritedNewAbstractMethodProblem ](" shapeless.IsCons1Macros.varargTpt" ),
327
- exclude[InheritedNewAbstractMethodProblem ](" shapeless.IsCons1Macros.shapeless$CaseClassMacrosVersionSpecifics$_setter_$varargTC_=" ),
328
- exclude[InheritedNewAbstractMethodProblem ](" shapeless.IsCons1Macros.shapeless$CaseClassMacrosVersionSpecifics$_setter_$varargTpt_=" ),
329
- exclude[MissingClassProblem ](" shapeless.CaseClassMacros$PatchedContext$2$PatchedLookupResult" ),
330
- exclude[MissingTypesProblem ](" shapeless.LazyMacros$" ),
331
- exclude[MissingClassProblem ](" shapeless.LazyMacrosCompat" ),
332
- exclude[MissingClassProblem ](" shapeless.LazyMacrosRef" ),
333
-
334
- // 2.13.x collections related - to eliminate somehow
335
- exclude[DirectMissingMethodProblem ](" shapeless.AdditiveCollection.indexedSeqAdditiveCollection" ),
336
- exclude[IncompatibleMethTypeProblem ](" shapeless.SizedOps.++" ),
337
- exclude[DirectMissingMethodProblem ](" shapeless.Sized.apply" ),
338
- exclude[DirectMissingMethodProblem ](" shapeless.SizedBuilder.apply" ),
339
- exclude[IncompatibleMethTypeProblem ](" shapeless.SizedBuilder.apply" ),
340
- exclude[IncompatibleMethTypeProblem ](" shapeless.syntax.SizedConv.this" ),
341
- exclude[IncompatibleMethTypeProblem ](" shapeless.syntax.sized.genTraversableSizedConv" ),
342
- exclude[IncompatibleMethTypeProblem ](" shapeless.syntax.std.traversable.traversableOps2" ),
343
- exclude[IncompatibleMethTypeProblem ](" shapeless.syntax.std.TraversableOps2.this" ),
344
- exclude[IncompatibleMethTypeProblem ](" shapeless.ops.hlist#Repeat.apply" ),
345
- exclude[IncompatibleMethTypeProblem ](" shapeless.ops.traversable#ToSizedHList.instance" ),
346
- exclude[DirectMissingMethodProblem ](" shapeless.ops.hlist#ToSized.hlistToSized" ),
347
- exclude[IncompatibleMethTypeProblem ](" shapeless.ops.traversable#FromTraversable.apply" ),
348
- exclude[ReversedMissingMethodProblem ](" shapeless.ops.traversable#FromTraversable.apply" ),
349
-
350
- // Other
351
- exclude[IncompatibleResultTypeProblem ](" shapeless.syntax.HListOps.toCoproduct" ),
352
- exclude[InheritedNewAbstractMethodProblem ](" shapeless.ops.hlist#Repeat.apply" ),
353
- exclude[ReversedMissingMethodProblem ](" shapeless.SingletonTypeUtils.isSymbolLiteral" ),
354
- exclude[ReversedMissingMethodProblem ](" shapeless.CaseClassMacros.numNonCaseParamLists" ),
355
-
356
- // All the following were present in 2.3.2 ...
357
-
358
- // Filtering the methods that were added since the checked version
359
- // (these only break forward compatibility, not the backward one)
360
- exclude[ReversedMissingMethodProblem ](" shapeless.ops.hlist#IsHCons.cons" ),
361
-
362
- // Filtering removals
363
- exclude[ReversedMissingMethodProblem ](" shapeless.ops.coproduct#IsCCons.cons" ),
364
- exclude[MissingClassProblem ](" shapeless.ops.coproduct$ZipOne$" ),
365
- exclude[MissingClassProblem ](" shapeless.ops.coproduct$ZipOne" ),
366
- exclude[DirectMissingMethodProblem ](" shapeless.LazyMacros.dcRef" ),
367
- exclude[DirectMissingMethodProblem ](" shapeless.LazyMacros.dcRef_=" ),
368
-
369
- // Implicit reorderings
370
- exclude[DirectMissingMethodProblem ](" shapeless.LowPriorityUnaryTCConstraint.hnilConstUnaryTC" ),
371
- exclude[ReversedMissingMethodProblem ](" shapeless.LowPriorityUnaryTCConstraint.hnilUnaryTC" ),
372
-
373
- // Relaxed constraints
374
- exclude[IncompatibleMethTypeProblem ](" shapeless.ops.traversable#ToSizedHList.apply" ),
375
- exclude[ReversedMissingMethodProblem ](" shapeless.ops.traversable#ToSizedHList.apply" )
376
- )
317
+ val macroFilters = List (" CaseClassMacros" , " IsCons1Macros" , " LazyMacros" )
318
+ .map(macros => exclude[Problem ](s " shapeless. $macros* " ))
319
+
320
+ scalaBinaryVersion.value match {
321
+ case " 2.11" =>
322
+ // Adding methods to traits in 2.11 is not binary compatible, but those traits shouldn't be subclassed.
323
+ exclude[ReversedMissingMethodProblem ](" shapeless.LowPriorityUnaryTCConstraint.hnilUnaryTC" ) ::
324
+ exclude[ReversedMissingMethodProblem ](" shapeless.SingletonTypeUtils.isSymbolLiteral" ) ::
325
+ macroFilters
326
+ case _ =>
327
+ macroFilters
328
+ }
329
+ }
377
330
)
378
331
379
332
def buildInfoSetup (crossProject : CrossProject ): CrossProject = {
0 commit comments