35
35
36
36
ThisBuild / githubWorkflowJavaVersions := Seq (PrimaryJava , LTSJava , LatestJava , GraalVM8 )
37
37
38
- val Scala212 = " 2.12.12 "
38
+ val Scala212 = " 2.12.13 "
39
39
val Scala213 = " 2.13.4"
40
40
val DottyOld = " 3.0.0-M2"
41
41
val DottyNew = " 3.0.0-M3"
@@ -46,24 +46,34 @@ ThisBuild / scalaVersion := Scala213
46
46
ThisBuild / githubWorkflowPublishTargetBranches := Seq () // disable publication for now
47
47
48
48
ThisBuild / githubWorkflowBuildMatrixAdditions +=
49
- " platform" -> List (" jvm" , " js" )
49
+ " platform" -> List (" jvm" , " js" , " native " )
50
50
51
51
ThisBuild / githubWorkflowBuildMatrixExclusions ++=
52
- githubWorkflowJavaVersions.value.filterNot(Set (PrimaryJava )).map { java =>
53
- MatrixExclude (Map (" platform" -> " js" , " java" -> java))
52
+ githubWorkflowJavaVersions.value.filterNot(Set (PrimaryJava )).flatMap { java =>
53
+ Seq (MatrixExclude (Map (" platform" -> " js" , " java" -> java)),
54
+ MatrixExclude (Map (" platform" -> " native" , " java" -> java))
55
+ )
54
56
}
55
57
58
+ ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq (DottyOld , DottyNew ).map { dottyVersion =>
59
+ MatrixExclude (Map (" platform" -> " native" , " scala" -> dottyVersion))
60
+ } // Dotty is not yet supported by Scala Native
61
+
56
62
// we don't need this since we aren't publishing
57
63
ThisBuild / githubWorkflowArtifactUpload := false
58
64
65
+ ThisBuild / githubWorkflowBuildMatrixFailFast := Some (false )
66
+
59
67
val JvmCond = s " matrix.platform == 'jvm' "
60
68
val JsCond = s " matrix.platform == 'js' "
69
+ val NativeCond = s " matrix.platform == 'native' "
61
70
62
71
val Scala2Cond = s " (matrix.scala != ' $DottyOld' && matrix.scala != ' $DottyNew') "
63
72
val Scala3Cond = s " (matrix.scala == ' $DottyOld' || matrix.scala == ' $DottyNew') "
64
73
65
74
ThisBuild / githubWorkflowBuild := Seq (
66
75
WorkflowStep .Sbt (List (" validateAllJS" ), name = Some (" Validate JavaScript" ), cond = Some (JsCond )),
76
+ WorkflowStep .Sbt (List (" validateAllNative" ), name = Some (" Validate Scala Native" ), cond = Some (NativeCond )),
67
77
WorkflowStep .Sbt (List (" buildJVM" , " bench/test" ),
68
78
name = Some (" Validate JVM (scala 2)" ),
69
79
cond = Some (JvmCond + " && " + Scala2Cond )
@@ -199,6 +209,14 @@ lazy val commonJsSettings = Seq(
199
209
doctestGenTests := Seq .empty
200
210
)
201
211
212
+ lazy val commonNativeSettings = Seq (
213
+ // currently sbt-doctest doesn't work in Native/JS builds
214
+ // https://github.com/tkawachi/sbt-doctest/issues/52
215
+ doctestGenTests := Seq .empty,
216
+ // Currently scala-native does not support Dotty
217
+ crossScalaVersions := { crossScalaVersions.value.filterNot(Seq (DottyOld , DottyNew ).contains) }
218
+ )
219
+
202
220
lazy val commonJvmSettings = Seq (
203
221
testOptions in Test += {
204
222
val flag = if (githubIsWorkflowBuild.value) " -oCI" else " -oDF"
@@ -497,8 +515,8 @@ lazy val cats = project
497
515
.settings(moduleName := " root" )
498
516
.settings(publishSettings) // these settings are needed to release all aggregated modules under this root module
499
517
.settings(noPublishSettings) // this is to exclude the root module itself from being published.
500
- .aggregate(catsJVM, catsJS)
501
- .dependsOn(catsJVM, catsJS, tests.jvm % " test-internal -> test" )
518
+ .aggregate(catsJVM, catsJS, catsNative )
519
+ .dependsOn(catsJVM, catsJS, catsNative, tests.jvm % " test-internal -> test" )
502
520
503
521
lazy val catsJVM = project
504
522
.in(file(" .catsJVM" ))
@@ -565,7 +583,41 @@ lazy val catsJS = project
565
583
)
566
584
.enablePlugins(ScalaJSPlugin )
567
585
568
- lazy val kernel = crossProject(JSPlatform , JVMPlatform )
586
+ lazy val catsNative = project
587
+ .in(file(" .catsNative" ))
588
+ .settings(moduleName := " cats" )
589
+ .settings(noPublishSettings)
590
+ .settings(catsSettings)
591
+ .settings(commonNativeSettings)
592
+ .aggregate(
593
+ kernel.native,
594
+ kernelLaws.native,
595
+ core.native,
596
+ laws.native,
597
+ free.native,
598
+ testkit.native,
599
+ tests.native,
600
+ alleycatsCore.native,
601
+ alleycatsLaws.native,
602
+ alleycatsTests.native,
603
+ native
604
+ )
605
+ .dependsOn(
606
+ kernel.native,
607
+ kernelLaws.native,
608
+ core.native,
609
+ laws.native,
610
+ free.native,
611
+ testkit.native,
612
+ tests.native % " test-internal -> test" ,
613
+ alleycatsCore.native,
614
+ alleycatsLaws.native,
615
+ alleycatsTests.native % " test-internal -> test" ,
616
+ native
617
+ )
618
+ .enablePlugins(ScalaNativePlugin )
619
+
620
+ lazy val kernel = crossProject(JSPlatform , JVMPlatform , NativePlatform )
569
621
.crossType(CrossType .Pure )
570
622
.in(file(" kernel" ))
571
623
.settings(moduleName := " cats-kernel" , name := " Cats kernel" )
@@ -575,11 +627,13 @@ lazy val kernel = crossProject(JSPlatform, JVMPlatform)
575
627
.settings(includeGeneratedSrc)
576
628
.jsSettings(commonJsSettings)
577
629
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-kernel" ))
630
+ .nativeSettings(commonNativeSettings)
631
+ .settings(testingDependencies)
578
632
.settings(
579
633
libraryDependencies += " org.scalacheck" %%% " scalacheck" % scalaCheckVersion % Test
580
634
)
581
635
582
- lazy val kernelLaws = crossProject(JSPlatform , JVMPlatform )
636
+ lazy val kernelLaws = crossProject(JSPlatform , JVMPlatform , NativePlatform )
583
637
.in(file(" kernel-laws" ))
584
638
.settings(moduleName := " cats-kernel-laws" , name := " Cats kernel laws" )
585
639
.settings(commonSettings)
@@ -590,8 +644,9 @@ lazy val kernelLaws = crossProject(JSPlatform, JVMPlatform)
590
644
.jsSettings(commonJsSettings)
591
645
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-kernel-laws" , includeCats1 = false ))
592
646
.dependsOn(kernel)
647
+ .nativeSettings(commonNativeSettings)
593
648
594
- lazy val core = crossProject(JSPlatform , JVMPlatform )
649
+ lazy val core = crossProject(JSPlatform , JVMPlatform , NativePlatform )
595
650
.crossType(CrossType .Pure )
596
651
.dependsOn(kernel)
597
652
.settings(moduleName := " cats-core" , name := " Cats core" )
@@ -611,8 +666,10 @@ lazy val core = crossProject(JSPlatform, JVMPlatform)
611
666
)
612
667
.jsSettings(commonJsSettings)
613
668
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-core" ))
669
+ .settings(testingDependencies)
670
+ .nativeSettings(commonNativeSettings)
614
671
615
- lazy val laws = crossProject(JSPlatform , JVMPlatform )
672
+ lazy val laws = crossProject(JSPlatform , JVMPlatform , NativePlatform )
616
673
.crossType(CrossType .Pure )
617
674
.dependsOn(kernel, core, kernelLaws)
618
675
.settings(moduleName := " cats-laws" , name := " Cats laws" )
@@ -621,16 +678,18 @@ lazy val laws = crossProject(JSPlatform, JVMPlatform)
621
678
.settings(testingDependencies)
622
679
.jsSettings(commonJsSettings)
623
680
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-laws" , includeCats1 = false ))
681
+ .nativeSettings(commonNativeSettings)
624
682
625
- lazy val free = crossProject(JSPlatform , JVMPlatform )
683
+ lazy val free = crossProject(JSPlatform , JVMPlatform , NativePlatform )
626
684
.crossType(CrossType .Pure )
627
685
.dependsOn(core, tests % " test-internal -> test" )
628
686
.settings(moduleName := " cats-free" , name := " Cats Free" )
629
687
.settings(catsSettings)
630
688
.jsSettings(commonJsSettings)
631
689
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-free" ))
690
+ .nativeSettings(commonNativeSettings)
632
691
633
- lazy val tests = crossProject(JSPlatform , JVMPlatform )
692
+ lazy val tests = crossProject(JSPlatform , JVMPlatform , NativePlatform )
634
693
.crossType(CrossType .Pure )
635
694
.dependsOn(testkit % Test )
636
695
.settings(moduleName := " cats-tests" )
@@ -640,8 +699,9 @@ lazy val tests = crossProject(JSPlatform, JVMPlatform)
640
699
.jsSettings(commonJsSettings)
641
700
.jvmSettings(commonJvmSettings)
642
701
.settings(scalacOptions in Test := (scalacOptions in Test ).value.filter(_ != " -Xfatal-warnings" ))
702
+ .nativeSettings(commonNativeSettings)
643
703
644
- lazy val testkit = crossProject(JSPlatform , JVMPlatform )
704
+ lazy val testkit = crossProject(JSPlatform , JVMPlatform , NativePlatform )
645
705
.crossType(CrossType .Pure )
646
706
.dependsOn(core, laws)
647
707
.enablePlugins(BuildInfoPlugin )
@@ -652,8 +712,9 @@ lazy val testkit = crossProject(JSPlatform, JVMPlatform)
652
712
.jsSettings(commonJsSettings)
653
713
.jvmSettings(commonJvmSettings ++ mimaSettings(" cats-testkit" , includeCats1 = false ))
654
714
.settings(scalacOptions := scalacOptions.value.filter(_ != " -Xfatal-warnings" ))
715
+ .nativeSettings(commonNativeSettings)
655
716
656
- lazy val alleycatsCore = crossProject(JSPlatform , JVMPlatform )
717
+ lazy val alleycatsCore = crossProject(JSPlatform , JVMPlatform , NativePlatform )
657
718
.crossType(CrossType .Pure )
658
719
.in(file(" alleycats-core" ))
659
720
.dependsOn(core)
@@ -663,8 +724,9 @@ lazy val alleycatsCore = crossProject(JSPlatform, JVMPlatform)
663
724
.settings(includeGeneratedSrc)
664
725
.jsSettings(commonJsSettings)
665
726
.jvmSettings(commonJvmSettings ++ mimaSettings(" alleycats-core" , includeCats1 = false ))
727
+ .nativeSettings(commonNativeSettings)
666
728
667
- lazy val alleycatsLaws = crossProject(JSPlatform , JVMPlatform )
729
+ lazy val alleycatsLaws = crossProject(JSPlatform , JVMPlatform , NativePlatform )
668
730
.crossType(CrossType .Pure )
669
731
.in(file(" alleycats-laws" ))
670
732
.dependsOn(alleycatsCore, laws)
@@ -675,8 +737,9 @@ lazy val alleycatsLaws = crossProject(JSPlatform, JVMPlatform)
675
737
.settings(testingDependencies)
676
738
.jsSettings(commonJsSettings)
677
739
.jvmSettings(commonJvmSettings ++ mimaSettings(" alleycats-laws" , includeCats1 = false ))
740
+ .nativeSettings(commonNativeSettings)
678
741
679
- lazy val alleycatsTests = crossProject(JSPlatform , JVMPlatform )
742
+ lazy val alleycatsTests = crossProject(JSPlatform , JVMPlatform , NativePlatform )
680
743
.in(file(" alleycats-tests" ))
681
744
.dependsOn(alleycatsLaws, tests % " test-internal -> test" )
682
745
.settings(moduleName := " alleycats-tests" )
@@ -685,6 +748,7 @@ lazy val alleycatsTests = crossProject(JSPlatform, JVMPlatform)
685
748
.jsSettings(commonJsSettings)
686
749
.jvmSettings(commonJvmSettings)
687
750
.settings(scalacOptions in Test := (scalacOptions in Test ).value.filter(_ != " -Xfatal-warnings" ))
751
+ .nativeSettings(commonNativeSettings)
688
752
689
753
// bench is currently JVM-only
690
754
@@ -729,6 +793,14 @@ lazy val js = project
729
793
.settings(commonJsSettings)
730
794
.enablePlugins(ScalaJSPlugin )
731
795
796
+ // cats-native is Native-only
797
+ lazy val native = project
798
+ .dependsOn(core.native, tests.native % " test-internal -> test" )
799
+ .settings(moduleName := " cats-native" )
800
+ .settings(catsSettings)
801
+ .settings(commonNativeSettings)
802
+ .enablePlugins(ScalaNativePlugin )
803
+
732
804
// cats-jvm is JVM-only
733
805
lazy val jvm = project
734
806
.dependsOn(core.jvm, tests.jvm % " test-internal -> test" )
@@ -833,14 +905,24 @@ addCommandAlias("buildTestsJVM", ";lawsJVM/test;testkitJVM/test;testsJVM/test;jv
833
905
addCommandAlias(" buildFreeJVM" , " ;freeJVM/test" )
834
906
addCommandAlias(" buildAlleycatsJVM" , " ;alleycatsCoreJVM/test;alleycatsLawsJVM/test;alleycatsTestsJVM/test" )
835
907
addCommandAlias(" buildJVM" , " ;buildKernelJVM;buildCoreJVM;buildTestsJVM;buildFreeJVM;buildAlleycatsJVM" )
836
- addCommandAlias(" validateBC" , " ;binCompatTest/test;mimaReportBinaryIssues" )
908
+ addCommandAlias(" validateBC" , " ;binCompatTest/test;catsJVM/ mimaReportBinaryIssues" )
837
909
addCommandAlias(" validateJVM" , " ;fmtCheck;buildJVM;bench/test;validateBC;makeMicrosite" )
838
910
addCommandAlias(" validateJS" , " ;testsJS/test;js/test" )
839
911
addCommandAlias(" validateKernelJS" , " kernelLawsJS/test" )
840
912
addCommandAlias(" validateFreeJS" , " freeJS/test" )
841
913
addCommandAlias(" validateAlleycatsJS" , " alleycatsTestsJS/test" )
842
914
addCommandAlias(" validateAllJS" , " all testsJS/test js/test kernelLawsJS/test freeJS/test alleycatsTestsJS/test" )
843
- addCommandAlias(" validate" , " ;clean;validateJS;validateKernelJS;validateFreeJS;validateJVM" )
915
+ addCommandAlias(" validateNative" , " ;testsNative/test;native/test" )
916
+ addCommandAlias(" validateKernelNative" , " kernelLawsNative/test" )
917
+ addCommandAlias(" validateFreeNative" , " freeNative/test" )
918
+ addCommandAlias(" validateAlleycatsNative" , " alleycatsTestsNative/test" )
919
+ addCommandAlias(" validateAllNative" ,
920
+ " all testsNative/test native/test kernelLawsNative/test freeNative/test alleycatsTestsNative/test"
921
+ )
922
+ addCommandAlias(
923
+ " validate" ,
924
+ " ;clean;validateJS;validateKernelJS;validateFreeJS;validateNative;validateKernelNative;validateFreeNative;validateJVM"
925
+ )
844
926
845
927
addCommandAlias(" prePR" , " fmt" )
846
928
0 commit comments