mirror of
https://github.com/ethauvin/bld-archive.git
synced 2025-04-24 21:17:10 -07:00
Compare commits
9 commits
Author | SHA1 | Date | |
---|---|---|---|
0a6323640f | |||
8836a8a6f7 | |||
0bfd068e94 | |||
60fce761ed | |||
4c013a1b33 | |||
c816a564ed | |||
50fdf87a4a | |||
0e08fc7e41 | |||
1a841e9559 |
12 changed files with 115 additions and 16 deletions
6
.idea/bld.xml
generated
Normal file
6
.idea/bld.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BldConfiguration">
|
||||
<events />
|
||||
</component>
|
||||
</project>
|
5
.idea/libraries/bld.xml
generated
5
.idea/libraries/bld.xml
generated
|
@ -2,11 +2,12 @@
|
|||
<library name="bld">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.4.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.4-sources.jar!/" />
|
||||
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||
<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!/" />
|
||||
|
|
4
.idea/libraries/compile.xml
generated
4
.idea/libraries/compile.xml
generated
|
@ -2,12 +2,16 @@
|
|||
<library name="compile">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/compile" />
|
||||
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$PROJECT_DIR$/lib/compile" />
|
||||
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||
</SOURCES>
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/compile" recursive="false" type="SOURCES" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" type="SOURCES" />
|
||||
</library>
|
||||
</component>
|
1
.idea/libraries/runtime.xml
generated
1
.idea/libraries/runtime.xml
generated
|
@ -2,6 +2,7 @@
|
|||
<library name="runtime">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/runtime" />
|
||||
<root url="file://$PROJECT_DIR$/src/main/resources" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
|
|
4
.idea/libraries/test.xml
generated
4
.idea/libraries/test.xml
generated
|
@ -2,12 +2,16 @@
|
|||
<library name="test">
|
||||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/test" />
|
||||
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$PROJECT_DIR$/lib/test" />
|
||||
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||
</SOURCES>
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/provided" recursive="false" type="SOURCES" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="SOURCES" />
|
||||
</library>
|
||||
</component>
|
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
@ -7,7 +7,7 @@
|
|||
],
|
||||
"java.configuration.updateBuildConfiguration": "automatic",
|
||||
"java.project.referencedLibraries": [
|
||||
"${HOME}/.bld/dist/bld-1.7.4.jar",
|
||||
"${HOME}/.bld/dist/bld-2.0.1.jar",
|
||||
"lib/compile/*.jar",
|
||||
"lib/runtime/*.jar",
|
||||
"lib/test/*.jar"
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
[](https://opensource.org/licenses/Apache-2.0)
|
||||
[](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
|
||||
[](https://rife2.com/bld)
|
||||
[](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-archive)
|
||||
[](https://github.com/rife2/bld-archive/actions/workflows/bld.yml)
|
||||
|
||||
|
|
Binary file not shown.
|
@ -3,4 +3,4 @@ bld.downloadExtensionSources=true
|
|||
bld.extensions=
|
||||
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES
|
||||
bld.downloadLocation=
|
||||
bld.version=1.7.4
|
||||
bld.version=2.0.1
|
||||
|
|
1
local.properties
Normal file
1
local.properties
Normal file
|
@ -0,0 +1 @@
|
|||
bld.repo.github=https://maven.pkg.github.com/rife2/bld-archive
|
|
@ -19,7 +19,7 @@ public class ArchiveBuild extends Project {
|
|||
public ArchiveBuild() {
|
||||
pkg = "rife.bld.extension";
|
||||
name = "Archive";
|
||||
version = version(0,4,4);
|
||||
version = version(0,5,0);
|
||||
archiveBaseName = "bld-archive";
|
||||
|
||||
javaRelease = 17;
|
||||
|
@ -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(1,7,4)))
|
||||
.include(dependency("org.apache.commons", "commons-compress", version(1,24,0)));
|
||||
.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,9,3)))
|
||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1,9,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()
|
||||
|
@ -41,6 +41,7 @@ public class ArchiveBuild extends Project {
|
|||
|
||||
publishOperation()
|
||||
.repository(version.isSnapshot() ? repository("rife2-snapshots") : repository("rife2-releases"))
|
||||
.repository(repository("github"))
|
||||
.info()
|
||||
.groupId("com.uwyn.rife2")
|
||||
.artifactId("bld-archive")
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue