mirror of
https://github.com/ethauvin/bld-archive.git
synced 2025-04-24 21:17:10 -07:00
28 lines
No EOL
1.4 KiB
Markdown
28 lines
No EOL
1.4 KiB
Markdown
# [Bld](https://github.com/rife2/rife2/wiki/What-Is-Bld) extension for working with archives
|
|
|
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
[](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
|
|
[](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-archive)
|
|
[](https://github.com/rife2/bld-archive/actions/workflows/bld.yml)
|
|
|
|
A `bld` extension for generating archives.
|
|
|
|
It's in an incomplete state and currently only generates ZIP archives that
|
|
preserve the original Posix file permissions. Support for additional features
|
|
will be added soon.
|
|
|
|
The complete documentation can be found in its [javadocs](https://rife2.github.io/bld-archive/rife/bld/extension/package-summary.html).
|
|
|
|
This is a short example of how to create a ZIP archive of a directory:
|
|
|
|
```java
|
|
@BuildCommand
|
|
public void zip()
|
|
throws Exception {
|
|
new ZipOperation()
|
|
.sourceDirectories(new File("dir/to/zip"))
|
|
.destinationDirectory(new File("destination/dir"))
|
|
.destinationFileName("archive.zip")
|
|
.execute();
|
|
}
|
|
``` |