Open blorente opened 6 years ago
Another point to consider, that project (ScalaExamples
) is written in Scala 2.10, but our pipeline did not raise an error.
Okay, so the problem is in these lines of the plugin:
def relevantProjects(state: State): Seq[(ProjectRef, String)] = {
val extracted = Project.extract(state)
for {
// For every project registered
p <- extracted.structure.allProjectRefs
// Get the full version
version <- scalaVersion.in(p).get(extracted.structure.data).toList
// Drop the patch number
partialVersion <- CrossVersion.partialVersion(version).toList
// Coerce to the version we want
fullVersion <- V.get(partialVersion).toList
} yield p -> fullVersion
}
val extracted = Project.extract(state)
extracts all projects correctly, but then this line in the for-comprehension (fullVersion <- V.get(partialVersion).toList
) returns None
, which gets transformed to List(), and thus the project is not considered and it fails silently.
I still need to investigate if this is specific to SBT 1.0.X.
When executing semanticdb, we can see that there are some managed sources that do get compiled (registered into
sbt
), but do not generate semanticdb files. Here is an example:Sources
Compilation run
Semanticdb run
My current hypothesis is that this is due to our plugin capturing
sbt
projects, and thus repositories that do not define projects are left out.Some things to note:
unmanagedSources
is where most of the code of the application livesmanagedSources
is where the generated code lives, for example, from usingscalapb
unmanagedSources
awk
magic to extract the paths:sbt "show sources" | awk -F"\\\\(|, |\\\\)|\\\\* " ' /(\(\/|\*)/ {for (i=2; i<=NF; i++) print $i}'