mirror of
https://github.com/apple/pkl.git
synced 2026-06-14 01:24:29 +02:00
Fix spelling errors (#846)
Also: change checksums due to filename and content changes, and fix language snippet test output to produce correct error messages
This commit is contained in:
@@ -75,7 +75,7 @@ requestId: Int
|
||||
/// API version of the CLI's `--allowed-modules` flag
|
||||
allowedModules: Listing<String>?
|
||||
|
||||
/// Regex patterns to dettermine which resources are allowed to be read.
|
||||
/// Regex patterns to determine which resources are allowed to be read.
|
||||
///
|
||||
/// API version of the CLI's `--allowed-resources` flag
|
||||
allowedResources: Listing<String>?
|
||||
@@ -130,7 +130,7 @@ class ClientResourceReader {
|
||||
/// The URI scheme this reader is responsible for reading.
|
||||
scheme: String
|
||||
|
||||
/// Tells whether the path part of ths URI has a
|
||||
/// Tells whether the path part of this URI has a
|
||||
/// [hier-part](https://datatracker.ietf.org/doc/html/rfc3986#section-3).
|
||||
///
|
||||
/// An example of a hierarchical URI is `file:///path/to/my/file`, where
|
||||
@@ -148,7 +148,7 @@ class ClientModuleReader {
|
||||
/// The URI scheme this reader is responsible for reading.
|
||||
scheme: String
|
||||
|
||||
/// Tells whether the path part of ths URI has a
|
||||
/// Tells whether the path part of this URI has a
|
||||
/// [hier-part](https://datatracker.ietf.org/doc/html/rfc3986#section-3).
|
||||
///
|
||||
/// An example of a hierarchical URI is `file:///path/to/my/file`, where
|
||||
@@ -427,7 +427,7 @@ evaluatorId: Int
|
||||
/// The contents of the resource.
|
||||
contents: Binary? // <1>
|
||||
|
||||
/// The description of the error that occured when reading this resource.
|
||||
/// The description of the error that occurred when reading this resource.
|
||||
error: String?
|
||||
|
||||
typealias Binary = Any // <1>
|
||||
@@ -478,7 +478,7 @@ evaluatorId: Int
|
||||
/// The string contents of the module.
|
||||
contents: String?
|
||||
|
||||
/// The description of the error that occured when reading this resource.
|
||||
/// The description of the error that occurred when reading this resource.
|
||||
error: String?
|
||||
----
|
||||
|
||||
@@ -528,7 +528,7 @@ evaluatorId: Int
|
||||
/// The elements at the provided base path.
|
||||
pathElements: Listing<PathElement>?
|
||||
|
||||
/// The description of the error that occured when listing elements.
|
||||
/// The description of the error that occurred when listing elements.
|
||||
error: String?
|
||||
|
||||
class PathElement {
|
||||
@@ -586,7 +586,7 @@ evaluatorId: Int
|
||||
/// The elements at the provided base path.
|
||||
pathElements: Listing<PathElement>?
|
||||
|
||||
/// The description of the error that occured when listing elements.
|
||||
/// The description of the error that occurred when listing elements.
|
||||
error: String?
|
||||
|
||||
class PathElement {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
= Java Code Generator
|
||||
include::ROOT:partial$component-attributes.adoc[]
|
||||
:uri-pkl-codgen-java-maven-module: {uri-maven-docsite}/artifact/org.pkl-lang/pkl-codegen-java
|
||||
:uri-pkl-codegen-java-maven-module: {uri-maven-docsite}/artifact/org.pkl-lang/pkl-codegen-java
|
||||
|
||||
The Java source code generator takes Pkl class definitions as an input, and generates corresponding Java classes with equally named properties.
|
||||
|
||||
@@ -23,7 +23,7 @@ See xref:pkl-gradle:index.adoc#installation[Installation] in the Gradle plugin c
|
||||
[[install-library]]
|
||||
=== Java Library
|
||||
|
||||
The `pkl-codegen-java` library is available {uri-pkl-codgen-java-maven-module}[from Maven Central].
|
||||
The `pkl-codegen-java` library is available {uri-pkl-codegen-java-maven-module}[from Maven Central].
|
||||
It requires Java 17 or higher.
|
||||
|
||||
ifndef::is-release-version[]
|
||||
|
||||
@@ -2573,7 +2573,7 @@ the following security checks are performed:
|
||||
* The target module URI is checked against the module allowlist (`--allowed-modules`).
|
||||
* The source and target modules' _trust levels_ are determined and compared.
|
||||
|
||||
For access to be granted, the source module's trust level must be higher than or equal to the target module's trust level.
|
||||
For access to be granted, the source module's trust level must be greater than or equal to the target module's trust level.
|
||||
By default, there are five trust levels, listed from highest to lowest:
|
||||
|
||||
. `repl:` modules (code evaluated in the REPL)
|
||||
@@ -3353,9 +3353,9 @@ swiftHatchlings = typedProperty.listHatchlings(new { "Poppy"; "Chirpy" }) // <8>
|
||||
<2> Assignment to an undeclared property in module context, amending `new Dynamic {}`.
|
||||
<3> `Listing` element creation, amending implicit `default`, `new Bird {}`.
|
||||
<4> `Listing` element creation, amending implicit `default`, `new Dynamic {}`.
|
||||
<5> `Mapping` value assignment, amdending the result of applying `default` to `"Saltmarsh Sparrow"`, `new Bird { name = "Saltmarsh Sparrow" }`.
|
||||
<5> `Mapping` value assignment, amending the result of applying `default` to `"Saltmarsh Sparrow"`, `new Bird { name = "Saltmarsh Sparrow" }`.
|
||||
<6> `Mapping` value assignment _replacing_ the parent's entry, amending the result of applying `default` to `"Saltmarsh Sparrow"`, `new Bird { name = "Saltmarsh Sparrow" }`.
|
||||
<7> Admending the property default value `new Listing { new Bird { name = "Osprey" } }`; the result contains both birds.
|
||||
<7> Amending the property default value `new Listing { new Bird { name = "Osprey" } }`; the result contains both birds.
|
||||
<8> Error: Cannot tell which parent to amend.
|
||||
|
||||
[[let-expressions]]
|
||||
@@ -5475,7 +5475,7 @@ Readers are implemented as ordinary executables and use Pkl's xref:bindings-spec
|
||||
The xref:swift:ROOT:index.adoc[Swift] and xref:go:ROOT:index.adoc[Go] language binding libraries provide an `ExternalReaderRuntime` type to facilitate implementing external readers.
|
||||
|
||||
External readers are configured separately for modules and resources.
|
||||
They are registered by mapping their URI scheme to the executable to run and additonal arguments to pass.
|
||||
They are registered by mapping their URI scheme to the executable to run and additional arguments to pass.
|
||||
This is done on the command line by passing `--external-resource-reader` and `--external-module-reader` flags, which may both be passed multiple times.
|
||||
|
||||
[source,text]
|
||||
|
||||
@@ -12,7 +12,7 @@ This release brings Windows support, improvements to controlling how Pkl talks o
|
||||
|
||||
The next release (0.27) is scheduled for October 10th, 2024.
|
||||
|
||||
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[Github]. +
|
||||
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[GitHub]. +
|
||||
|
||||
[small]#Pkl is hosted on https://github.com/apple/pkl[GitHub].
|
||||
To get started, follow xref:pkl-cli:index.adoc#installation[Installation].#
|
||||
@@ -460,7 +460,7 @@ To mitigate, the package's version needs to be bumped, even if package contents
|
||||
|
||||
== Miscellaneous [small]#🐸#
|
||||
|
||||
The following changes have been made that are not new features, nor breaking changes.
|
||||
The following changes have been made that are neither new features nor breaking changes.
|
||||
|
||||
* Pkl's user-agent header for HTTP requests has been tweaked to add a semicolon (https://github.com/apple/pkl/pull/221[#221]). Here is an example difference:
|
||||
+
|
||||
|
||||
@@ -12,7 +12,7 @@ This release brings improvements in typechecking of `Listing` and `Mapping`, the
|
||||
|
||||
The next release (0.28) is scheduled for February 2025.
|
||||
|
||||
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[Github]. +
|
||||
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[GitHub]. +
|
||||
|
||||
[small]#Pkl is hosted on https://github.com/apple/pkl[GitHub].
|
||||
To get started, follow xref:pkl-cli:index.adoc#installation[Installation].#
|
||||
@@ -121,7 +121,7 @@ A new API has been added to analyze the import graph of Pkl modules (https://git
|
||||
This API comes in four forms:
|
||||
|
||||
1. A standard library module: `pkl:analyze`
|
||||
2. A CLI command: `pkl anaylze imports`
|
||||
2. A CLI command: `pkl analyze imports`
|
||||
3. A Java API: `org.pkl.core.Analyzer`
|
||||
4. A Gradle API: `org.pkl.gradle.task.AnalyzeImportsTask`
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Pkl {version} was released on {release-date}. +
|
||||
|
||||
The next release (0.XX) is scheduled for ???..
|
||||
|
||||
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[Github]. +
|
||||
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[GitHub]. +
|
||||
|
||||
[small]#Pkl is hosted on https://github.com/apple/pkl[GitHub].
|
||||
To get started, follow xref:pkl-cli:index.adoc#installation[Installation].#
|
||||
|
||||
@@ -12,7 +12,7 @@ XXX
|
||||
|
||||
The next release (XXX) is scheduled for XXX (e.g., August 2, 2021).
|
||||
|
||||
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[Github]. +
|
||||
Please send feedback and questions to https://github.com/apple/pkl/discussions[GitHub Discussions], or submit an issue on https://github.com/apple/pkl/issues/new[GitHub]. +
|
||||
|
||||
[small]#Pkl is hosted on https://github.com/apple/pkl[GitHub].
|
||||
To get started, follow xref:pkl-cli:index.adoc#installation[Installation].#
|
||||
|
||||
@@ -356,7 +356,7 @@ myString = #"foo \ bar \ baz"#
|
||||
myString = "foo \\ bar \\ baz"
|
||||
----
|
||||
|
||||
NOTE: Sometimes, using custom string delimiters makes source code harder to read. For example, the `+\#+` literal reads better using escapes (`"\\#"`) than using custom string delimimters (`+##"\#"##+`).
|
||||
NOTE: Sometimes, using custom string delimiters makes source code harder to read. For example, the `+\#+` literal reads better using escapes (`"\\#"`) than using custom string delimiters (`+##"\#"##+`).
|
||||
|
||||
=== Interpolation
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ class AnalyzeCommand(helpLink: String) :
|
||||
ModulesCommand(
|
||||
name = "imports",
|
||||
helpLink = helpLink,
|
||||
help = "Prints the the graph of modules imported by the input module(s)."
|
||||
help = "Prints the graph of modules imported by the input module(s)."
|
||||
) {
|
||||
|
||||
private val outputPath: Path? by
|
||||
|
||||
@@ -1242,7 +1242,7 @@ result = someLib.x
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `gives decent error message if certificate file is emtpy`(@TempDir tempDir: Path) {
|
||||
fun `gives decent error message if certificate file is empty`(@TempDir tempDir: Path) {
|
||||
val emptyCerts = tempDir.writeEmptyFile("empty.pem")
|
||||
val err = assertThrows<CliException> { evalModuleThatImportsPackage(emptyCerts) }
|
||||
assertThat(err).hasMessageContaining("CA certificate file `${emptyCerts.pathString}` is empty.")
|
||||
@@ -1313,7 +1313,7 @@ result = someLib.x
|
||||
val options =
|
||||
CliEvaluatorOptions(
|
||||
CliBaseOptions(
|
||||
sourceModules = listOf(URI("package://localhost:1/birds@0.5.0#/catalog/Ostritch.pkl")),
|
||||
sourceModules = listOf(URI("package://localhost:1/birds@0.5.0#/catalog/Ostrich.pkl")),
|
||||
noCache = true,
|
||||
httpProxy = URI(wwRuntimeInfo.httpBaseUrl),
|
||||
caCertificates = listOf(FileTestUtils.selfSignedCertificate),
|
||||
@@ -1324,7 +1324,7 @@ result = someLib.x
|
||||
assertThat(output)
|
||||
.isEqualTo(
|
||||
"""
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
amends "../Bird.pkl"
|
||||
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
@@ -46,7 +46,7 @@ import org.pkl.commons.deleteRecursively
|
||||
*/
|
||||
class PackageServer : AutoCloseable {
|
||||
companion object {
|
||||
const val BIRDS_SHA = "bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d"
|
||||
const val BIRDS_SHA = "6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e"
|
||||
const val FRUIT_SHA = "34a15b02346e6acb85da5bd71d8b0738a79008b38a7fc805e5869d9129ad27d2"
|
||||
const val FRUIT_1_1_SHA = "8d982761d182f2185e4180c82190791d9a60c721cb3393bb2e946fab90131e8c"
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ fun shlex(input: String): List<String> {
|
||||
quote = null
|
||||
lastCloseQuoteIndex = idx
|
||||
}
|
||||
// if not in a quote and encounter a quote charater, enter a quote
|
||||
// if not in a quote and encounter a quote character, enter a quote
|
||||
quote == null && (char == '\'' || char == '"') -> {
|
||||
quote = char
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ public final class ConfigEvaluatorBuilder {
|
||||
/**
|
||||
* Sets the set of URI patterns to be allowed when importing modules.
|
||||
*
|
||||
* <p>This is a convenieince method that delegates to the underlying evaluator builder.
|
||||
* <p>This is a convenience method that delegates to the underlying evaluator builder.
|
||||
*
|
||||
* @throws IllegalStateException if {@link #setSecurityManager(SecurityManager)} was also called.
|
||||
*/
|
||||
@@ -257,7 +257,7 @@ public final class ConfigEvaluatorBuilder {
|
||||
/**
|
||||
* Returns the set of patterns to be allowed when importing modules.
|
||||
*
|
||||
* <p>This is a convenieince method that delegates to the underlying evaluator builder.
|
||||
* <p>This is a convenience method that delegates to the underlying evaluator builder.
|
||||
*/
|
||||
public List<Pattern> getAllowedModules() {
|
||||
return evaluatorBuilder.getAllowedModules();
|
||||
@@ -266,7 +266,7 @@ public final class ConfigEvaluatorBuilder {
|
||||
/**
|
||||
* Sets the set of URI patterns to be allowed when reading resources.
|
||||
*
|
||||
* <p>This is a convenieince method that delegates to the underlying evaluator builder.
|
||||
* <p>This is a convenience method that delegates to the underlying evaluator builder.
|
||||
*
|
||||
* @throws IllegalStateException if {@link #setSecurityManager(SecurityManager)} was also called.
|
||||
*/
|
||||
@@ -278,7 +278,7 @@ public final class ConfigEvaluatorBuilder {
|
||||
/**
|
||||
* Returns the set of patterns to be allowed when reading resources.
|
||||
*
|
||||
* <p>This is a convenieince method that delegates to the underlying evaluator builder.
|
||||
* <p>This is a convenience method that delegates to the underlying evaluator builder.
|
||||
*/
|
||||
public List<Pattern> getAllowedResources() {
|
||||
return evaluatorBuilder.getAllowedResources();
|
||||
@@ -288,7 +288,7 @@ public final class ConfigEvaluatorBuilder {
|
||||
* Sets the root directory, which restricts access to file-based modules and resources located
|
||||
* under this directory.
|
||||
*
|
||||
* <p>This is a convenieince method that delegates to the underlying evaluator builder.
|
||||
* <p>This is a convenience method that delegates to the underlying evaluator builder.
|
||||
*/
|
||||
public ConfigEvaluatorBuilder setRootDir(@Nullable Path rootDir) {
|
||||
evaluatorBuilder.setRootDir(rootDir);
|
||||
@@ -298,7 +298,7 @@ public final class ConfigEvaluatorBuilder {
|
||||
/**
|
||||
* Returns the currently set root directory, if set.
|
||||
*
|
||||
* <p>This is a convenieince method that delegates to the underlying evaluator builder.
|
||||
* <p>This is a convenience method that delegates to the underlying evaluator builder.
|
||||
*/
|
||||
public @Nullable Path getRootDir() {
|
||||
return evaluatorBuilder.getRootDir();
|
||||
|
||||
+6
-6
@@ -41,8 +41,8 @@ public class PObjectToDataObjectTest {
|
||||
EnumSet.of(Hobby.SURFING, Hobby.SWIMMING),
|
||||
new Address("sesame street", 94105));
|
||||
|
||||
private static final PersonConstructoProperties pigeon2 =
|
||||
new PersonConstructoProperties(
|
||||
private static final PersonConstructorProperties pigeon2 =
|
||||
new PersonConstructorProperties(
|
||||
"pigeon",
|
||||
40,
|
||||
EnumSet.of(Hobby.SURFING, Hobby.SWIMMING),
|
||||
@@ -63,7 +63,7 @@ public class PObjectToDataObjectTest {
|
||||
@Test
|
||||
public void ex1_constructor_properties() {
|
||||
var ex1 = module.getProperty("ex1");
|
||||
assertThat(mapper.map(ex1, PersonConstructoProperties.class)).isEqualTo(pigeon2);
|
||||
assertThat(mapper.map(ex1, PersonConstructorProperties.class)).isEqualTo(pigeon2);
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -149,14 +149,14 @@ public class PObjectToDataObjectTest {
|
||||
}
|
||||
}
|
||||
|
||||
static class PersonConstructoProperties {
|
||||
static class PersonConstructorProperties {
|
||||
final String name;
|
||||
final int age;
|
||||
final Set<Hobby> hobbies;
|
||||
final Address address;
|
||||
|
||||
@ConstructorProperties({"name", "age", "hobbies", "address"})
|
||||
PersonConstructoProperties(String name, int age, Set<Hobby> hobbies, Address address) {
|
||||
PersonConstructorProperties(String name, int age, Set<Hobby> hobbies, Address address) {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
this.hobbies = hobbies;
|
||||
@@ -166,7 +166,7 @@ public class PObjectToDataObjectTest {
|
||||
@Override
|
||||
public boolean equals(@Nullable Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (!(obj instanceof PersonConstructoProperties other)) return false;
|
||||
if (!(obj instanceof PersonConstructorProperties other)) return false;
|
||||
return name.equals(other.name)
|
||||
&& age == other.age
|
||||
&& hobbies.equals(other.hobbies)
|
||||
|
||||
@@ -170,7 +170,7 @@ public interface Evaluator extends AutoCloseable {
|
||||
String evaluateExpressionString(ModuleSource moduleSource, String expression);
|
||||
|
||||
/**
|
||||
* Evalautes the module's schema, which describes the properties, methods, and classes of a
|
||||
* Evaluates the module's schema, which describes the properties, methods, and classes of a
|
||||
* module.
|
||||
*
|
||||
* @throws PklException if an error occurs during evaluation
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package org.pkl.core;
|
||||
|
||||
/**
|
||||
* Indicates that a non-existent property was requested for a {@link Composite}. To check if a
|
||||
* Indicates that a nonexistent property was requested for a {@link Composite}. To check if a
|
||||
* property exists, use {@link Composite#hasProperty(String)}.
|
||||
*/
|
||||
public final class NoSuchPropertyException extends RuntimeException {
|
||||
|
||||
@@ -106,7 +106,7 @@ public final class ClassNode extends ExpressionNode {
|
||||
new VmTyped(
|
||||
frame.materialize(),
|
||||
null, // initialized later by VmClass
|
||||
null, // initialized later by Vmclass
|
||||
null, // initialized later by VmClass
|
||||
prototypeMembers);
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ public abstract class TypeNode extends PklNode {
|
||||
}
|
||||
|
||||
/**
|
||||
* Visit child type nodes; but not paramaterized types (does not visit {@code String} in {@code
|
||||
* Visit child type nodes; but not parameterized types (does not visit {@code String} in {@code
|
||||
* Listing<String>}).
|
||||
*/
|
||||
protected abstract boolean acceptTypeNode(TypeNodeConsumer consumer);
|
||||
|
||||
@@ -534,7 +534,7 @@ public final class ModuleKeys {
|
||||
conn.connect();
|
||||
if (conn instanceof JarURLConnection && IoUtils.isWindows()) {
|
||||
// On Windows, opening a JarURLConnection prevents the jar file from being deleted, unless
|
||||
// cacheing is disabled.
|
||||
// caching is disabled.
|
||||
// See https://bugs.openjdk.org/browse/JDK-8239054
|
||||
conn.setUseCaches(false);
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ final class PackageResolvers {
|
||||
throw fileIsADirectory();
|
||||
}
|
||||
var entries = cachedEntries.get(packageUri);
|
||||
// need to normalize here but not in `doListElments` nor `doHasElement` because
|
||||
// need to normalize here but not in `doListElements` nor `doHasElement` because
|
||||
// `TreePathElement.getElement` does normalization already.
|
||||
var path = IoUtils.toNormalizedPathString(Path.of(uri.getAssetPath()).normalize());
|
||||
return entries.get(path).array();
|
||||
|
||||
@@ -434,7 +434,7 @@ public final class GlobResolver {
|
||||
}
|
||||
}
|
||||
|
||||
/** Split a glob pattern into the base, non-wildard parts, and the wildcard parts. */
|
||||
/** Split a glob pattern into the base, non-wildcard parts, and the wildcard parts. */
|
||||
private static Pair<String, String[]> splitGlobPatternIntoBaseAndWildcards(
|
||||
ReaderBase reader, String globPattern, boolean hasAbsoluteGlob) {
|
||||
var effectiveGlobPattern = globPattern;
|
||||
|
||||
@@ -483,8 +483,8 @@ public final class IoUtils {
|
||||
start++;
|
||||
}
|
||||
var uriPartsRemaining = uriParts.subList(start, uriParts.size());
|
||||
var basePartsRemainig = baseParts.subList(start, baseParts.size());
|
||||
if (basePartsRemainig.isEmpty()) {
|
||||
var basePartsRemaining = baseParts.subList(start, baseParts.size());
|
||||
if (basePartsRemaining.isEmpty()) {
|
||||
return new URI(
|
||||
null,
|
||||
null,
|
||||
@@ -495,7 +495,7 @@ public final class IoUtils {
|
||||
uri.getFragment());
|
||||
}
|
||||
var resultingPath =
|
||||
"../".repeat(basePartsRemainig.size()) + String.join("/", uriPartsRemaining);
|
||||
"../".repeat(basePartsRemaining.size()) + String.join("/", uriPartsRemaining);
|
||||
return new URI(null, null, null, -1, resultingPath, uri.getQuery(), uri.getFragment());
|
||||
} catch (URISyntaxException e) {
|
||||
// Impossible; started from a valid URI to begin with.
|
||||
@@ -716,7 +716,7 @@ public final class IoUtils {
|
||||
* URI#resolve(URI)}
|
||||
*/
|
||||
public static URI fixTripleSlashUri(URI baseUri, URI newUri) {
|
||||
// `getHost()` is erroroneously `null` when parsing triple-slash URIs.
|
||||
// `getHost()` is erroneously `null` when parsing triple-slash URIs.
|
||||
// Ensure that they are preserved during resolution.
|
||||
if (baseUri.getScheme() != null
|
||||
&& baseUri.getScheme().equalsIgnoreCase(newUri.getScheme())
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.pkl.core.util.Nullable;
|
||||
/**
|
||||
* Parser for JSON.
|
||||
*
|
||||
* <p>JSON types are paresd into the following Java types:
|
||||
* <p>JSON types are parsed into the following Java types:
|
||||
*
|
||||
* <table>
|
||||
* <thead>
|
||||
|
||||
@@ -675,7 +675,7 @@ invalidGlobInvalidCharacterInCharacterClass=\
|
||||
The character `{0}` is not valid in a character class.
|
||||
|
||||
invalidGlobExtGlob=\
|
||||
Extebded globbing features are not supported.
|
||||
Extended globbing features are not supported.
|
||||
|
||||
invalidGlobNestedSubpattern=\
|
||||
Sub-patterns cannot be nested. To fix, remove or escape the inner `{` character.
|
||||
@@ -750,7 +750,7 @@ Failed to resolve type required for rendering protobuf.\n\
|
||||
Consider adding a type annotation.
|
||||
|
||||
cannotRenderSubtypeForProtobuf=\
|
||||
Can not render subtype {0} of specified type {1} in protobuf.
|
||||
Cannot render subtype {0} of specified type {1} in protobuf.
|
||||
|
||||
cannotExportValue=\
|
||||
A value of type `{0}` cannot be exported.
|
||||
@@ -1079,7 +1079,7 @@ Certificates can only be loaded from `jar:` or `file:` URLs, but got:\n\
|
||||
|
||||
cannotFindBuiltInCertificates=\
|
||||
Cannot find Pkl's trusted CA certificates on the class path.\n\
|
||||
To fix this problem, add dependendy `org.pkl:pkl-certs`.
|
||||
To fix this problem, add dependency `org.pkl:pkl-certs`.
|
||||
|
||||
# suppress inspection "HttpUrlsUsage"
|
||||
malformedProxyAddress=\
|
||||
|
||||
@@ -15,21 +15,21 @@ parrot {
|
||||
new {
|
||||
// multiline string that is a property within an element
|
||||
lastName = """
|
||||
Flinstone
|
||||
Flintstone
|
||||
|
||||
Flinstone
|
||||
Flintstone
|
||||
"""
|
||||
"""
|
||||
Flinstone
|
||||
Flintstone
|
||||
|
||||
Flinstone
|
||||
Flintstone
|
||||
"""
|
||||
}
|
||||
// multiline string that is an element
|
||||
"""
|
||||
Flistone
|
||||
Flintstone
|
||||
|
||||
Flistone
|
||||
Flintstone
|
||||
"""
|
||||
}
|
||||
|
||||
|
||||
@@ -8,5 +8,5 @@ class Person {
|
||||
person = new Person {
|
||||
name = "Pigeon"
|
||||
// typo
|
||||
adress = "Howdy St."
|
||||
address_ = "Howdy St."
|
||||
}
|
||||
|
||||
@@ -26,14 +26,14 @@ examples {
|
||||
module.catch(() -> l[0])
|
||||
}
|
||||
|
||||
["type check: local paramaterized property type, unparamaterized new with explicit parent"] {
|
||||
["type check: local parameterized property type, unparameterized new with explicit parent"] {
|
||||
local m: Listing<String> = new Listing {
|
||||
1
|
||||
}
|
||||
module.catch(() -> m[0])
|
||||
}
|
||||
|
||||
["type check: local unparameterized property type, paramaterized new with explicit parent"] {
|
||||
["type check: local unparameterized property type, parameterized new with explicit parent"] {
|
||||
local m: Listing = new Listing<String> {
|
||||
1
|
||||
}
|
||||
@@ -105,7 +105,7 @@ examples {
|
||||
"Ba" // fails `length.isOdd`
|
||||
"bar" // fails `this == capitalize()`
|
||||
}
|
||||
// type check String(length.isOdd) should be propagated to the listing via a paramater type
|
||||
// type check String(length.isOdd) should be propagated to the listing via a parameter type
|
||||
// annotation
|
||||
local function func1(listing: Listing<String(length.isOdd)>) = listing
|
||||
// type check String(length.isOdd) should be propagated to the listing via a return type
|
||||
|
||||
@@ -35,7 +35,7 @@ local x7 = new Listing {
|
||||
}
|
||||
|
||||
local x8 = new Listing<String> {
|
||||
throw("element unneccessarily evaluated")
|
||||
throw("element unnecessarily evaluated")
|
||||
}
|
||||
|
||||
res5 = x4.length == 1
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl")
|
||||
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyRead.pkl")
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl")
|
||||
res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathRead.pkl")
|
||||
|
||||
@@ -13,14 +13,14 @@ examples {
|
||||
}
|
||||
}
|
||||
import("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl")
|
||||
import("package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl")
|
||||
import("package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl")
|
||||
}
|
||||
["importing while specifying checksum"] {
|
||||
import("package://localhost:0/birds@0.5.0::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/Swallow.pkl")
|
||||
import("package://localhost:0/birds@0.5.0::sha256:6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e#/catalog/Swallow.pkl")
|
||||
}
|
||||
["reads"] {
|
||||
read("package://localhost:0/birds@0.5.0#/Bird.pkl")
|
||||
read("package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl")
|
||||
read("package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl")
|
||||
read("package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,6 @@ examples {
|
||||
import("package://localhost:0/birds@0.5.0#/allFruit.pkl").fruitFiles
|
||||
}
|
||||
["glob import while specifying checksum"] {
|
||||
import*("package://localhost:0/birds@0.5.0::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/*.pkl")
|
||||
import*("package://localhost:0/birds@0.5.0::sha256:6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e#/catalog/*.pkl")
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
amends ".../snippetTest.pkl"
|
||||
|
||||
import "@birds/catalog/Ostritch.pkl"
|
||||
import "@birds/catalog/Ostrich.pkl"
|
||||
import "@birds/catalog/Swallow.pkl"
|
||||
|
||||
examples {
|
||||
["import package"] {
|
||||
Ostritch
|
||||
Ostrich
|
||||
Swallow
|
||||
}
|
||||
|
||||
|
||||
@@ -11,19 +11,19 @@ barnOwl {
|
||||
parrot {
|
||||
new {
|
||||
lastName = """
|
||||
Flinstone
|
||||
Flintstone
|
||||
|
||||
Flinstone
|
||||
Flintstone
|
||||
"""
|
||||
"""
|
||||
Flinstone
|
||||
Flintstone
|
||||
|
||||
Flinstone
|
||||
Flintstone
|
||||
"""
|
||||
}
|
||||
"""
|
||||
Flistone
|
||||
Flintstone
|
||||
|
||||
Flistone
|
||||
Flintstone
|
||||
"""
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ examples {
|
||||
foo: "renders"
|
||||
}
|
||||
"""
|
||||
"Can not render subtype protobuf#Foo of specified type protobuf#Bar in protobuf."
|
||||
"Cannot render subtype protobuf#Foo of specified type protobuf#Bar in protobuf."
|
||||
"""
|
||||
myFoo: {
|
||||
foo: "renders"
|
||||
|
||||
@@ -84,8 +84,8 @@ examples {
|
||||
}
|
||||
["package"] {
|
||||
new {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
|
||||
name = "Ostrich"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
@@ -101,7 +101,7 @@ examples {
|
||||
"package://localhost:0/birds@0.5.0#/Bird.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/allFruit.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/catalog.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
"package://localhost:0/birds@0.5.0#/some/dir/Bird.pkl"
|
||||
}
|
||||
@@ -116,8 +116,8 @@ examples {
|
||||
}
|
||||
["package glob and up one level"] {
|
||||
new {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/../catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/../catalog/Ostrich.pkl"] {
|
||||
name = "Ostrich"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
|
||||
@@ -156,19 +156,19 @@ examples {
|
||||
"""
|
||||
base64 = "bW9kdWxlIGJpcmRzLmNhdGFsb2cKCmNhdGFsb2cgPSBpbXBvcnQqKCJjYXRhbG9nLyoucGtsIikKY2F0YWxvZ0ZpbGVzID0gcmVhZCooImNhdGFsb2cvKi5wa2wiKQo="
|
||||
}
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
|
||||
}
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
–– Pkl Error ––
|
||||
Cannot find property `adress` in object of type `class3#Person`.
|
||||
Cannot find property `address_` in object of type `class3#Person`.
|
||||
|
||||
xx | adress = "Howdy St."
|
||||
^^^^^^
|
||||
xx | address_ = "Howdy St."
|
||||
^^^^^^^^
|
||||
at class3#person (file:///$snippetsDir/input/classes/class3.pkl)
|
||||
|
||||
Did you mean any of the following?
|
||||
|
||||
@@ -10,10 +10,10 @@ examples {
|
||||
["type check: local new with inferred parent"] {
|
||||
"Expected value of type `String`, but got type `Int`. Value: 1"
|
||||
}
|
||||
["type check: local paramaterized property type, unparamaterized new with explicit parent"] {
|
||||
["type check: local parameterized property type, unparameterized new with explicit parent"] {
|
||||
"Expected value of type `String`, but got type `Int`. Value: 1"
|
||||
}
|
||||
["type check: local unparameterized property type, paramaterized new with explicit parent"] {
|
||||
["type check: local unparameterized property type, parameterized new with explicit parent"] {
|
||||
"Expected value of type `String`, but got type `Int`. Value: 1"
|
||||
}
|
||||
["amending listings does not require type checks on amending object members"] {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
–– Pkl Error ––
|
||||
Cannot find module `package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl`.
|
||||
Cannot find dependency named `notapackage`, because it was not declared in package `package://localhost:0/badImportsWithinPackage@1.0.0`.
|
||||
|
||||
x | res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyReaad.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badRead8.error#res (file:///$snippetsDir/input/packages/badRead8.error.pkl)
|
||||
x | res = read("@notapackage/Foo.txt")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at unknownDependencyRead#res (package://localhost:0/badImportsWithinPackage@1.0.0#/unknownDependencyRead.pkl)
|
||||
|
||||
xxx | text = renderer.renderDocument(value)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
–– Pkl Error ––
|
||||
Cannot find module `package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl`.
|
||||
I/O error reading resource `package://localhost:0/badImportsWithinPackage@1.0.0#/not/a/valid/path.txt`.
|
||||
|
||||
x | res = import("package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathReaad.pkl")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at badRead9.error#res (file:///$snippetsDir/input/packages/badRead9.error.pkl)
|
||||
x | res = read("not/a/valid/path.txt")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at invalidPathRead#res (package://localhost:0/badImportsWithinPackage@1.0.0#/invalidPathRead.pkl)
|
||||
|
||||
xxx | text = renderer.renderDocument(value)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -13,7 +13,7 @@ examples {
|
||||
}
|
||||
}
|
||||
new {
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
@@ -57,18 +57,18 @@ examples {
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCmltcG9ydCAiQGZydWl0aWVzL2NhdGFsb2cvYXBwbGUucGtsIgoKbmFtZSA9ICJTd2FsbG93IgoKZmF2b3JpdGVGcnVpdCA9IGFwcGxlCg=="
|
||||
}
|
||||
new {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-15
@@ -1,8 +1,8 @@
|
||||
examples {
|
||||
["glob import"] {
|
||||
new {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
|
||||
name = "Ostrich"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
@@ -17,8 +17,8 @@ examples {
|
||||
}
|
||||
["glob import within package"] {
|
||||
new {
|
||||
["catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
["catalog/Ostrich.pkl"] {
|
||||
name = "Ostrich"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
@@ -40,19 +40,19 @@ examples {
|
||||
}
|
||||
["glob read"] {
|
||||
new {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
|
||||
}
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
@@ -72,19 +72,19 @@ examples {
|
||||
}
|
||||
["glob read within package"] {
|
||||
new {
|
||||
["catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
["catalog/Ostrich.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
|
||||
}
|
||||
["catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
@@ -118,13 +118,13 @@ examples {
|
||||
}
|
||||
["glob import while specifying checksum"] {
|
||||
new {
|
||||
["package://localhost:0/birds@0.5.0::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
["package://localhost:0/birds@0.5.0::sha256:6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e#/catalog/Ostrich.pkl"] {
|
||||
name = "Ostrich"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
}
|
||||
["package://localhost:0/birds@0.5.0::sha256:bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d#/catalog/Swallow.pkl"] {
|
||||
["package://localhost:0/birds@0.5.0::sha256:6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e#/catalog/Swallow.pkl"] {
|
||||
name = "Swallow"
|
||||
favoriteFruit {
|
||||
name = "Apple"
|
||||
|
||||
+3
-3
@@ -16,7 +16,7 @@ facts {
|
||||
examples {
|
||||
["import package"] {
|
||||
new {
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
@@ -40,11 +40,11 @@ examples {
|
||||
new {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog"
|
||||
text = """
|
||||
Ostritch.pkl
|
||||
Ostrich.pkl
|
||||
Swallow.pkl
|
||||
|
||||
"""
|
||||
base64 = "T3N0cml0Y2gucGtsClN3YWxsb3cucGtsCg=="
|
||||
base64 = "T3N0cmljaC5wa2wKU3dhbGxvdy5wa2wK"
|
||||
}
|
||||
new {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/"
|
||||
|
||||
+22
-22
@@ -1,8 +1,8 @@
|
||||
examples {
|
||||
["glob-import within package"] {
|
||||
new {
|
||||
["catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
["catalog/Ostrich.pkl"] {
|
||||
name = "Ostrich"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
@@ -17,8 +17,8 @@ examples {
|
||||
}
|
||||
["glob-import absolute package uri"] {
|
||||
new {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
name = "Ostritch"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
|
||||
name = "Ostrich"
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
@@ -44,25 +44,25 @@ examples {
|
||||
}
|
||||
}
|
||||
["glob-import using dependency notation"] {
|
||||
Set("@birds/catalog/Ostritch.pkl", "@birds/catalog/Swallow.pkl")
|
||||
Set("@birds/catalog/Ostrich.pkl", "@birds/catalog/Swallow.pkl")
|
||||
Set("@birds/Bird.pkl", "@birds/allFruit.pkl", "@birds/catalog.pkl")
|
||||
Set("@birds/Bird.pkl", "@birds/allFruit.pkl", "@birds/catalog.pkl", "@birds/catalog/Ostritch.pkl", "@birds/catalog/Swallow.pkl", "@birds/some/dir/Bird.pkl")
|
||||
Set("@birds/Bird.pkl", "@birds/allFruit.pkl", "@birds/catalog.pkl", "@birds/catalog/Ostrich.pkl", "@birds/catalog/Swallow.pkl", "@birds/some/dir/Bird.pkl")
|
||||
}
|
||||
["glob-read using dependency notation"] {
|
||||
new {
|
||||
["@birds/catalog/Ostritch.pkl"] {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
["@birds/catalog/Ostrich.pkl"] {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
|
||||
}
|
||||
["@birds/catalog/Swallow.pkl"] {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
@@ -154,19 +154,19 @@ examples {
|
||||
"""
|
||||
base64 = "bW9kdWxlIGJpcmRzLmNhdGFsb2cKCmNhdGFsb2cgPSBpbXBvcnQqKCJjYXRhbG9nLyoucGtsIikKY2F0YWxvZ0ZpbGVzID0gcmVhZCooImNhdGFsb2cvKi5wa2wiKQo="
|
||||
}
|
||||
["@birds/catalog/Ostritch.pkl"] {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
["@birds/catalog/Ostrich.pkl"] {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
|
||||
}
|
||||
["@birds/catalog/Swallow.pkl"] {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
@@ -200,19 +200,19 @@ examples {
|
||||
}
|
||||
["glob-read within package"] {
|
||||
new {
|
||||
["catalog/Ostritch.pkl"] {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
["catalog/Ostrich.pkl"] {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
|
||||
}
|
||||
["catalog/Swallow.pkl"] {
|
||||
uri = "projectpackage://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
@@ -232,19 +232,19 @@ examples {
|
||||
}
|
||||
["glob-read absolute package uri"] {
|
||||
new {
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostritch.pkl"
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Ostrich.pkl"
|
||||
text = """
|
||||
amends "../Bird.pkl"
|
||||
|
||||
name = "Ostritch"
|
||||
name = "Ostrich"
|
||||
|
||||
favoriteFruit {
|
||||
name = "Orange"
|
||||
}
|
||||
|
||||
"""
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cml0Y2giCgpmYXZvcml0ZUZydWl0IHsKICBuYW1lID0gIk9yYW5nZSIKfQo="
|
||||
base64 = "YW1lbmRzICIuLi9CaXJkLnBrbCIKCm5hbWUgPSAiT3N0cmljaCIKCmZhdm9yaXRlRnJ1aXQgewogIG5hbWUgPSAiT3JhbmdlIgp9Cg=="
|
||||
}
|
||||
["package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"] {
|
||||
uri = "package://localhost:0/birds@0.5.0#/catalog/Swallow.pkl"
|
||||
|
||||
@@ -407,7 +407,7 @@ class EvaluatorTest {
|
||||
.trimIndent()
|
||||
} else
|
||||
"""
|
||||
birds = import("@birds/catalog/Ostritch.pkl")
|
||||
birds = import("@birds/catalog/Ostrich.pkl")
|
||||
"""
|
||||
.trimIndent()
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ class PackageResolversTest {
|
||||
assertThat(elements)
|
||||
.isEqualTo(
|
||||
setOf(
|
||||
PathElement("Ostritch.pkl", false),
|
||||
PathElement("Ostrich.pkl", false),
|
||||
PathElement("Swallow.pkl", false),
|
||||
)
|
||||
)
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@
|
||||
<dt class="">Dependencies:</dt>
|
||||
<dd><a href="https://example.com/fruit-docs">fruit:1.0.5</a></dd>
|
||||
<dt class="">Checksum:</dt>
|
||||
<dd>bfaf5281613d170a740505cc87561041f4e0cad1f0e6938bf94f7609f9a4673d</dd>
|
||||
<dd>6f18af649b47986530cd6dc39abe17888db2701bc5381c385fb86a32fda2685e</dd>
|
||||
<dt class="runtime-data hidden">Known usages:</dt>
|
||||
<dd id="known-usages" class="runtime-data hidden"></dd>
|
||||
<dt class="runtime-data hidden">All versions:</dt>
|
||||
|
||||
@@ -74,7 +74,7 @@ val prepareHistoricalDistributions by
|
||||
val distributionDir = outputDir.get().asFile.toPath().also(Files::createDirectories)
|
||||
for (file in pklHistoricalDistributions.files) {
|
||||
val target = distributionDir.resolve(file.name)
|
||||
// Create normal files on Windows, symlink on macOS/linux (need admin priveleges to create
|
||||
// Create normal files on Windows, symlink on macOS/linux (need admin privileges to create
|
||||
// symlinks on Windows)
|
||||
if (buildInfo.os.isWindows) {
|
||||
if (!Files.isRegularFile(target, LinkOption.NOFOLLOW_LINKS)) {
|
||||
|
||||
@@ -267,7 +267,7 @@ final class EmbeddedExecutor implements Executor {
|
||||
if (clazz == null) {
|
||||
if (name.startsWith("org.pkl.executor.spi.")) {
|
||||
try {
|
||||
// give pkl-executor a chance to load the SPI clasa
|
||||
// give pkl-executor a chance to load the SPI class
|
||||
clazz = pklExecutorClassLoader.loadClass(name);
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
// The SPI class exists in this distribution but not in pkl-executor,
|
||||
|
||||
@@ -172,7 +172,7 @@ class ExternalReader {
|
||||
/// On macOS, Linux, and Windows platforms, this may be:
|
||||
///
|
||||
/// * An absolute path
|
||||
/// * A relative path (to the currrent working directory)
|
||||
/// * A relative path (to the current working directory)
|
||||
/// * The name of the executable, to be resolved against the `PATH` environment variable
|
||||
executable: String
|
||||
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ class ImportGraph {
|
||||
///
|
||||
/// Dependency-notation imports, such as `"@myPackage/myModule.pkl"`, are represented as
|
||||
/// in-language URIs with scheme `projectpackage:`.
|
||||
/// In the case of local project dependenecies, they will be local URIs resolved from the project
|
||||
/// In the case of local project dependencies, they will be local URIs resolved from the project
|
||||
/// file URI (in normal cases, `file:` URIs).
|
||||
resolvedImports: Map<Uri, Uri>(keys == imports.keys)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user