Compare commits

...

3 commits
0.5.0 ... main

7 changed files with 96 additions and 16 deletions

View file

@ -2,12 +2,12 @@
<library name="bld">
<CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.0.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.0-sources.jar!/" />
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.1-sources.jar!/" />
</SOURCES>
<excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />

View file

@ -7,7 +7,7 @@
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-2.0.0.jar",
"${HOME}/.bld/dist/bld-2.0.1.jar",
"lib/compile/*.jar",
"lib/runtime/*.jar",
"lib/test/*.jar"

View file

@ -2,7 +2,7 @@
[![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Java](https://img.shields.io/badge/java-17%2B-blue)](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[![bld](https://img.shields.io/badge/2.0.0-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![bld](https://img.shields.io/badge/2.0.1-FA9052?label=bld&labelColor=2392FF)](https://rife2.com/bld)
[![Release](https://flat.badgen.net/maven/v/metadata-url/https:/repo.rife2.com/releases/com/uwyn/rife2/bld-archive/maven-metadata.xml)](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-archive)
[![GitHub CI](https://github.com/rife2/bld-archive/actions/workflows/bld.yml/badge.svg)](https://github.com/rife2/bld-archive/actions/workflows/bld.yml)

Binary file not shown.

View file

@ -3,4 +3,4 @@ bld.downloadExtensionSources=true
bld.extensions=
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES
bld.downloadLocation=
bld.version=2.0.0
bld.version=2.0.1

View file

@ -28,11 +28,11 @@ public class ArchiveBuild extends Project {
repositories = List.of(MAVEN_CENTRAL, RIFE2_RELEASES);
scope(compile)
.include(dependency("com.uwyn.rife2", "bld", version(2,0,0)))
.include(dependency("org.apache.commons", "commons-compress", version(1,26,2)));
.include(dependency("com.uwyn.rife2", "bld", version(2,0,1)))
.include(dependency("org.apache.commons", "commons-compress", version(1,27,1)));
scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5,10,3)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,10,3)));
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5,11,0)))
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,11,0)));
javadocOperation()
.javadocOptions()

View file

@ -7,15 +7,20 @@ package rife.bld.extension;
import org.apache.commons.compress.archivers.zip.UnixStat;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.compress.utils.IOUtils;
import org.apache.commons.io.IOUtils;
import rife.bld.NamedFile;
import rife.bld.operations.AbstractOperation;
import rife.tools.FileUtils;
import rife.tools.StringUtils;
import java.io.*;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.util.*;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
/**
@ -135,10 +140,49 @@ public class ZipOperation extends AbstractOperation<ZipOperation> {
*
* @param directories source directories
* @return this operation instance
* @see #sourceDirectories(List)
* @since 1.0
*/
public ZipOperation sourceDirectories(File... directories) {
sourceDirectories_.addAll(List.of(directories));
return sourceDirectories(List.of(directories));
}
/**
* Provides source directories that will be used for the zip archive creation.
*
* @param directories source directories
* @return this operation instance
* @see #sourceDirectoriesPaths(List)
* @since 1.0
*/
public ZipOperation sourceDirectories(Path... directories) {
return sourceDirectoriesPaths(List.of(directories));
}
/**
* Provides source directories that will be used for the zip archive creation.
*
* @param directories source directories
* @return this operation instance
* @see #sourceDirectoriesStrings(List)
* @since 1.0
*/
public ZipOperation sourceDirectories(String... directories) {
return sourceDirectoriesStrings(List.of(directories));
}
/**
* Provides a list of source directories that will be used for the zip archive creation.
* <p>
* A copy will be created to allow this list to be independently modifiable.
*
* @param directories a list of source directories
* @return this operation instance
* @see #sourceDirectories(File...)
* @since 1.0
*/
public ZipOperation sourceDirectories(List<File> directories) {
sourceDirectories_.addAll(directories);
return this;
}
@ -149,11 +193,25 @@ public class ZipOperation extends AbstractOperation<ZipOperation> {
*
* @param directories a list of source directories
* @return this operation instance
* @see #sourceDirectories(Path...)
* @since 1.0
*/
public ZipOperation sourceDirectories(List<File> directories) {
sourceDirectories_.addAll(directories);
return this;
public ZipOperation sourceDirectoriesPaths(List<Path> directories) {
return sourceDirectories(directories.stream().map(Path::toFile).toList());
}
/**
* Provides a list of source directories that will be used for the zip archive creation.
* <p>
* A copy will be created to allow this list to be independently modifiable.
*
* @param directories a list of source directories
* @return this operation instance
* @see #sourceDirectories(String...)
* @since 1.0
*/
public ZipOperation sourceDirectoriesStrings(List<String> directories) {
return sourceDirectories(directories.stream().map(File::new).toList());
}
/**
@ -194,6 +252,28 @@ public class ZipOperation extends AbstractOperation<ZipOperation> {
return this;
}
/**
* Provides the destination directory in which the zip archive will be created.
*
* @param directory the zip destination directory
* @return this operation instance
* @since 1.0
*/
public ZipOperation destinationDirectory(Path directory) {
return destinationDirectory(directory.toFile());
}
/**
* Provides the destination directory in which the zip archive will be created.
*
* @param directory the zip destination directory
* @return this operation instance
* @since 1.0
*/
public ZipOperation destinationDirectory(String directory) {
return destinationDirectory(new File(directory));
}
/**
* Provides the destination file name that will be used for the zip archive creation.
*