mirror of
https://github.com/apple/pkl.git
synced 2026-04-14 12:39:44 +02:00
Add ResourceReaders#fromServiceProviders to preconfigured evaluator (#1094)
The preconfigured evaluator currently adds module key factories from service providers, but not resource readers. This means that users of pkl-spring, for example, cannot add custom resource readers. This is also inconsistent (in the preconfigured evaluator, `import` can use custom schemes, but not `read`).
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
* Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -91,6 +91,7 @@ public final class EvaluatorBuilder {
|
||||
* <li>{@link ResourceReaders#https}
|
||||
* <li>{@link ResourceReaders#pkg}
|
||||
* <li>{@link ResourceReaders#projectpackage}
|
||||
* <li>{@link ResourceReaders#fromServiceProviders}
|
||||
* <li>{@link System#getProperties}
|
||||
* </ul>
|
||||
*/
|
||||
@@ -108,6 +109,7 @@ public final class EvaluatorBuilder {
|
||||
.addResourceReader(ResourceReaders.https())
|
||||
.addResourceReader(ResourceReaders.pkg())
|
||||
.addResourceReader(ResourceReaders.projectpackage())
|
||||
.addResourceReaders(ResourceReaders.fromServiceProviders())
|
||||
.addModuleKeyFactory(ModuleKeyFactories.standardLibrary);
|
||||
|
||||
if (!TruffleOptions.AOT) {
|
||||
|
||||
Reference in New Issue
Block a user