@@ -27,7 +27,7 @@ val scalaCheckVersion = "1.15.2"
27
27
val disciplineVersion = " 1.1.3"
28
28
29
29
val disciplineScalatestVersion = " 2.0.1"
30
- val disciplineMunitVersion = " 1.0.4 "
30
+ val disciplineMunitVersion = " 1.0.5 "
31
31
32
32
val kindProjectorVersion = " 0.11.3"
33
33
41
41
42
42
ThisBuild / githubWorkflowJavaVersions := Seq (PrimaryJava , LTSJava , LatestJava , GraalVM8 )
43
43
44
- val Scala212 = " 2.12.12 "
44
+ val Scala212 = " 2.12.13 "
45
45
val Scala213 = " 2.13.4"
46
46
val DottyOld = " 3.0.0-M2"
47
47
val DottyNew = " 3.0.0-M3"
@@ -52,15 +52,15 @@ ThisBuild / scalaVersion := Scala213
52
52
ThisBuild / githubWorkflowPublishTargetBranches := Seq () // disable publication for now
53
53
54
54
ThisBuild / githubWorkflowBuildMatrixAdditions +=
55
- " platform" -> List (" jvm" , " js" )
55
+ " platform" -> List (" jvm" , " js" , " native " )
56
56
57
57
ThisBuild / githubWorkflowBuildMatrixExclusions ++=
58
- githubWorkflowJavaVersions.value.filterNot(Set (PrimaryJava )).map { java =>
59
- MatrixExclude (Map (" platform" -> " js" , " java" -> java))
58
+ githubWorkflowJavaVersions.value.filterNot(Set (PrimaryJava )).flatMap { java =>
59
+ Seq ( MatrixExclude (Map (" platform" -> " js" , " java" -> java)), MatrixExclude ( Map ( " platform " -> " native " , " java " -> java) ))
60
60
}
61
61
62
62
ThisBuild / githubWorkflowBuildMatrixExclusions ++=
63
- Seq (" jvm" , " js" ).map { platform =>
63
+ Seq (" jvm" , " js" , " native " ).map { platform =>
64
64
MatrixExclude (
65
65
Map (" platform" -> platform, " java" -> LatestJava , " scala" -> DottyOld )
66
66
) // 3.0.0-M1 doesn't work on JDK 14+
@@ -71,12 +71,14 @@ ThisBuild / githubWorkflowArtifactUpload := false
71
71
72
72
val JvmCond = s " matrix.platform == 'jvm' "
73
73
val JsCond = s " matrix.platform == 'js' "
74
+ val NativeCond = s " matrix.platform == 'native' "
74
75
75
76
val Scala2Cond = s " (matrix.scala != ' $DottyOld' && matrix.scala != ' $DottyNew') "
76
77
val Scala3Cond = s " (matrix.scala == ' $DottyOld' || matrix.scala == ' $DottyNew') "
77
78
78
79
ThisBuild / githubWorkflowBuild := Seq (
79
80
WorkflowStep .Sbt (List (" validateAllJS" ), name = Some (" Validate JavaScript" ), cond = Some (JsCond )),
81
+ WorkflowStep .Sbt (List (" validateAllNative" ), name = Some (" Validate Scala Native" ), cond = Some (NativeCond )),
80
82
WorkflowStep .Use (UseRef .Public (" actions" , " setup-python" , " v2" ),
81
83
name = Some (" Setup Python" ),
82
84
params = Map (" python-version" -> " 3.x" ),
@@ -160,6 +162,7 @@ lazy val commonSettings = Seq(
160
162
resolvers ++= Seq (Resolver .sonatypeRepo(" releases" ), Resolver .sonatypeRepo(" snapshots" )),
161
163
parallelExecution in Test := false ,
162
164
testFrameworks += new TestFramework (" munit.Framework" ),
165
+ doctestTestFramework := DoctestTestFramework .Munit ,
163
166
scalacOptions in (Compile , doc) := (scalacOptions in (Compile , doc)).value.filter(_ != " -Xfatal-warnings" ),
164
167
Compile / doc / sources := {
165
168
val old = (Compile / doc / sources).value
@@ -223,6 +226,15 @@ lazy val commonJsSettings = Seq(
223
226
coverageEnabled := false
224
227
)
225
228
229
+ lazy val commonNativeSettings = Seq (
230
+ // currently sbt-doctest doesn't work in Native/JS builds
231
+ // https://github.com/tkawachi/sbt-doctest/issues/52
232
+ doctestGenTests := Seq .empty,
233
+ coverageEnabled := false ,
234
+ // Currently scala-native does not support Dotty
235
+ crossScalaVersions := { crossScalaVersions.value filterNot Seq (DottyOld , DottyNew ).contains }
236
+ )
237
+
226
238
lazy val commonJvmSettings = Seq (
227
239
testOptions in Test += {
228
240
val flag = if (githubIsWorkflowBuild.value) " -oCI" else " -oDF"
@@ -521,8 +533,8 @@ lazy val cats = project
521
533
.settings(moduleName := " root" )
522
534
.settings(publishSettings) // these settings are needed to release all aggregated modules under this root module
523
535
.settings(noPublishSettings) // this is to exclude the root module itself from being published.
524
- .aggregate(catsJVM, catsJS)
525
- .dependsOn(catsJVM, catsJS, tests.jvm % " test-internal -> test" )
536
+ .aggregate(catsJVM, catsJS, catsNative )
537
+ .dependsOn(catsJVM, catsJS, catsNative, tests.jvm % " test-internal -> test" )
526
538
527
539
lazy val catsJVM = project
528
540
.in(file(" .catsJVM" ))
@@ -589,7 +601,40 @@ lazy val catsJS = project
589
601
)
590
602
.enablePlugins(ScalaJSPlugin )
591
603
592
- lazy val kernel = crossProject(JSPlatform , JVMPlatform )
604
+ lazy val catsNative = project
605
+ .in(file(" .catsNative" ))
606
+ .settings(moduleName := " cats" )
607
+ .settings(noPublishSettings)
608
+ .settings(catsSettings)
609
+ .settings(commonNativeSettings)
610
+ .aggregate(kernel.native,
611
+ kernelLaws.native,
612
+ core.native,
613
+ laws.native,
614
+ free.native,
615
+ testkit.native,
616
+ tests.native,
617
+ alleycatsCore.native,
618
+ alleycatsLaws.native,
619
+ alleycatsTests.native,
620
+ native
621
+ )
622
+ .dependsOn(
623
+ kernel.native,
624
+ kernelLaws.native,
625
+ core.native,
626
+ laws.native,
627
+ free.native,
628
+ testkit.native,
629
+ tests.native % " test-internal -> test" ,
630
+ alleycatsCore.native,
631
+ alleycatsLaws.native,
632
+ alleycatsTests.native % " test-internal -> test" ,
633
+ native
634
+ )
635
+ .enablePlugins(ScalaNativePlugin )
636
+
637
+ lazy val kernel = crossProject(JSPlatform , JVMPlatform , NativePlatform )
593
638
.crossType(CrossType .Pure )
594
639
.in(file(" kernel" ))
595
640
.settings(moduleName := " cats-kernel" , name := " Cats kernel" )
@@ -600,11 +645,12 @@ lazy val kernel = crossProject(JSPlatform, JVMPlatform)
600
645
.settings(includeGeneratedSrc)
601
646
.jsSettings(commonJsSettings)
602
647
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-kernel" ))
648
+ .nativeSettings(commonNativeSettings)
603
649
.settings(
604
650
libraryDependencies += " org.scalacheck" %%% " scalacheck" % scalaCheckVersion % Test
605
651
)
606
652
607
- lazy val kernelLaws = crossProject(JSPlatform , JVMPlatform )
653
+ lazy val kernelLaws = crossProject(JSPlatform , JVMPlatform , NativePlatform )
608
654
.in(file(" kernel-laws" ))
609
655
.settings(moduleName := " cats-kernel-laws" , name := " Cats kernel laws" )
610
656
.settings(commonSettings)
@@ -617,8 +663,9 @@ lazy val kernelLaws = crossProject(JSPlatform, JVMPlatform)
617
663
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-kernel-laws" , includeCats1 = false ))
618
664
.jsSettings(coverageEnabled := false )
619
665
.dependsOn(kernel)
666
+ .nativeSettings(commonNativeSettings)
620
667
621
- lazy val core = crossProject(JSPlatform , JVMPlatform )
668
+ lazy val core = crossProject(JSPlatform , JVMPlatform , NativePlatform )
622
669
.crossType(CrossType .Pure )
623
670
.dependsOn(kernel)
624
671
.settings(moduleName := " cats-core" , name := " Cats core" )
@@ -638,8 +685,10 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
638
685
)
639
686
.jsSettings(commonJsSettings)
640
687
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-core" ))
688
+ .settings(testingDependencies)
689
+ .nativeSettings(commonNativeSettings)
641
690
642
- lazy val laws = crossProject(JSPlatform , JVMPlatform )
691
+ lazy val laws = crossProject(JSPlatform , JVMPlatform , NativePlatform )
643
692
.crossType(CrossType .Pure )
644
693
.dependsOn(kernel, core, kernelLaws)
645
694
.settings(moduleName := " cats-laws" , name := " Cats laws" )
@@ -649,16 +698,18 @@ lazy val laws = crossProject(JSPlatform, JVMPlatform)
649
698
.jsSettings(commonJsSettings)
650
699
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-laws" , includeCats1 = false ))
651
700
.jsSettings(coverageEnabled := false )
701
+ .nativeSettings(commonNativeSettings)
652
702
653
- lazy val free = crossProject(JSPlatform , JVMPlatform )
703
+ lazy val free = crossProject(JSPlatform , JVMPlatform , NativePlatform )
654
704
.crossType(CrossType .Pure )
655
705
.dependsOn(core, tests % " test-internal -> test" )
656
706
.settings(moduleName := " cats-free" , name := " Cats Free" )
657
707
.settings(catsSettings)
658
708
.jsSettings(commonJsSettings)
659
709
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-free" ))
710
+ .nativeSettings(commonNativeSettings)
660
711
661
- lazy val tests = crossProject(JSPlatform , JVMPlatform )
712
+ lazy val tests = crossProject(JSPlatform , JVMPlatform , NativePlatform )
662
713
.crossType(CrossType .Pure )
663
714
.dependsOn(testkit % Test )
664
715
.settings(moduleName := " cats-tests" )
@@ -668,8 +719,9 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform)
668
719
.jsSettings(commonJsSettings)
669
720
.jvmSettings(commonJvmSettings)
670
721
.settings(scalacOptions in Test := (scalacOptions in Test ).value.filter(_ != " -Xfatal-warnings" ))
722
+ .nativeSettings(commonNativeSettings)
671
723
672
- lazy val testkit = crossProject(JSPlatform , JVMPlatform )
724
+ lazy val testkit = crossProject(JSPlatform , JVMPlatform , NativePlatform )
673
725
.crossType(CrossType .Pure )
674
726
.dependsOn(core, laws)
675
727
.enablePlugins(BuildInfoPlugin )
@@ -680,8 +732,9 @@ lazy val testkit = crossProject(JSPlatform, JVMPlatform)
680
732
.jsSettings(commonJsSettings)
681
733
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-testkit" , includeCats1 = false ))
682
734
.settings(scalacOptions := scalacOptions.value.filter(_ != " -Xfatal-warnings" ))
735
+ .nativeSettings(commonNativeSettings)
683
736
684
- lazy val alleycatsCore = crossProject(JSPlatform , JVMPlatform )
737
+ lazy val alleycatsCore = crossProject(JSPlatform , JVMPlatform , NativePlatform )
685
738
.crossType(CrossType .Pure )
686
739
.in(file(" alleycats-core" ))
687
740
.dependsOn(core)
@@ -692,8 +745,9 @@ lazy val alleycatsCore = crossProject(JSPlatform, JVMPlatform)
692
745
.settings(includeGeneratedSrc)
693
746
.jsSettings(commonJsSettings)
694
747
.jvmSettings(commonJvmSettings ++ mimaSettings(" alleycats-core" , includeCats1 = false ))
748
+ .nativeSettings(commonNativeSettings)
695
749
696
- lazy val alleycatsLaws = crossProject(JSPlatform , JVMPlatform )
750
+ lazy val alleycatsLaws = crossProject(JSPlatform , JVMPlatform , NativePlatform )
697
751
.crossType(CrossType .Pure )
698
752
.in(file(" alleycats-laws" ))
699
753
.dependsOn(alleycatsCore, laws)
@@ -706,8 +760,9 @@ lazy val alleycatsLaws = crossProject(JSPlatform, JVMPlatform)
706
760
.jsSettings(commonJsSettings)
707
761
.jvmSettings(commonJvmSettings ++ mimaSettings(" alleycats-laws" , includeCats1 = false ))
708
762
.jsSettings(coverageEnabled := false )
763
+ .nativeSettings(commonNativeSettings)
709
764
710
- lazy val alleycatsTests = crossProject(JSPlatform , JVMPlatform )
765
+ lazy val alleycatsTests = crossProject(JSPlatform , JVMPlatform , NativePlatform )
711
766
.in(file(" alleycats-tests" ))
712
767
.dependsOn(alleycatsLaws, tests % " test-internal -> test" )
713
768
.settings(moduleName := " alleycats-tests" )
@@ -716,6 +771,7 @@ lazy val alleycatsTests = crossProject(JSPlatform, JVMPlatform)
716
771
.jsSettings(commonJsSettings)
717
772
.jvmSettings(commonJvmSettings)
718
773
.settings(scalacOptions in Test := (scalacOptions in Test ).value.filter(_ != " -Xfatal-warnings" ))
774
+ .nativeSettings(commonNativeSettings)
719
775
720
776
// bench is currently JVM-only
721
777
@@ -761,6 +817,14 @@ lazy val js = project
761
817
.settings(commonJsSettings)
762
818
.enablePlugins(ScalaJSPlugin )
763
819
820
+ // cats-native is Native-only
821
+ lazy val native = project
822
+ .dependsOn(core.native, tests.native % " test-internal -> test" )
823
+ .settings(moduleName := " cats-native" )
824
+ .settings(catsSettings)
825
+ .settings(commonNativeSettings)
826
+ .enablePlugins(ScalaNativePlugin )
827
+
764
828
// cats-jvm is JVM-only
765
829
lazy val jvm = project
766
830
.dependsOn(core.jvm, tests.jvm % " test-internal -> test" )
@@ -872,7 +936,12 @@ addCommandAlias("validateKernelJS", "kernelLawsJS/test")
872
936
addCommandAlias(" validateFreeJS" , " freeJS/test" )
873
937
addCommandAlias(" validateAlleycatsJS" , " alleycatsTestsJS/test" )
874
938
addCommandAlias(" validateAllJS" , " all testsJS/test js/test kernelLawsJS/test freeJS/test alleycatsTestsJS/test" )
875
- addCommandAlias(" validate" , " ;clean;validateJS;validateKernelJS;validateFreeJS;validateJVM" )
939
+ addCommandAlias(" validateNative" , " ;testsNative/test;native/test" )
940
+ addCommandAlias(" validateKernelNative" , " kernelLawsNative/test" )
941
+ addCommandAlias(" validateFreeNative" , " freeNative/test" )
942
+ addCommandAlias(" validateAlleycatsNative" , " alleycatsTestsNative/test" )
943
+ addCommandAlias(" validateAllNative" , " all testsNative/test native/test kernelLawsNative/test freeNative/test alleycatsTestsNative/test" )
944
+ addCommandAlias(" validate" , " ;clean;validateJS;validateKernelJS;validateFreeJS;validateNative;validateKernelNative;validateFreeNative;validateJVM" )
876
945
877
946
addCommandAlias(" prePR" , " fmt" )
878
947
0 commit comments