Skip to content

Commit 7551939

Browse files
authored
Merge pull request #6 from olafurpg/simpler-impl
Simplify implementation of `sourcegraphSemanticdbDirectories`
2 parents 8837592 + 0f1e995 commit 7551939

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

plugin/src/main/scala/com/sourcegraph/sbtsourcegraph/SourcegraphPlugin.scala

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -120,31 +120,16 @@ object SourcegraphPlugin extends AutoPlugin {
120120

121121
def configSettings: Seq[Def.Setting[_]] = List(
122122
sourcegraphUpload := sourcegraphUpload.value,
123-
sourcegraphSemanticdbDirectories := Def
124-
.taskDyn[List[File]] {
125-
val javacTargetroot = semanticdbJavacTargetroot.value
126-
if (!semanticdbEnabled.value && javacTargetroot.isEmpty) {
127-
Def.task {
128-
streams.value.log.warn(
129-
s"${name.value}: " +
130-
s"Skipping LSIF upload because SemanticDB is not enabled " +
131-
"To fix this problem for Scala project, add the setting `semanticdbEnabled := true`."
132-
)
133-
Nil
134-
}
135-
} else {
136-
Def.task {
137-
val _ = fullClasspath.value
138-
List(
139-
javacTargetroot,
140-
Option(semanticdbTargetRoot.value)
141-
).flatten
142-
.map(f => f / "META-INF" / "semanticdb")
143-
.filter(_.isDirectory())
144-
}
145-
}
146-
}
147-
.value
123+
sourcegraphSemanticdbDirectories := {
124+
val javacTargetroot = semanticdbJavacTargetroot.value
125+
val _ = fullClasspath.value
126+
List(
127+
javacTargetroot,
128+
Option(semanticdbTargetRoot.value)
129+
).flatten
130+
.map(f => f / "META-INF" / "semanticdb")
131+
.filter(_.isDirectory())
132+
}
148133
)
149134

150135
private val anyProjectFilter: ScopeFilter = ScopeFilter(

0 commit comments

Comments
 (0)