Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -573,39 +573,16 @@ public List<Path> getBuilderModulePath() {
}

private List<Path> createTruffleBuilderModulePath() {
Path libTruffleDir = rootDir.resolve(Paths.get("lib", "truffle"));
List<Path> jars = getJars(libTruffleDir, "truffle-api", "truffle-runtime", "truffle-enterprise");
if (!jars.isEmpty()) {
/*
* If Truffle is installed as part of the JDK we always add the builder modules of
* Truffle to the builder module path. This is legacy support and should in the
* future no longer be needed.
*/
jars.addAll(getJars(libTruffleDir, "truffle-compiler"));
Path builderPath = rootDir.resolve(Paths.get("lib", "truffle", "builder"));
if (Files.exists(builderPath)) {
List<Path> truffleRuntimeSVMJars = getJars(builderPath, "truffle-runtime-svm", "truffle-enterprise-svm");
jars.addAll(truffleRuntimeSVMJars);
if (libJvmciDir != null && !truffleRuntimeSVMJars.isEmpty()) {
// truffle-runtime-svm depends on polyglot, which is not part of non-jlinked
// JDKs
jars.addAll(getJars(libJvmciDir, "polyglot"));
}
}
if (libJvmciDir != null) {
// truffle-runtime depends on polyglot, which is not part of non-jlinked JDKs
jars.addAll(getJars(libTruffleDir, "jniutils"));
}
}
/*
* Non-Jlinked JDKs don't have truffle-compiler as part of the JDK, however the native
* image builder still needs it
*/
if (libJvmciDir != null) {
jars.addAll(getJars(libTruffleDir, "truffle-compiler"));
Path libTruffleDir = rootDir.resolve(Paths.get("lib", "truffle"));
return getJars(libTruffleDir, "truffle-compiler");
} else {
return Collections.emptyList();
}

return jars;
}

/**
Expand Down