Package org.pkl.core.project
Class ProjectPackager
java.lang.Object
org.pkl.core.project.ProjectPackager
Given a list of project directories, prepares artifacts to be published as a package.
Validates that relative imports of all included Pkl modules resolve to locations within the package.
Given a package URI package://example.com/thepackage@1.0.0, the following files get
created:
- thepackage@1.0.0 - the metadata JSON file
- thepackage@1.0.0.sha256 - the SHA-256 checksum of the metadata file
- thepackage@1.0.0.zip - the zip archive containing the contents of the package
- thepackage@1.0.0.zip.sha256 - the SHA-256 checksum of the zip archive
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionProjectPackager(List<Project> projects, Path workingDir, String outputPathPattern, StackFrameTransformer stackFrameTransformer, boolean color, SecurityManager securityManager, HttpClient httpClient, boolean skipPublishCheck, Writer outputWriter) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvalidateImportsAndReads(Project project, Path pklModulePath) Parse a Pkl module, and verify that itsimports andreads resolve to locations within the package directory.
-
Constructor Details
-
ProjectPackager
public ProjectPackager(List<Project> projects, Path workingDir, String outputPathPattern, StackFrameTransformer stackFrameTransformer, boolean color, SecurityManager securityManager, HttpClient httpClient, boolean skipPublishCheck, Writer outputWriter)
-
-
Method Details
-
createPackages
- Throws:
IOException
-
doPackage
- Throws:
IOException
-
validateImportsAndReads
Parse a Pkl module, and verify that itsimports andreads resolve to locations within the package directory.Note that these might be glob expressions, so these paths might not actually exist. For example, an import might look like
"foo/*.pkl", which would resolve as path`/some/dir/foo/*.pkl`, which is not a real file. This is just a sanity check to ensure that the paths can reasonably resolve to a location within the package directory.
-