Skip to content

Commit 0f1e995

Browse files
committed
Simplify implementation of sourcegraphSemanticdbDirectories
The old implementation was not working in some cases. The new implementation triggers full compilation regardless if SemanticDB is enabled or not.
1 parent 113bc01 commit 0f1e995

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)