File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed
main/scala/com/sksamuel/scapegoat/sbt
sbt-test/artifacts/report-and-inclusion Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -3,4 +3,3 @@ runner.dialect = scala212
3
3
maxColumn = 120
4
4
align.preset = none
5
5
rewrite.trailingCommas.style = always
6
-
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ object ScapegoatSbtPlugin extends AutoPlugin {
12
12
13
13
object autoImport {
14
14
val Scapegoat = config(" scapegoat" ) extend Compile
15
+ val ScapegoatDeps = (config(" scapegoat-dep" ) extend Compile ).hide
15
16
16
17
lazy val scapegoat = taskKey[Unit ](" Run scapegoat quality checks" )
17
18
lazy val scapegoatCleanTask = taskKey[Unit ](" Conditionally clean the scapegoat output directories" )
@@ -41,7 +42,7 @@ object ScapegoatSbtPlugin extends AutoPlugin {
41
42
}
42
43
}
43
44
44
- override def projectConfigurations : Seq [Configuration ] = Seq (Scapegoat )
45
+ override def projectConfigurations : Seq [Configuration ] = Seq (ScapegoatDeps )
45
46
46
47
override def trigger = allRequirements
47
48
@@ -69,7 +70,7 @@ object ScapegoatSbtPlugin extends AutoPlugin {
69
70
unmanagedClasspath := (Compile / unmanagedClasspath).value,
70
71
scalacOptions := {
71
72
// find all deps for the compile scope
72
- val scapegoatDependencies = (Scapegoat / update).value matching configurationFilter(Scapegoat .name)
73
+ val scapegoatDependencies = (ScapegoatDeps / update).value matching configurationFilter(ScapegoatDeps .name)
73
74
// ensure we have the scapegoat dependency on the classpath and if so add it as a scalac plugin
74
75
scapegoatDependencies.find(_.getAbsolutePath.contains(ArtifactId )) match {
75
76
case None =>
@@ -149,7 +150,7 @@ object ScapegoatSbtPlugin extends AutoPlugin {
149
150
case _ => " 1.4.17"
150
151
}
151
152
}
152
- crossVersion(GroupId %% ArtifactId % selectedScapegoatVersion) % Scapegoat
153
+ crossVersion(GroupId %% ArtifactId % selectedScapegoatVersion) % ScapegoatDeps
153
154
},
154
155
)
155
156
}
Original file line number Diff line number Diff line change 1
1
lazy val root = (project in file(" ." ))
2
2
.settings(
3
3
name := " test-scapegoat-inclusion-in-pom" ,
4
- ThisBuild / scalaVersion := " 2.13.10" ,
4
+ libraryDependencies += " org.typelevel" %% " cats-core" % " 2.12.0" ,
5
+ ThisBuild / scalaVersion := " 2.13.14" ,
5
6
TaskKey [Unit ](" check" ) := {
6
7
val pom = scala.xml.XML .loadFile(makePom.value)
7
8
(pom \\ " dependencies" ).map(_ \ " dependency" ).find(dependency =>
Original file line number Diff line number Diff line change
1
+ import cats .syntax .all ._
2
+
1
3
object Boot extends App {
2
4
3
- println(" Hello World" )
5
+ // Depend on Cats to verify that dependencies are maintained
6
+ println(" Hello " |+| " World" )
7
+
4
8
val ohno = Option (42 ).get
5
9
6
10
}
Original file line number Diff line number Diff line change 1
- > compile
1
+ > clean
2
2
-> scapegoat
3
3
$ exists target/scala-2.13/scapegoat-report/scapegoat.xml
4
+ -$ exists target/scala-2.13/classes/Boot.class
5
+ > clean
6
+ > compile
4
7
> makePom
8
+ -$ exists target/scala-2.13/scapegoat-report/scapegoat.xml
5
9
> check
You can’t perform that action at this time.
0 commit comments