1- // shadow sbt-scalajs' crossProject and CrossType until Scala.js 1.0.0 is released
1+ // shadow sbt-scalajs' crossProject until Scala.js 1.0.0 is released
22import com .typesafe .tools .mima .core ._
3- import sbtcrossproject .{ crossProject , CrossType }
3+ import sbtcrossproject .crossProject
44
55val previousVersion = " 1.1.1"
66
7- inThisBuild(Def .settings(
8- crossScalaVersions := Seq (" 2.12.13" , " 2.11.12" , " 2.13.4" ),
9- scalaVersion := crossScalaVersions.value.head,
10- version := " 1.1.2-SNAPSHOT" ,
11- organization := " org.portable-scala" ,
12-
13- scalacOptions ++= Seq (
14- " -deprecation" ,
15- " -feature" ,
16- " -encoding" ,
17- " utf-8" ,
18- " -Xfatal-warnings" ,
19- ),
20-
21- homepage := Some (url(" https://github.com/portable-scala/portable-scala-reflect" )),
22- licenses += (" BSD New" ,
23- url(" https://github.com/portable-scala/portable-scala-reflect/blob/master/LICENSE" )),
24- scmInfo := Some (ScmInfo (
25- url(" https://github.com/portable-scala/portable-scala-reflect" ),
26- " scm:git:git@github.com:portable-scala/portable-scala-reflect.git" ,
27- Some (" scm:git:git@github.com:portable-scala/portable-scala-reflect.git" ))),
28- ))
7+ inThisBuild(
8+ Def .settings(
9+ crossScalaVersions := Seq (" 2.13.4" , " 2.12.13" , " 2.11.12" ),
10+ scalaVersion := crossScalaVersions.value.head,
11+ version := " 1.1.2-SNAPSHOT" ,
12+ organization := " org.portable-scala" ,
13+ scalacOptions ++= Seq (
14+ " -deprecation" ,
15+ " -feature" ,
16+ " -encoding" ,
17+ " utf-8" ,
18+ " -Ywarn-unused"
19+ ) ++ {
20+ if (sys.env.contains(" CI" )) {
21+ List (" -Xfatal-warnings" )
22+ } else {
23+ List () // to enable Scalafix locally
24+ }
25+ },
26+ semanticdbEnabled := true ,
27+ semanticdbOptions += " -P:semanticdb:synthetics:on" ,
28+ semanticdbVersion := scalafixSemanticdb.revision,
29+ ThisBuild / scalafixScalaBinaryVersion := CrossVersion
30+ .binaryScalaVersion(scalaVersion.value),
31+ ThisBuild / scalafixDependencies += " com.github.liancheng" %% " organize-imports" % " 0.5.0" ,
32+ libraryDependencies ++= List (
33+ (" com.github.ghik" % " silencer-lib" % " 1.7.3" % Provided ).cross(CrossVersion .full),
34+ compilerPlugin(
35+ (" com.github.ghik" % " silencer-plugin" % " 1.7.3" ).cross(CrossVersion .full)
36+ )
37+ ),
38+ homepage := Some (url(" https://github.com/portable-scala/portable-scala-reflect" )),
39+ licenses += (" BSD New" ,
40+ url(" https://github.com/portable-scala/portable-scala-reflect/blob/master/LICENSE" )),
41+ scmInfo := Some (ScmInfo (url(" https://github.com/portable-scala/portable-scala-reflect" ),
42+ " scm:git:git@github.com:portable-scala/portable-scala-reflect.git" ,
43+ Some (" scm:git:git@github.com:portable-scala/portable-scala-reflect.git" )))
44+ ))
2945
3046lazy val `portable-scala-reflect` = crossProject(JSPlatform , JVMPlatform , NativePlatform )
3147 .in(file(" ." ))
3248 .settings(
33- scalacOptions in (Compile , doc) -= " -Xfatal-warnings" ,
34-
35- mimaPreviousArtifacts +=
36- organization.value %%% moduleName.value % previousVersion,
37-
38- publishMavenStyle := true ,
39- publishTo := {
40- val nexus = " https://oss.sonatype.org/"
41- if (isSnapshot.value)
42- Some (" snapshots" at nexus + " content/repositories/snapshots" )
43- else
44- Some (" releases" at nexus + " service/local/staging/deploy/maven2" )
45- },
46- pomExtra := (
47- <developers >
49+ scalacOptions in (Compile , doc) -= " -Xfatal-warnings" ,
50+ mimaPreviousArtifacts +=
51+ organization.value %%% moduleName.value % previousVersion,
52+ mimaBinaryIssueFilters ++= List (
53+ /* `MacroCompat` has been removed, it was needed for Scala 2.10 only */
54+ ProblemFilters .exclude[MissingClassProblem ](
55+ " org.portablescala.reflect.internal.Macros$MacroCompat$" ),
56+ ProblemFilters .exclude[MissingClassProblem ](
57+ " org.portablescala.reflect.internal.Macros$MacroCompat$Scope1$" ),
58+ ProblemFilters .exclude[MissingClassProblem ](
59+ " org.portablescala.reflect.internal.Macros$MacroCompat$Scope2$" ),
60+ ProblemFilters .exclude[MissingClassProblem ](
61+ " org.portablescala.reflect.internal.Macros$MacroCompat$Scope2$Inner$" ),
62+ ProblemFilters .exclude[MissingClassProblem ](
63+ " org.portablescala.reflect.internal.Macros$MacroCompat$Scope1$blackbox$" )
64+ ),
65+ publishMavenStyle := true ,
66+ publishTo := {
67+ val nexus = " https://oss.sonatype.org/"
68+ if (isSnapshot.value)
69+ Some (" snapshots" .at(nexus + " content/repositories/snapshots" ))
70+ else
71+ Some (" releases" .at(nexus + " service/local/staging/deploy/maven2" ))
72+ },
73+ pomExtra := (
74+ <developers >
4875 <developer >
4976 <id >sjrd</id >
5077 <name >S ébastien Doeraene </name >
@@ -61,22 +88,28 @@ lazy val `portable-scala-reflect` = crossProject(JSPlatform, JVMPlatform, Native
6188 <url >https:// github.com/ densh/</ url>
6289 </developer >
6390 </developers >
64- ),
65- pomIncludeRepository := { _ => false },
91+ ),
92+ pomIncludeRepository := { _ => false }
6693 )
6794 .jvmSettings(
68- // Macros
69- libraryDependencies += scalaOrganization.value % " scala-reflect" % scalaVersion.value % Provided ,
70-
71- // Speed up compilation a bit. Our .java files do not need to see the .scala files.
72- compileOrder := CompileOrder .JavaThenScala ,
73-
74- libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % " test" ,
95+ // Macros
96+ libraryDependencies += scalaOrganization.value % " scala-reflect" % scalaVersion.value % Provided ,
97+ // Speed up compilation a bit. Our .java files do not need to see the .scala files.
98+ compileOrder := CompileOrder .JavaThenScala ,
99+ libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % " test"
75100 )
76101 .jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin ))
77102 .nativeSettings(
78- libraryDependencies +=
79- " org.scala-native" %%% " junit-runtime" % " 0.4.0" % " test" ,
80- addCompilerPlugin(
81- " org.scala-native" % " junit-plugin" % " 0.4.0" cross CrossVersion .full),
103+ libraryDependencies +=
104+ " org.scala-native" %%% " junit-runtime" % " 0.4.0" % " test" ,
105+ addCompilerPlugin((" org.scala-native" % " junit-plugin" % " 0.4.0" ).cross(CrossVersion .full))
82106 )
107+
108+ addCommandAlias(
109+ " fix" ,
110+ " ; all compile:scalafix test:scalafix; all scalafmtSbt scalafmtAll"
111+ )
112+ addCommandAlias(
113+ " lint" ,
114+ " ; scalafmtSbtCheck; scalafmtCheckAll; compile:scalafix --check; test:scalafix --check"
115+ )
0 commit comments