mirror of
https://github.com/apple/pkl.git
synced 2026-06-04 13:00:40 +02:00
Change loading of external readers (#1394)
This introduces breaking changes for external readers are loaded: 1. In PklProject, relative paths are resolved relative to the enclosing PklProject file (make behavior consistent with how other settings work) 2. Make CLI flags blow away any settings set on a PklProject 3. Introduce a new `workingDir` property, which defaults to the PklProject dir The overall goal is to make this behavior consistent with how other settings work. For example, relative paths for other evaluator settings are already relative to the project directory. Additionally, in every other case, CLI flags will overwrite any setting set within PklProject.
This commit is contained in:
@@ -78,8 +78,10 @@ endif::[]
|
||||
:uri-stdlib-pklbinaryModule: {uri-pkl-stdlib-docs}/pklbinary
|
||||
:uri-stdlib-yamlModule: {uri-pkl-stdlib-docs}/yaml
|
||||
:uri-stdlib-YamlParser: {uri-stdlib-yamlModule}/Parser
|
||||
:uri-stdlib-projectModule: {uri-pkl-stdlib-docs}/Project
|
||||
:uri-stdlib-evaluatorSettingsModule: {uri-pkl-stdlib-docs}/EvaluatorSettings
|
||||
:uri-stdlib-evaluatorSettingsHttpClass: {uri-stdlib-evaluatorSettingsModule}/Http
|
||||
:uri-stdlib-evaluatorSettingsExternalReaderClass: {uri-stdlib-evaluatorSettingsModule}/ExternalReader
|
||||
:uri-stdlib-Boolean: {uri-stdlib-baseModule}/Boolean
|
||||
:uri-stdlib-xor: {uri-stdlib-baseModule}/Boolean#xor()
|
||||
:uri-stdlib-implies: {uri-stdlib-baseModule}/Boolean#implies()
|
||||
|
||||
@@ -21,17 +21,31 @@ XXX
|
||||
|
||||
Ready when you need them.
|
||||
|
||||
.XXX
|
||||
[%collapsible]
|
||||
====
|
||||
XXX
|
||||
====
|
||||
=== Standard Library Changes
|
||||
|
||||
==== `pkl:EvaluatorSettings`
|
||||
|
||||
**Additions**
|
||||
|
||||
* New method: link:{uri-stdlib-evaluatorSettingsModule}#resolve()[`EvaluatorSettings.resolve()`]
|
||||
* New method: link:{uri-stdlib-evaluatorSettingsModule}#resolveForOs()[`EvaluatorSettings.resolveForOs()`]
|
||||
* New property: link:{uri-stdlib-evaluatorSettingsExternalReaderClass}#workingDir[`EvaluatorSettings#ExternalReader.workingDir`]
|
||||
|
||||
==== `pkl:Project`
|
||||
|
||||
**Additions**
|
||||
|
||||
* New property: link:{uri-stdlib-projectModule}#resolvedEvaluatorSettings[`Project.resolvedEvaluatorSettings`]
|
||||
|
||||
== Breaking Changes [small]#💔#
|
||||
|
||||
Things to watch out for when upgrading.
|
||||
|
||||
=== Removed Java APIs
|
||||
=== Java API changes
|
||||
|
||||
Changes have been made to the Java API.
|
||||
|
||||
==== Removals and deprecations
|
||||
|
||||
The following APIs have been removed without replacement.
|
||||
|
||||
@@ -41,11 +55,26 @@ The following APIs have been deprecated for removal.
|
||||
|
||||
* `org.pkl.config.java.mapper.NonNull` (https://github.com/apple/pkl/pull/1607[#1607]).
|
||||
|
||||
.XXX
|
||||
[%collapsible]
|
||||
====
|
||||
XXX
|
||||
====
|
||||
==== Changes
|
||||
|
||||
* `org.pkl.core.evaluatorSettings.PklEvaluatorSettings.parse` no longer accepts a `pathNormalizer` argument.
|
||||
|
||||
=== Loading rule changes in `pkl:EvaluatorSettings`
|
||||
|
||||
Breaking changes have been made to how evaluator settings are loaded (https://github.com/apple/pkl/pull/1394[#1394]).
|
||||
|
||||
==== Loading rule changes for the external reader executable
|
||||
|
||||
The following changes have been made for the `executable` property in an external reader:
|
||||
|
||||
* If the executable does not contain a slash (`/` on POSIX, `\` on Windows) character, it is always resolved against the `PATH` environment variable.
|
||||
* If it does contain a slash, it is resolved relative to the enclosing PklProject directory, instead of the current working directory.
|
||||
|
||||
=== Changes to `--external-module-reader` and `--external-resource-reader` CLI flags
|
||||
|
||||
The `--external-module-reader` and `--external-resource-reader` CLI flags will _replace_ any external readers otherwise configured within a PklProject, instead of add to it (https://github.com/apple/pkl/pull/1394[#1394]).
|
||||
|
||||
This makes this behavior consistent with how other settings work.
|
||||
|
||||
== Work In Progress [small]#🚆#
|
||||
|
||||
|
||||
Reference in New Issue
Block a user