1
- // shadow sbt-scalajs' crossProject and CrossType until Scala.js 1.0.0 is released
2
- import com .typesafe .tools .mima .core ._
3
- import sbtcrossproject .{crossProject , CrossType }
1
+ // shadow sbt-scalajs' crossProject until Scala.js 1.0.0 is released
2
+ import sbtcrossproject .crossProject
4
3
5
4
val previousVersion = " 1.1.1"
6
5
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:[email protected] :portable-scala/portable-scala-reflect.git" ,
27
- Some (
" scm:git:[email protected] :portable-scala/portable-scala-reflect.git" ))),
28
- ))
6
+ inThisBuild(
7
+ Def .settings(
8
+ crossScalaVersions := Seq (" 2.13.4" , " 2.12.13" , " 2.11.12" ),
9
+ scalaVersion := crossScalaVersions.value.head,
10
+ version := " 1.1.2-SNAPSHOT" ,
11
+ organization := " org.portable-scala" ,
12
+ scalacOptions ++= Seq (
13
+ " -deprecation" ,
14
+ " -feature" ,
15
+ " -encoding" ,
16
+ " utf-8" ,
17
+ " -Ywarn-unused"
18
+ ) ++ {
19
+ if (sys.env.contains(" CI" )) {
20
+ List (" -Xfatal-warnings" )
21
+ } else {
22
+ List () // to enable Scalafix locally
23
+ }
24
+ },
25
+ semanticdbEnabled := true ,
26
+ semanticdbOptions += " -P:semanticdb:synthetics:on" ,
27
+ semanticdbVersion := scalafixSemanticdb.revision,
28
+ ThisBuild / scalafixScalaBinaryVersion := CrossVersion
29
+ .binaryScalaVersion(scalaVersion.value),
30
+ ThisBuild / scalafixDependencies += " com.github.liancheng" %% " organize-imports" % " 0.5.0" ,
31
+ libraryDependencies ++= List (
32
+ (" com.github.ghik" % " silencer-lib" % " 1.7.3" % Provided ).cross(CrossVersion .full),
33
+ compilerPlugin(
34
+ (" com.github.ghik" % " silencer-plugin" % " 1.7.3" ).cross(CrossVersion .full)
35
+ )
36
+ ),
37
+ homepage := Some (url(" https://github.com/portable-scala/portable-scala-reflect" )),
38
+ licenses += (" BSD New" ,
39
+ url(" https://github.com/portable-scala/portable-scala-reflect/blob/master/LICENSE" )),
40
+ scmInfo := Some (ScmInfo (url(" https://github.com/portable-scala/portable-scala-reflect" ),
41
+ " scm:git:[email protected] :portable-scala/portable-scala-reflect.git" ,
42
+ Some (
" scm:git:[email protected] :portable-scala/portable-scala-reflect.git" )))
43
+ ))
29
44
30
45
lazy val `portable-scala-reflect` = crossProject(JSPlatform , JVMPlatform , NativePlatform )
31
46
.in(file(" ." ))
32
47
.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 >
48
+ scalacOptions in (Compile , doc) -= " -Xfatal-warnings" ,
49
+ mimaPreviousArtifacts +=
50
+ organization.value %%% moduleName.value % previousVersion,
51
+ publishMavenStyle := true ,
52
+ publishTo := {
53
+ val nexus = " https://oss.sonatype.org/"
54
+ if (isSnapshot.value)
55
+ Some (" snapshots" .at(nexus + " content/repositories/snapshots" ))
56
+ else
57
+ Some (" releases" .at(nexus + " service/local/staging/deploy/maven2" ))
58
+ },
59
+ pomExtra := (
60
+ <developers >
48
61
<developer >
49
62
<id >sjrd</id >
50
63
<name >S ébastien Doeraene </name >
@@ -61,22 +74,28 @@ lazy val `portable-scala-reflect` = crossProject(JSPlatform, JVMPlatform, Native
61
74
<url >https:// github.com/ densh/</ url>
62
75
</developer >
63
76
</developers >
64
- ),
65
- pomIncludeRepository := { _ => false },
77
+ ),
78
+ pomIncludeRepository := { _ => false }
66
79
)
67
80
.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" ,
81
+ // Macros
82
+ libraryDependencies += scalaOrganization.value % " scala-reflect" % scalaVersion.value % Provided ,
83
+ // Speed up compilation a bit. Our .java files do not need to see the .scala files.
84
+ compileOrder := CompileOrder .JavaThenScala ,
85
+ libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % " test"
75
86
)
76
87
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin ))
77
88
.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),
89
+ libraryDependencies +=
90
+ " org.scala-native" %%% " junit-runtime" % " 0.4.0" % " test" ,
91
+ addCompilerPlugin((" org.scala-native" % " junit-plugin" % " 0.4.0" ).cross(CrossVersion .full))
82
92
)
93
+
94
+ addCommandAlias(
95
+ " fix" ,
96
+ " ; all compile:scalafix test:scalafix; all scalafmtSbt scalafmtAll"
97
+ )
98
+ addCommandAlias(
99
+ " lint" ,
100
+ " ; scalafmtSbtCheck; scalafmtCheckAll; compile:scalafix --check; test:scalafix --check"
101
+ )
0 commit comments