Documentation
¶
Overview ¶
Package javaloader turns the Java code of a registered repository into semantic facts, through the SCIP index scip-java emits.
scip-java runs the project's own build -- Maven, Gradle, sbt or mill -- with the SemanticDB javac plugin attached, so its targets are resolved by the compiler that would compile the code. That is what makes the edges EXACT_TYPECHECKED rather than candidates, and it is also the cost: indexing a Java repository means building it.
And a build writes into the directory it builds. `--targetroot` moves the SemanticDB output out, but Maven's `target/` and Gradle's `build/` belong to the build tool, so the repository is never the directory handed to it: the loader materialises the working tree elsewhere with internal/scratchtree and throws it away afterwards. AGENTS.md states the rule without an exception and this is what keeps it true.
Index ¶
Constants ¶
const DefaultCommand = "scip-java"
DefaultCommand is the indexer this loader drives.
const DefaultMaximumIndexTime = 20 * time.Minute
DefaultMaximumIndexTime bounds a build that will not finish. It is generous because a cold Maven build resolves its dependencies over the network.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Command is the scip-java executable, with arguments.
Command string
// BuildTool names the build system explicitly. Empty lets scip-java
// detect it, which is what it does well; naming it is for a repository
// that carries two.
BuildTool string
// TargetDirectory is where the indexer writes. It is outside every
// indexed repository on purpose -- see JavaTargetDirectory in the
// indexer options.
TargetDirectory string
Repository workspace.Repository
IncludeTests bool
// IncludeGenerated keeps the files the build produced. They are excluded
// by default: a graph whose symbols are mostly generated accessors
// answers questions about code nobody wrote.
IncludeGenerated bool
// MaximumIndexTime bounds one repository's build. Zero is
// DefaultMaximumIndexTime.
MaximumIndexTime time.Duration
}
Options configures one Java facts producer.