-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zip
and unzip
API
#317
zip
and unzip
API
#317
Conversation
… file. The zipIn functionality will create a new file `archive.zip` if the name of the zip file is absent
…n existing zip file
…irectory if the target directory is not present.
- Rename `zipIn` to `zip` - Remove `options` parameter and replace with individual flags i.e `appendToExisting`
- Include only given files during zipping (similar to -i option in zip) - Exclude given files during zipping (similar to -x option in zip) - Delete given files from the zip archieve (similar to -d option in zip) Tests added along with the implementation
- listing files without unzipping - excluding certain files/file regex during unzipping
…ding unit tests.
…ipping of files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good. OS-Lib is still in version 0
phase, so we can change API of new features rather easy. Let's release it so we get feedback from users.
Why was Java 8 dropped in CI?
- os: macos-latest | ||
java-version: 11 | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
java-version: [11, 17] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that? Is this just convenient or necessary? I'd like to avoid dropping support for a Java version in a minor release. If we need to drop it, we should bump to 0.11.0
. Keeping bin-compat with 0.10.x
is a bonus feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just convenience really, but i realized we already have os.Internal.transfer
so I can just use that just as conveniently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like there's some issue with zip filesystem on windows java 8, so need to bump that to java 11 as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think given that we now have 2/3 OSs only testing on Java 11, let's just bump the official supported version to 11. People can continue to try using it on 8, it'll just be at their own risk
Pulls in changes from #316 and #310 and cleans it up
Mostly documented in the readme.adoc.
Major APIs added:
os.zip
: create or append to an existing zip file on diskos.zip.stream
: create a new zip file but write it to anjava.io.OutputStream
rather than a file on diskos.unzip
: unzip a zip file on disk into a folder on diskos.unzip.stream
: unzip a zip file from anjava.io.InputStream
into a folder on diskos.unzip.list
: list the contents of a zip fileos.unzip.streamRaw
: low-level API used byos.unzip.stream
andos.unzip.list
, exposed in case users need itos.zip.open
: Opens a zip file asjava.nio.file.FileSystem
and gives you anos.Path
you can use to work with itHopefully these are APIs we can start using in Mill rather than
"zip"
subprocesses or ad-hoc helpers likeIO.unpackZip
Limitations:
java.nio.file.FileSystem
is only supported on JVM and not on Scala-Native, and so usingos.zip
to append to existing jar files oros.zip.open
does not work on Scala-Native.os.zip
doesn't support creating/unpacking symlinks or preserving filesystem permissions in Zip files, because the underlyingjava.util.zip.Zip*Stream
doesn't support them. Apache Commons Compress can work with them (https://commons.apache.org/proper/commons-compress/zip.html), but if we're sticking with std lib we don't have that