Allows application/jar
files to be delivered by postal
#196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In some cases, buildpack authors will want to include
*.jar
files as dependencies in theirbuildpack.toml
. For ajar
file, the Java ecosystem tooling expects that file not to be decompressed even though it is an archive format. Instead, it is expected that the file simply be downloaded into the layer. This changeset addsapplication/jar
to the set of "no-op" archives such that it will achieve this behavior.Additionally, to ensure the
jar
file ends up in the layer with the same name it declares in thebuildpack.toml
, this changeset introduces a newvacation.Archive.WithName
option that allows users to give a name to the file that will be copied into when using the "no-op" archive code path. Modifications to thepostal.Service.Deliver
implementation parse the dependency URI and assign the basename of that path as the archive name.Other Changes
While I was making these changes, I also split up the implementation files in the
vacation
package to organize the code a bit better as it had become kind of difficult to navigate in a single file. Additionally, I renamed the test files to remove the stutter they had with thevacation_
prefix. Finally, I turned the privatewriteTextFile
implementation into an exported type calledvacation.NopArchive
.postal.Service.Deliver
Since we are now using the basename of the dependency URI to name a simple file that is installed using
postal.Service.Deliver
, this will break any implementations that previously relied on the filename being hardcoded toartifact
.Checklist