mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-24 15:57:11 -07:00
Added native support for Java modules
This commit is contained in:
parent
7cd547f8b6
commit
0797e39dd6
43 changed files with 3196 additions and 444 deletions
1
.idea/app.iml
generated
1
.idea/app.iml
generated
|
@ -27,6 +27,5 @@
|
|||
<orderEntry type="library" name="compile" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="runtime" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="test" level="project" />
|
||||
<orderEntry type="module" module-name="bld" />
|
||||
</component>
|
||||
</module>
|
4
.idea/libraries/bld.xml
generated
4
.idea/libraries/bld.xml
generated
|
@ -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.1.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.0-SNAPSHOT.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="file://$PROJECT_DIR$/lib/bld" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.1-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.bld/dist/bld-2.0.0-SNAPSHOT-sources.jar!/" />
|
||||
</SOURCES>
|
||||
<excluded>
|
||||
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
|
||||
|
|
1
.idea/libraries/runtime.xml
generated
1
.idea/libraries/runtime.xml
generated
|
@ -3,6 +3,7 @@
|
|||
<CLASSES>
|
||||
<root url="file://$PROJECT_DIR$/lib/runtime" />
|
||||
<root url="file://$PROJECT_DIR$/src/main/resources" />
|
||||
<root url="file://$PROJECT_DIR$/core/src/main/resources" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
|
|
4
.idea/libraries/test.xml
generated
4
.idea/libraries/test.xml
generated
|
@ -11,9 +11,9 @@
|
|||
<root url="file://$PROJECT_DIR$/lib/test" />
|
||||
<root url="file://$PROJECT_DIR$/lib/provided" />
|
||||
</SOURCES>
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" />
|
||||
<jarDirectory url="file://$PROJECT_DIR$/lib/test" recursive="false" type="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>
|
|
@ -1,6 +1,7 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run Tests" type="JUnit" factoryName="JUnit">
|
||||
<configuration default="false" name="Run all tests" type="JUnit" factoryName="JUnit">
|
||||
<module name="app" />
|
||||
<useClassPathOnly />
|
||||
<option name="PACKAGE_NAME" value="rife" />
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
20
.idea/runConfigurations/Run_bld_tests.xml
generated
Normal file
20
.idea/runConfigurations/Run_bld_tests.xml
generated
Normal file
|
@ -0,0 +1,20 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Run bld tests" type="JUnit" factoryName="JUnit">
|
||||
<module name="app" />
|
||||
<useClassPathOnly />
|
||||
<extension name="coverage">
|
||||
<pattern>
|
||||
<option name="PATTERN" value="rife.bld.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</pattern>
|
||||
</extension>
|
||||
<option name="PACKAGE_NAME" value="rife.bld" />
|
||||
<option name="MAIN_CLASS_NAME" value="" />
|
||||
<option name="METHOD_NAME" value="" />
|
||||
<option name="TEST_OBJECT" value="package" />
|
||||
<dir value="$PROJECT_DIR$/src/test/java" />
|
||||
<method v="2">
|
||||
<option name="Make" enabled="true" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
6
.idea/scala_compiler.xml
generated
Normal file
6
.idea/scala_compiler.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ScalaCompilerConfiguration">
|
||||
<option name="separateProdTestSources" value="false" />
|
||||
</component>
|
||||
</project>
|
2
core
2
core
|
@ -1 +1 @@
|
|||
Subproject commit d965055ac90308ced33c6c0b95a3db38c6e43a69
|
||||
Subproject commit b94124fe6d0fd40974f3e882f2ac1335f095ce80
|
Binary file not shown.
|
@ -8,4 +8,4 @@ bld.javaOptions=
|
|||
bld.javacOptions=
|
||||
bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES
|
||||
bld.sourceDirectories=core/src/bld/java
|
||||
bld.version=2.0.1
|
||||
bld.version=2.0.0-SNAPSHOT
|
|
@ -5,6 +5,7 @@
|
|||
package rife.bld;
|
||||
|
||||
import rife.bld.dependencies.*;
|
||||
import rife.bld.dependencies.Module;
|
||||
import rife.bld.help.*;
|
||||
import rife.bld.operations.*;
|
||||
import rife.tools.FileUtils;
|
||||
|
@ -245,6 +246,13 @@ public class BaseProject extends BuildExecutor {
|
|||
* @since 1.5
|
||||
*/
|
||||
protected File libCompileDirectory = null;
|
||||
/**
|
||||
* The modules compile scope lib directory.
|
||||
*
|
||||
* @see #libCompileModulesDirectory()
|
||||
* @since 2.1
|
||||
*/
|
||||
protected File libCompileModulesDirectory = null;
|
||||
/**
|
||||
* The provided scope lib directory.
|
||||
*
|
||||
|
@ -252,6 +260,13 @@ public class BaseProject extends BuildExecutor {
|
|||
* @since 1.8
|
||||
*/
|
||||
protected File libProvidedDirectory = null;
|
||||
/**
|
||||
* The modules provided scope lib directory.
|
||||
*
|
||||
* @see #libProvidedModulesDirectory()
|
||||
* @since 2.1
|
||||
*/
|
||||
protected File libProvidedModulesDirectory = null;
|
||||
/**
|
||||
* The runtime scope lib directory.
|
||||
*
|
||||
|
@ -259,6 +274,13 @@ public class BaseProject extends BuildExecutor {
|
|||
* @since 1.5
|
||||
*/
|
||||
protected File libRuntimeDirectory = null;
|
||||
/**
|
||||
* The modules runtime scope lib directory.
|
||||
*
|
||||
* @see #libRuntimeModulesDirectory()
|
||||
* @since 2.1
|
||||
*/
|
||||
protected File libRuntimeModulesDirectory = null;
|
||||
/**
|
||||
* The standalone scope lib directory.
|
||||
*
|
||||
|
@ -267,12 +289,26 @@ public class BaseProject extends BuildExecutor {
|
|||
*/
|
||||
protected File libStandaloneDirectory = null;
|
||||
/**
|
||||
* The standalone scope lib directory.
|
||||
* The modules standalone scope lib directory.
|
||||
*
|
||||
* @see #libStandaloneModulesDirectory()
|
||||
* @since 2.1
|
||||
*/
|
||||
protected File libStandaloneModulesDirectory = null;
|
||||
/**
|
||||
* The test scope lib directory.
|
||||
*
|
||||
* @see #libTestDirectory()
|
||||
* @since 1.5
|
||||
*/
|
||||
protected File libTestDirectory = null;
|
||||
/**
|
||||
* The modules test scope lib directory.
|
||||
*
|
||||
* @see #libTestModulesDirectory()
|
||||
* @since 2.1
|
||||
*/
|
||||
protected File libTestModulesDirectory = null;
|
||||
/**
|
||||
* The build directory.
|
||||
*
|
||||
|
@ -860,6 +896,101 @@ public class BaseProject extends BuildExecutor {
|
|||
return new LocalDependency(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new module instance.
|
||||
*
|
||||
* @param groupId the module group identifier
|
||||
* @param artifactId the module artifact identifier
|
||||
* @return a newly created {@code Module} instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public Module module(String groupId, String artifactId) {
|
||||
return new Module(groupId, artifactId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new module instance.
|
||||
*
|
||||
* @param groupId the module group identifier
|
||||
* @param artifactId the module artifact identifier
|
||||
* @param version the module version
|
||||
* @return a newly created {@code Module} instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public Module module(String groupId, String artifactId, String version) {
|
||||
return new Module(groupId, artifactId, version(version));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new module instance.
|
||||
*
|
||||
* @param groupId the module group identifier
|
||||
* @param artifactId the module artifact identifier
|
||||
* @param version the module version
|
||||
* @param classifier the module classifier
|
||||
* @return a newly created {@code Module} instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public Module module(String groupId, String artifactId, String version, String classifier) {
|
||||
return new Module(groupId, artifactId, version(version), classifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new module instance.
|
||||
*
|
||||
* @param groupId the module group identifier
|
||||
* @param artifactId the module artifact identifier
|
||||
* @param version the module version
|
||||
* @return a newly created {@code Module} instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public Module module(String groupId, String artifactId, Version version) {
|
||||
return new Module(groupId, artifactId, version);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new module instance.
|
||||
*
|
||||
* @param groupId the module group identifier
|
||||
* @param artifactId the module artifact identifier
|
||||
* @param version the module version
|
||||
* @param classifier the module classifier
|
||||
* @return a newly created {@code Module} instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public Module module(String groupId, String artifactId, Version version, String classifier) {
|
||||
return new Module(groupId, artifactId, version, classifier);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new module instance from a string representation.
|
||||
* The format is {@code groupId:artifactId:version:classifier}.
|
||||
* The {@code version} and {@code classifier} are optional.
|
||||
* <p>
|
||||
* If the string can't be successfully parsed, {@code null} will be returned.
|
||||
*
|
||||
* @param description the module string to parse
|
||||
* @return a parsed instance of {@code Module}; or
|
||||
* {@code null} when the string couldn't be parsed
|
||||
* @since 2.1
|
||||
*/
|
||||
public Module module(String description) {
|
||||
return Module.parse(description);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a local module instance.
|
||||
* <p>
|
||||
* If the local module points to a directory, it will be scanned for jar files.
|
||||
*
|
||||
* @param path the file system path of the local module
|
||||
* @since 2.1
|
||||
*/
|
||||
|
||||
public LocalModule localModule(String path) {
|
||||
return new LocalModule(path);
|
||||
}
|
||||
|
||||
/*
|
||||
* Project directories
|
||||
*/
|
||||
|
@ -1012,6 +1143,16 @@ public class BaseProject extends BuildExecutor {
|
|||
return Objects.requireNonNullElseGet(libCompileDirectory, () -> new File(libDirectory(), "compile"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project modules compile scope lib directory.
|
||||
* Defaults to {@code "modules"} relative to {@link #libCompileDirectory()}.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libCompileModulesDirectory() {
|
||||
return Objects.requireNonNullElseGet(libCompileModulesDirectory, () -> new File(libCompileDirectory(), "modules"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project provided scope lib directory.
|
||||
* Defaults to {@code "provided"} relative to {@link #libDirectory()}.
|
||||
|
@ -1022,6 +1163,16 @@ public class BaseProject extends BuildExecutor {
|
|||
return Objects.requireNonNullElseGet(libProvidedDirectory, () -> new File(libDirectory(), "provided"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project modules provided scope lib directory.
|
||||
* Defaults to {@code "modules"} relative to {@link #libProvidedDirectory()}.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libProvidedModulesDirectory() {
|
||||
return Objects.requireNonNullElseGet(libProvidedModulesDirectory, () -> new File(libProvidedDirectory(), "modules"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project runtime scope lib directory.
|
||||
* Defaults to {@code "runtime"} relative to {@link #libDirectory()}.
|
||||
|
@ -1032,6 +1183,16 @@ public class BaseProject extends BuildExecutor {
|
|||
return Objects.requireNonNullElseGet(libRuntimeDirectory, () -> new File(libDirectory(), "runtime"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project modules runtime scope lib directory.
|
||||
* Defaults to {@code "modules"} relative to {@link #libRuntimeDirectory()}.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
public File libRuntimeModulesDirectory() {
|
||||
return Objects.requireNonNullElseGet(libRuntimeModulesDirectory, () -> new File(libRuntimeDirectory(), "modules"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project standalone scope lib directory.
|
||||
* Defaults to {@code null}.
|
||||
|
@ -1039,7 +1200,17 @@ public class BaseProject extends BuildExecutor {
|
|||
* @since 1.5
|
||||
*/
|
||||
public File libStandaloneDirectory() {
|
||||
return null;
|
||||
return libStandaloneDirectory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project standalone scope lib directory.
|
||||
* Defaults to {@code null}.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libStandaloneModulesDirectory() {
|
||||
return libStandaloneModulesDirectory;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1052,6 +1223,16 @@ public class BaseProject extends BuildExecutor {
|
|||
return Objects.requireNonNullElseGet(libTestDirectory, () -> new File(libDirectory(), "test"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project modules test scope lib directory.
|
||||
* Defaults to {@code "modules"} relative to {@link #libTestDirectory()}.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libTestModulesDirectory() {
|
||||
return Objects.requireNonNullElseGet(libTestModulesDirectory, () -> new File(libTestDirectory(), "modules"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project build directory.
|
||||
* Defaults to {@code "build"} relative to {@link #workDirectory()}.
|
||||
|
@ -1142,12 +1323,19 @@ public class BaseProject extends BuildExecutor {
|
|||
libDirectory().mkdirs();
|
||||
libBldDirectory().mkdirs();
|
||||
libCompileDirectory().mkdirs();
|
||||
libCompileModulesDirectory().mkdirs();
|
||||
libProvidedDirectory().mkdirs();
|
||||
libProvidedModulesDirectory().mkdirs();
|
||||
libRuntimeDirectory().mkdirs();
|
||||
libRuntimeModulesDirectory().mkdirs();
|
||||
if (libStandaloneDirectory() != null) {
|
||||
libStandaloneDirectory().mkdirs();
|
||||
}
|
||||
if (libStandaloneModulesDirectory() != null) {
|
||||
libStandaloneModulesDirectory().mkdirs();
|
||||
}
|
||||
libTestDirectory().mkdirs();
|
||||
libTestModulesDirectory().mkdirs();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1415,6 +1603,25 @@ public class BaseProject extends BuildExecutor {
|
|||
return classpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the jar files that are in the compile scope module path.
|
||||
* <p>
|
||||
* By default, this collects all the jar files in the {@link #libCompileModulesDirectory()}
|
||||
* and adds all the jar files from the compile scope local modules.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<File> compileModulePathJars() {
|
||||
// detect the jar files in the modules compile lib directory
|
||||
var dir_abs = libCompileModulesDirectory().getAbsoluteFile();
|
||||
var jar_files = FileUtils.getFileList(dir_abs, INCLUDED_JARS, EXCLUDED_JARS);
|
||||
|
||||
// build the compilation module path
|
||||
var module_path = new ArrayList<>(jar_files.stream().map(file -> new File(dir_abs, file)).toList());
|
||||
addLocalModules(module_path, Scope.compile);
|
||||
return module_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the jar files that are in the provided scope classpath.
|
||||
* <p>
|
||||
|
@ -1434,6 +1641,25 @@ public class BaseProject extends BuildExecutor {
|
|||
return classpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the jar files that are in the provided scope module path.
|
||||
* <p>
|
||||
* By default, this collects all the jar files in the {@link #libProvidedModulesDirectory()}
|
||||
* and adds all the jar files from the provided scope local modules.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<File> providedModulePathJars() {
|
||||
// detect the jar files in the modules provided lib directory
|
||||
var dir_abs = libProvidedModulesDirectory().getAbsoluteFile();
|
||||
var jar_files = FileUtils.getFileList(dir_abs, INCLUDED_JARS, EXCLUDED_JARS);
|
||||
|
||||
// build the provided module path
|
||||
var module_path = new ArrayList<>(jar_files.stream().map(file -> new File(dir_abs, file)).toList());
|
||||
addLocalModules(module_path, Scope.provided);
|
||||
return module_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the jar files that are in the runtime scope classpath.
|
||||
* <p>
|
||||
|
@ -1453,6 +1679,25 @@ public class BaseProject extends BuildExecutor {
|
|||
return classpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the jar files that are in the runtime scope module path.
|
||||
* <p>
|
||||
* By default, this collects all the jar files in the {@link #libRuntimeModulesDirectory()}
|
||||
* and adds all the jar files from the runtime scope local modules.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<File> runtimeModulePathJars() {
|
||||
// detect the jar files in the modules runtime lib directory
|
||||
var dir_abs = libRuntimeModulesDirectory().getAbsoluteFile();
|
||||
var jar_files = FileUtils.getFileList(dir_abs, INCLUDED_JARS, EXCLUDED_JARS);
|
||||
|
||||
// build the runtime module path
|
||||
var module_path = new ArrayList<>(jar_files.stream().map(file -> new File(dir_abs, file)).toList());
|
||||
addLocalModules(module_path, Scope.runtime);
|
||||
return module_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the jar files that are in the standalone scope classpath.
|
||||
* <p>
|
||||
|
@ -1477,6 +1722,30 @@ public class BaseProject extends BuildExecutor {
|
|||
return classpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the jar files that are in the standalone scope module path.
|
||||
* <p>
|
||||
* By default, this collects all the jar files in the {@link #libStandaloneModulesDirectory()}
|
||||
* and adds all the jar files from the standalone scope local modules.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<File> standaloneModulePathJars() {
|
||||
// build the standalone classpath
|
||||
List<File> module_path;
|
||||
if (libStandaloneModulesDirectory() == null) {
|
||||
module_path = new ArrayList<>();
|
||||
} else {
|
||||
// detect the jar files in the modules standalone lib directory
|
||||
var dir_abs = libStandaloneModulesDirectory().getAbsoluteFile();
|
||||
var jar_files = FileUtils.getFileList(dir_abs, INCLUDED_JARS, EXCLUDED_JARS);
|
||||
|
||||
module_path = new ArrayList<>(jar_files.stream().map(file -> new File(dir_abs, file)).toList());
|
||||
}
|
||||
addLocalModules(module_path, Scope.standalone);
|
||||
return module_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the jar files that are in the test scope classpath.
|
||||
* <p>
|
||||
|
@ -1496,20 +1765,51 @@ public class BaseProject extends BuildExecutor {
|
|||
return classpath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the jar files that are in the test scope module path.
|
||||
* <p>
|
||||
* By default, this collects all the jar files in the {@link #libTestModulesDirectory()}
|
||||
* and adds all the jar files from the test scope local modules.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<File> testModulePathJars() {
|
||||
// detect the jar files in the test lib directory
|
||||
var dir_abs = libTestModulesDirectory().getAbsoluteFile();
|
||||
var jar_files = FileUtils.getFileList(dir_abs, INCLUDED_JARS, EXCLUDED_JARS);
|
||||
|
||||
// build the test module path
|
||||
var module_path = new ArrayList<>(jar_files.stream().map(file -> new File(dir_abs, file)).toList());
|
||||
addLocalModules(module_path, Scope.test);
|
||||
return module_path;
|
||||
}
|
||||
|
||||
private void addLocalDependencies(List<File> classpath, Scope scope) {
|
||||
if (dependencies.get(scope) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (var dependency : dependencies.get(scope).localDependencies()) {
|
||||
var local_file = new File(workDirectory(), dependency.path());
|
||||
if (local_file.exists()) {
|
||||
if (local_file.isDirectory()) {
|
||||
var local_jar_files = FileUtils.getFileList(local_file.getAbsoluteFile(), INCLUDED_JARS, EXCLUDED_JARS);
|
||||
classpath.addAll(new ArrayList<>(local_jar_files.stream().map(file -> new File(local_file, file)).toList()));
|
||||
} else {
|
||||
classpath.add(local_file);
|
||||
}
|
||||
addLocalJars(classpath, dependency.path());
|
||||
}
|
||||
}
|
||||
|
||||
private void addLocalModules(List<File> classpath, Scope scope) {
|
||||
if (dependencies.get(scope) == null) {
|
||||
return;
|
||||
}
|
||||
for (var module : dependencies.get(scope).localModules()) {
|
||||
addLocalJars(classpath, module.path());
|
||||
}
|
||||
}
|
||||
|
||||
private void addLocalJars(List<File> jars, String path) {
|
||||
var local_file = new File(workDirectory(), path);
|
||||
if (local_file.exists()) {
|
||||
if (local_file.isDirectory()) {
|
||||
var local_jar_files = FileUtils.getFileList(local_file.getAbsoluteFile(), INCLUDED_JARS, EXCLUDED_JARS);
|
||||
jars.addAll(new ArrayList<>(local_jar_files.stream().map(file -> new File(local_file, file)).toList()));
|
||||
} else {
|
||||
jars.add(local_file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1517,7 +1817,7 @@ public class BaseProject extends BuildExecutor {
|
|||
/**
|
||||
* Returns all the classpath entries for compiling the main sources.
|
||||
* <p>
|
||||
* By default, this converts the files from {@link #compileClasspathJars()} to absolute paths.
|
||||
* By default, this converts the files from {@link #compileClasspathJars()} and {@link #providedClasspathJars()} to absolute paths.
|
||||
*
|
||||
* @since 1.5
|
||||
*/
|
||||
|
@ -1525,10 +1825,21 @@ public class BaseProject extends BuildExecutor {
|
|||
return FileUtils.combineToAbsolutePaths(compileClasspathJars(), providedClasspathJars());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the module path entries for compiling the main sources.
|
||||
* <p>
|
||||
* By default, this converts the files from {@link #compileModulePathJars()} and {@link #providedModulePathJars()} to absolute paths.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<String> compileMainModulePath() {
|
||||
return FileUtils.combineToAbsolutePaths(compileModulePathJars(), providedModulePathJars());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the classpath entries for compiling the test sources.
|
||||
* <p>
|
||||
* By default, this converts the files from {@link #compileClasspathJars()} and
|
||||
* By default, this converts the files from {@link #compileClasspathJars()}, {@link #providedClasspathJars()} and
|
||||
* {@link #testClasspathJars()} to absolute paths, as well as the {@link #buildMainDirectory()}
|
||||
*
|
||||
* @since 1.5
|
||||
|
@ -1540,6 +1851,18 @@ public class BaseProject extends BuildExecutor {
|
|||
return paths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the module path entries for compiling the test sources.
|
||||
* <p>
|
||||
* By default, this converts the files from {@link #compileModulePathJars()}, {@link #providedModulePathJars()} and
|
||||
* {@link #testModulePathJars()} to absolute paths.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<String> compileTestModulePath() {
|
||||
return FileUtils.combineToAbsolutePaths(compileModulePathJars(), providedModulePathJars(), testModulePathJars());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the classpath entries for running the application.
|
||||
* <p>
|
||||
|
@ -1557,10 +1880,22 @@ public class BaseProject extends BuildExecutor {
|
|||
return paths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the module path entries for running the application.
|
||||
* <p>
|
||||
* By default, this converts the files from {@link #compileModulePathJars()},
|
||||
* {@link #runtimeModulePathJars()} and {@link #standaloneModulePathJars()} to absolute paths.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<String> runModulePath() {
|
||||
return FileUtils.combineToAbsolutePaths(compileModulePathJars(), runtimeModulePathJars(), standaloneModulePathJars());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the classpath entries for testing the application.
|
||||
* <p>
|
||||
* By default, this converts the files from {@link #compileClasspathJars()},
|
||||
* By default, this converts the files from {@link #compileClasspathJars()}, {@link #providedClasspathJars()},
|
||||
* {@link #runtimeClasspathJars()} and {@link #testClasspathJars()}
|
||||
* to absolute paths, as well as the {@link #srcMainResourcesDirectory()},
|
||||
* {@link #buildMainDirectory()} and {@link #buildTestDirectory()}
|
||||
|
@ -1577,6 +1912,19 @@ public class BaseProject extends BuildExecutor {
|
|||
return paths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all the module path entries for testing the application.
|
||||
* <p>
|
||||
* By default, this converts the files from {@link #compileModulePathJars()}, {@link #providedModulePathJars()},
|
||||
* {@link #runtimeModulePathJars()} and {@link #testModulePathJars()}
|
||||
* to absolute paths.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<String> testModulePath() {
|
||||
return FileUtils.combineToAbsolutePaths(compileModulePathJars(), providedModulePathJars(), runtimeModulePathJars(), standaloneModulePathJars(), testModulePathJars());
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes download and purge commands automatically when the
|
||||
* {@code autoDownloadPurge} flag is set and changes have been detected.
|
||||
|
|
|
@ -108,6 +108,11 @@ public class WebProject extends Project {
|
|||
return Objects.requireNonNullElseGet(libStandaloneDirectory, () -> new File(libDirectory(), "standalone"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public File libStandaloneModulesDirectory() {
|
||||
return Objects.requireNonNullElseGet(libStandaloneModulesDirectory, () -> new File(libStandaloneDirectory(), "modules"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the project main webapp directory.
|
||||
* Defaults to {@code "webapp"} relative to {@link #srcMainDirectory()}.
|
||||
|
|
|
@ -8,22 +8,45 @@ import java.util.Objects;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Contains the information required to describe an url dependency in the build system.
|
||||
* Contains the information required to describe a dependency in the build system.
|
||||
*
|
||||
* @param groupId the dependency group identifier
|
||||
* @param artifactId the dependency url identifier
|
||||
* @param version the dependency version
|
||||
* @param classifier the dependency classier
|
||||
* @param type the dependency type
|
||||
* @param exclusions the dependency exclusions for transitive resolution
|
||||
* @param parent the parent dependency that created this dependency (only for information purposes)
|
||||
* @author Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* @since 1.5
|
||||
*/
|
||||
public record Dependency(String groupId, String artifactId, Version version, String classifier, String type, ExclusionSet exclusions, Dependency parent) {
|
||||
public class Dependency {
|
||||
public static final String CLASSIFIER_SOURCES = "sources";
|
||||
public static final String CLASSIFIER_JAVADOC = "javadoc";
|
||||
|
||||
/**
|
||||
* The dependency type name for a JAR file that can be placed either on the class-path or on the module-path.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public static final String TYPE_JAR = "jar";
|
||||
|
||||
/**
|
||||
* The dependency type name for a JAR file to unconditionally place on the class-path.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
public static final String TYPE_CLASSPATH_JAR = "classpath-jar";
|
||||
|
||||
/**
|
||||
* The dependency type name for a JAR file to unconditionally place on the module-path.
|
||||
*
|
||||
* @since 2.1
|
||||
*/
|
||||
// see https://github.com/apache/maven/blob/maven-4.0.0-beta-3/api/maven-api-core/src/main/java/org/apache/maven/api/Type.java
|
||||
public static final String TYPE_MODULAR_JAR = "modular-jar";
|
||||
|
||||
private final String groupId_;
|
||||
private final String artifactId_;
|
||||
private final Version version_;
|
||||
private final String classifier_;
|
||||
private final String type_;
|
||||
private final ExclusionSet exclusions_;
|
||||
private final Dependency parent_;
|
||||
|
||||
public Dependency(String groupId, String artifactId) {
|
||||
this(groupId, artifactId, null, null, null);
|
||||
}
|
||||
|
@ -45,13 +68,20 @@ public record Dependency(String groupId, String artifactId, Version version, Str
|
|||
}
|
||||
|
||||
public Dependency(String groupId, String artifactId, Version version, String classifier, String type, ExclusionSet exclusions, Dependency parent) {
|
||||
this.groupId = groupId;
|
||||
this.artifactId = artifactId;
|
||||
this.version = (version == null ? VersionNumber.UNKNOWN : version);
|
||||
this.classifier = (classifier == null ? "" : classifier);
|
||||
this.type = (type == null ? "jar" : type);
|
||||
this.exclusions = (exclusions == null ? new ExclusionSet() : exclusions);
|
||||
this.parent = parent;
|
||||
if (type == null) {
|
||||
type = TYPE_JAR;
|
||||
}
|
||||
if (parent != null && parent.isModularJar() && TYPE_JAR.equals(type)) {
|
||||
type = TYPE_MODULAR_JAR;
|
||||
}
|
||||
|
||||
this.groupId_ = groupId;
|
||||
this.artifactId_ = artifactId;
|
||||
this.version_ = (version == null ? VersionNumber.UNKNOWN : version);
|
||||
this.classifier_ = (classifier == null ? "" : classifier);
|
||||
this.type_ = type;
|
||||
this.exclusions_ = (exclusions == null ? new ExclusionSet() : exclusions);
|
||||
this.parent_ = parent;
|
||||
}
|
||||
|
||||
private static final Pattern DEPENDENCY_PATTERN = Pattern.compile("^(?<groupId>[^:@]+):(?<artifactId>[^:@]+)(?::(?<version>[^:@]+)(?::(?<classifier>[^:@]+))?)?(?:@(?<type>[^:@]+))?$");
|
||||
|
@ -95,7 +125,7 @@ public record Dependency(String groupId, String artifactId, Version version, Str
|
|||
* @since 1.5
|
||||
*/
|
||||
public Dependency baseDependency() {
|
||||
return new Dependency(groupId, artifactId, VersionNumber.UNKNOWN, classifier, type);
|
||||
return new Dependency(groupId_, artifactId_, VersionNumber.UNKNOWN, classifier_, type_);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -107,7 +137,7 @@ public record Dependency(String groupId, String artifactId, Version version, Str
|
|||
* @since 1.5
|
||||
*/
|
||||
public Dependency exclude(String groupId, String artifactId) {
|
||||
exclusions.add(new DependencyExclusion(groupId, artifactId));
|
||||
exclusions_.add(new DependencyExclusion(groupId, artifactId));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -119,7 +149,7 @@ public record Dependency(String groupId, String artifactId, Version version, Str
|
|||
* @since 1.5.6
|
||||
*/
|
||||
public Dependency withClassifier(String classifier) {
|
||||
return new Dependency(groupId, artifactId, version, classifier, type);
|
||||
return new Dependency(groupId_, artifactId_, version_, classifier, type_);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -146,34 +176,130 @@ public record Dependency(String groupId, String artifactId, Version version, Str
|
|||
* @since 2.0
|
||||
*/
|
||||
public String toArtifactString() {
|
||||
return groupId + ':' + artifactId;
|
||||
return groupId_ + ':' + artifactId_;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
var result = new StringBuilder(groupId).append(':').append(artifactId);
|
||||
if (!version.equals(VersionNumber.UNKNOWN)) {
|
||||
result.append(':').append(version);
|
||||
var result = new StringBuilder(groupId_).append(':').append(artifactId_);
|
||||
if (!version_.equals(VersionNumber.UNKNOWN)) {
|
||||
result.append(':').append(version_);
|
||||
}
|
||||
if (!classifier.isEmpty()) {
|
||||
result.append(':').append(classifier);
|
||||
if (!classifier_.isEmpty()) {
|
||||
result.append(':').append(classifier_);
|
||||
}
|
||||
if (!type.isEmpty() && !"jar".equals(type)) {
|
||||
result.append('@').append(type);
|
||||
if (!type_.isEmpty() && !TYPE_JAR.equals(type_)) {
|
||||
result.append('@').append(type_);
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this dependency's {@code groupId}.
|
||||
*
|
||||
* @return the {@code groupId} of this dependency
|
||||
* @since 1.5
|
||||
*/
|
||||
public String groupId() {
|
||||
return groupId_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this dependency's {@code artifactId}.
|
||||
*
|
||||
* @return the {@code artifactId} of this dependency
|
||||
* @since 1.5
|
||||
*/
|
||||
public String artifactId() {
|
||||
return artifactId_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this dependency's {@code version}.
|
||||
*
|
||||
* @return the {@code version} of this dependency
|
||||
* @since 1.5
|
||||
*/
|
||||
public Version version() {
|
||||
return version_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this dependency's {@code classifier}.
|
||||
*
|
||||
* @return the {@code classifier} of this dependency
|
||||
* @since 1.5
|
||||
*/
|
||||
public String classifier() {
|
||||
return classifier_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this dependency's {@code type}.
|
||||
*
|
||||
* @return the {@code type} of this dependency
|
||||
* @since 1.5
|
||||
*/
|
||||
public String type() {
|
||||
return type_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this dependency's {@code exclusions} for transitive resolution.
|
||||
*
|
||||
* @return the {@code exclusions} of this dependency
|
||||
* @since 1.5
|
||||
*/
|
||||
public ExclusionSet exclusions() {
|
||||
return exclusions_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this dependency's {@code parent} dependency that created this
|
||||
* dependency (only for information purposes).
|
||||
*
|
||||
* @return the {@code parent} of this dependency
|
||||
* @since 1.5
|
||||
*/
|
||||
public Dependency parent() {
|
||||
return parent_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this dependency specifically is a classpath jar or not.
|
||||
*
|
||||
* @return {@code true} when this dependency specifically is a classpath jar; or {@code false} otherwise
|
||||
* @since 2.1
|
||||
*/
|
||||
public boolean isClasspathJar() {
|
||||
return Module.TYPE_CLASSPATH_JAR.equals(type_);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this dependency is a modular jar or not.
|
||||
*
|
||||
* @return {@code true} when this dependency is a modular jar; or {@code false} otherwise
|
||||
* @since 2.1
|
||||
*/
|
||||
public boolean isModularJar() {
|
||||
return Module.TYPE_MODULAR_JAR.equals(type_);
|
||||
}
|
||||
|
||||
private static String normalizedJarType(String type) {
|
||||
if (TYPE_JAR.equals(type) || TYPE_MODULAR_JAR.equals(type) || TYPE_CLASSPATH_JAR.equals(type)) {
|
||||
return TYPE_JAR;
|
||||
}
|
||||
return type;
|
||||
}
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
var that = (Dependency) o;
|
||||
return groupId.equals(that.groupId) &&
|
||||
artifactId.equals(that.artifactId) &&
|
||||
classifier.equals(that.classifier) &&
|
||||
type.equals(that.type);
|
||||
if (!(o instanceof Dependency that)) return false;
|
||||
return groupId_.equals(that.groupId_) &&
|
||||
artifactId_.equals(that.artifactId_) &&
|
||||
classifier_.equals(that.classifier_) &&
|
||||
normalizedJarType(type_).equals(normalizedJarType(that.type_));
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return Objects.hash(groupId, artifactId, classifier, type);
|
||||
return Objects.hash(groupId_, artifactId_, classifier_, normalizedJarType(type_));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ import java.io.*;
|
|||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static rife.bld.dependencies.Dependency.*;
|
||||
|
||||
/**
|
||||
* Resolves a dependency within a list of Maven-compatible repositories.
|
||||
*
|
||||
|
@ -333,7 +335,7 @@ public class DependencyResolver {
|
|||
result.append('-').append(dependency_.classifier());
|
||||
}
|
||||
var type = dependency_.type();
|
||||
if (type == null) {
|
||||
if (type == null || TYPE_JAR.equals(type) || TYPE_MODULAR_JAR.equals(type) || TYPE_CLASSPATH_JAR.equals(type)) {
|
||||
type = "jar";
|
||||
}
|
||||
result.append('.').append(type);
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.*;
|
|||
public class DependencySet extends AbstractSet<Dependency> implements Set<Dependency> {
|
||||
private final Map<Dependency, Dependency> dependencies_ = new LinkedHashMap<>();
|
||||
private final Set<LocalDependency> localDependencies_ = new LinkedHashSet<>();
|
||||
private final Set<LocalModule> localModules_ = new LinkedHashSet<>();
|
||||
|
||||
/**
|
||||
* Creates an empty dependency set.
|
||||
|
@ -79,42 +80,86 @@ public class DependencySet extends AbstractSet<Dependency> implements Set<Depend
|
|||
return localDependencies_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes a local module into the dependency set.
|
||||
* <p>
|
||||
* Local modules aren't resolved and point to a location on
|
||||
* the file system.
|
||||
*
|
||||
* @param module the module to include
|
||||
* @return this dependency set instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public DependencySet include(LocalModule module) {
|
||||
localModules_.add(module);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the local modules.
|
||||
*
|
||||
* @return the set of local modules
|
||||
* @since 2.1
|
||||
*/
|
||||
public Set<LocalModule> localModules() {
|
||||
return localModules_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transfers the artifacts for the dependencies into the provided directory.
|
||||
* <p>
|
||||
* The destination directory must exist and be writable.
|
||||
*
|
||||
* @param resolution the version resolution state that can be cached
|
||||
* @param retriever the retriever to use to get artifacts
|
||||
* @param repositories the repositories to use for the transfer
|
||||
* @param directory the directory to transfer the artifacts into
|
||||
* @param resolution the version resolution state that can be cached
|
||||
* @param retriever the retriever to use to get artifacts
|
||||
* @param repositories the repositories to use for the transfer
|
||||
* @param directory the directory to transfer the artifacts into
|
||||
* @param modulesDirectory the directory to download the modules into
|
||||
* @return the list of artifacts that were transferred successfully
|
||||
* @throws DependencyTransferException when an error occurred during the transfer
|
||||
* @since 2.0
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<RepositoryArtifact> transferIntoDirectory(VersionResolution resolution, ArtifactRetriever retriever, List<Repository> repositories, File directory) {
|
||||
return transferIntoDirectory(resolution, retriever, repositories, directory, (String[]) null);
|
||||
public List<RepositoryArtifact> transferIntoDirectory(VersionResolution resolution, ArtifactRetriever retriever, List<Repository> repositories, File directory, File modulesDirectory) {
|
||||
return transferIntoDirectory(resolution, retriever, repositories, directory, modulesDirectory, (String[]) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transfers the artifacts for the dependencies into the provided directory,
|
||||
* Transfers the artifacts for the dependencies into the provided directories,
|
||||
* including other classifiers.
|
||||
* <p>
|
||||
* The destination directory must exist and be writable.
|
||||
*
|
||||
* @param resolution the version resolution state that can be cached
|
||||
* @param retriever the retriever to use to get artifacts
|
||||
* @param repositories the repositories to use for the download
|
||||
* @param directory the directory to download the artifacts into
|
||||
* @param resolution the version resolution state that can be cached
|
||||
* @param retriever the retriever to use to get artifacts
|
||||
* @param repositories the repositories to use for the download
|
||||
* @param directory the directory to download the artifacts into
|
||||
* @param modulesDirectory the directory to download the modules into
|
||||
* @param classifiers the additional classifiers to transfer
|
||||
* @return the list of artifacts that were transferred successfully
|
||||
* @throws DependencyTransferException when an error occurred during the transfer
|
||||
* @since 2.0
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<RepositoryArtifact> transferIntoDirectory(VersionResolution resolution, ArtifactRetriever retriever, List<Repository> repositories, File directory, String... classifiers) {
|
||||
public List<RepositoryArtifact> transferIntoDirectory(VersionResolution resolution, ArtifactRetriever retriever, List<Repository> repositories, File directory, File modulesDirectory, String... classifiers) {
|
||||
var result = new ArrayList<RepositoryArtifact>();
|
||||
for (var dependency : this) {
|
||||
var artifact = new DependencyResolver(resolution, retriever, repositories, dependency).transferIntoDirectory(directory);
|
||||
var transfer_directory = directory;
|
||||
if (dependency.isModularJar()) {
|
||||
if (modulesDirectory == null) {
|
||||
throw new DependencyTransferException(dependency, "modules directory is not provided");
|
||||
}
|
||||
transfer_directory = modulesDirectory;
|
||||
}
|
||||
else if (directory == null) {
|
||||
throw new DependencyTransferException(dependency, "artifacts directory is not provided");
|
||||
}
|
||||
|
||||
if (!transfer_directory.exists()) {
|
||||
if (!transfer_directory.mkdirs()) {
|
||||
throw new DependencyTransferException(dependency, transfer_directory, "couldn't create directory");
|
||||
}
|
||||
}
|
||||
|
||||
var artifact = new DependencyResolver(resolution, retriever, repositories, dependency).transferIntoDirectory(transfer_directory);
|
||||
if (artifact != null) {
|
||||
result.add(artifact);
|
||||
}
|
||||
|
@ -122,7 +167,7 @@ public class DependencySet extends AbstractSet<Dependency> implements Set<Depend
|
|||
if (classifiers != null) {
|
||||
for (var classifier : classifiers) {
|
||||
if (classifier != null) {
|
||||
var classifier_artifact = new DependencyResolver(resolution, retriever, repositories, dependency.withClassifier(classifier)).transferIntoDirectory(directory);
|
||||
var classifier_artifact = new DependencyResolver(resolution, retriever, repositories, dependency.withClassifier(classifier)).transferIntoDirectory(transfer_directory);
|
||||
if (classifier_artifact != null) {
|
||||
result.add(classifier_artifact);
|
||||
}
|
||||
|
|
17
src/main/java/rife/bld/dependencies/LocalModule.java
Normal file
17
src/main/java/rife/bld/dependencies/LocalModule.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright 2001-2024 Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||
*/
|
||||
package rife.bld.dependencies;
|
||||
|
||||
/**
|
||||
* Contains the information required to describe a local module for the build system.
|
||||
* <p>
|
||||
* If the local module points to a directory, it will be scanned for jar files.
|
||||
*
|
||||
* @param path the file system path of the local module
|
||||
* @author Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* @since 2.1
|
||||
*/
|
||||
public record LocalModule(String path) {
|
||||
}
|
67
src/main/java/rife/bld/dependencies/Module.java
Normal file
67
src/main/java/rife/bld/dependencies/Module.java
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright 2001-2024 Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||
*/
|
||||
package rife.bld.dependencies;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Contains the information required to describe a Java module dependency in the build system.
|
||||
*
|
||||
* @author Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* @since 2.1
|
||||
*/
|
||||
public class Module extends Dependency {
|
||||
public Module(String groupId, String artifactId) {
|
||||
this(groupId, artifactId, null, null, null, null);
|
||||
}
|
||||
|
||||
public Module(String groupId, String artifactId, Version version) {
|
||||
this(groupId, artifactId, version, null, null, null);
|
||||
}
|
||||
|
||||
public Module(String groupId, String artifactId, Version version, String classifier) {
|
||||
this(groupId, artifactId, version, classifier, null, null);
|
||||
}
|
||||
|
||||
public Module(String groupId, String artifactId, Version version, String classifier, ExclusionSet exclusions) {
|
||||
this(groupId, artifactId, version, classifier, exclusions, null);
|
||||
}
|
||||
|
||||
public Module(String groupId, String artifactId, Version version, String classifier, ExclusionSet exclusions, Dependency parent) {
|
||||
super(groupId, artifactId, version, classifier, TYPE_MODULAR_JAR, exclusions, parent);
|
||||
}
|
||||
|
||||
private static final Pattern MODULE_PATTERN = Pattern.compile("^(?<groupId>[^:@]+):(?<artifactId>[^:@]+)(?::(?<version>[^:@]+)(?::(?<classifier>[^:@]+))?)?(?:@modular-jar)?$");
|
||||
|
||||
/**
|
||||
* Parses a module from a string representation.
|
||||
* The format is {@code groupId:artifactId:version:classifier}.
|
||||
* The {@code version} and {@code classifier} are optional.
|
||||
* <p>
|
||||
* If the string can't be successfully parsed, {@code null} will be returned.
|
||||
*
|
||||
* @param module the module string to parse
|
||||
* @return a parsed instance of {@code Module}; or
|
||||
* {@code null} when the string couldn't be parsed
|
||||
* @since 2.1
|
||||
*/
|
||||
public static Module parse(String module) {
|
||||
if (module == null || module.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var matcher = MODULE_PATTERN.matcher(module);
|
||||
if (!matcher.matches()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var groupId = matcher.group("groupId");
|
||||
var artifactId = matcher.group("artifactId");
|
||||
var version = Version.parse(matcher.group("version"));
|
||||
var classifier = matcher.group("classifier");
|
||||
|
||||
return new Module(groupId, artifactId, version, classifier);
|
||||
}
|
||||
}
|
|
@ -10,6 +10,8 @@ import rife.xml.Xml2Data;
|
|||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static rife.bld.dependencies.Dependency.TYPE_JAR;
|
||||
|
||||
/**
|
||||
* Parses an XML document to retrieve POM information, this is an internal class.
|
||||
*
|
||||
|
@ -103,7 +105,7 @@ class Xml2MavenPom extends Xml2Data {
|
|||
"false",
|
||||
exclusions,
|
||||
dependency.parent());
|
||||
if (resolved_dependency.type() == null || resolved_dependency.type().equals("jar")) {
|
||||
if (resolved_dependency.type() == null || TYPE_JAR.equals(resolved_dependency.type())) {
|
||||
var scope = Scope.valueOf(resolved_dependency.scope());
|
||||
if (scopes_list.contains(scope)) {
|
||||
var resolved_dependency_set = resolved_dependencies.computeIfAbsent(scope, k -> new LinkedHashSet<>());
|
||||
|
|
|
@ -24,6 +24,22 @@ public class DependencyTransferException extends DependencyException {
|
|||
destination_ = destination;
|
||||
}
|
||||
|
||||
public DependencyTransferException(Dependency dependency, File destination, String message) {
|
||||
super("Unable to transfer dependency '" + dependency + "' into '" + destination + "': " + message);
|
||||
|
||||
dependency_ = dependency;
|
||||
location_ = null;
|
||||
destination_ = destination;
|
||||
}
|
||||
|
||||
public DependencyTransferException(Dependency dependency, String message) {
|
||||
super("Unable to transfer dependency '" + dependency + "': " + message);
|
||||
|
||||
dependency_ = dependency;
|
||||
location_ = null;
|
||||
destination_ = null;
|
||||
}
|
||||
|
||||
public Dependency getDependency() {
|
||||
return dependency_;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
|
|||
protected String javaTool_ = DEFAULT_JAVA_TOOL;
|
||||
protected final JavaOptions javaOptions_ = new JavaOptions();
|
||||
protected final List<String> classpath_ = new ArrayList<>();
|
||||
protected final List<String> modulePath_ = new ArrayList<>();
|
||||
protected String mainClass_;
|
||||
protected Function<String, Boolean> outputProcessor_;
|
||||
protected Function<String, Boolean> errorProcessor_;
|
||||
|
@ -213,6 +214,32 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
|
|||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides module path entries to use for the operation.
|
||||
*
|
||||
* @param modulePath module path entries for the operation
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public T modulePath(String... modulePath) {
|
||||
modulePath_.addAll(List.of(modulePath));
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of module path entries to use for the operation.
|
||||
* <p>
|
||||
* A copy will be created to allow this list to be independently modifiable.
|
||||
*
|
||||
* @param modulePath a list of module path entries for the operation
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public T modulePath(List<String> modulePath) {
|
||||
modulePath_.addAll(modulePath);
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the main class to launch with the java tool.
|
||||
*
|
||||
|
@ -297,6 +324,18 @@ public abstract class AbstractProcessOperation<T extends AbstractProcessOperatio
|
|||
return classpath_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the module path to use for the operation.
|
||||
* <p>
|
||||
* This is a modifiable list that can be retrieved and changed.
|
||||
*
|
||||
* @return the operation's module path
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<String> modulePath() {
|
||||
return modulePath_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the main class to launch with the java tool.
|
||||
*
|
||||
|
|
|
@ -26,6 +26,8 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
|||
private File buildTestDirectory_;
|
||||
private final List<String> compileMainClasspath_ = new ArrayList<>();
|
||||
private final List<String> compileTestClasspath_ = new ArrayList<>();
|
||||
private final List<String> compileMainModulePath_ = new ArrayList<>();
|
||||
private final List<String> compileTestModulePath_ = new ArrayList<>();
|
||||
private final List<File> mainSourceFiles_ = new ArrayList<>();
|
||||
private final List<File> testSourceFiles_ = new ArrayList<>();
|
||||
private final List<File> mainSourceDirectories_ = new ArrayList<>();
|
||||
|
@ -78,6 +80,7 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
|||
}
|
||||
executeBuildSources(
|
||||
compileMainClasspath(),
|
||||
compileMainModulePath(),
|
||||
sources,
|
||||
buildMainDirectory());
|
||||
}
|
||||
|
@ -95,6 +98,7 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
|||
}
|
||||
executeBuildSources(
|
||||
compileTestClasspath(),
|
||||
compileTestModulePath(),
|
||||
sources,
|
||||
buildTestDirectory());
|
||||
}
|
||||
|
@ -103,11 +107,12 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
|||
* Part of the {@link #execute} operation, build sources to a destination.
|
||||
*
|
||||
* @param classpath the classpath list used for the compilation
|
||||
* @param modulePath the module path list used for the compilation
|
||||
* @param sources the source files to compile
|
||||
* @param destination the destination directory
|
||||
* @since 1.5
|
||||
* @since 2.1
|
||||
*/
|
||||
protected void executeBuildSources(List<String> classpath, List<File> sources, File destination)
|
||||
protected void executeBuildSources(List<String> classpath, List<String> modulePath, List<File> sources, File destination)
|
||||
throws IOException {
|
||||
if (sources.isEmpty() || destination == null) {
|
||||
return;
|
||||
|
@ -117,7 +122,13 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
|||
try (var file_manager = compiler.getStandardFileManager(null, null, null)) {
|
||||
var compilation_units = file_manager.getJavaFileObjectsFromFiles(sources);
|
||||
var diagnostics = new DiagnosticCollector<JavaFileObject>();
|
||||
var options = new ArrayList<>(List.of("-d", destination.getAbsolutePath(), "-cp", FileUtils.joinPaths(classpath)));
|
||||
var options = new ArrayList<>(List.of("-d", destination.getAbsolutePath()));
|
||||
if (!classpath.isEmpty()) {
|
||||
options.addAll(List.of("-cp", FileUtils.joinPaths(classpath)));
|
||||
}
|
||||
if (!modulePath.isEmpty()) {
|
||||
options.addAll(List.of("-p", FileUtils.joinPaths(modulePath)));
|
||||
}
|
||||
options.addAll(compileOptions());
|
||||
var compilation_task = compiler.getTask(null, file_manager, diagnostics, options, null, compilation_units);
|
||||
if (!compilation_task.call()) {
|
||||
|
@ -161,6 +172,8 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
|||
.buildTestDirectory(project.buildTestDirectory())
|
||||
.compileMainClasspath(project.compileMainClasspath())
|
||||
.compileTestClasspath(project.compileTestClasspath())
|
||||
.compileMainModulePath(project.compileMainModulePath())
|
||||
.compileTestModulePath(project.compileTestModulePath())
|
||||
.mainSourceFiles(project.mainSourceFiles())
|
||||
.testSourceFiles(project.testSourceFiles());
|
||||
if (project.javaRelease() != null && !compileOptions().containsRelease()) {
|
||||
|
@ -245,6 +258,58 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides entries for the main compilation module path.
|
||||
*
|
||||
* @param modulePath module path entries
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public CompileOperation compileMainModulePath(String... modulePath) {
|
||||
compileMainModulePath_.addAll(Arrays.asList(modulePath));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of entries for the main compilation module path.
|
||||
* <p>
|
||||
* A copy will be created to allow this list to be independently modifiable.
|
||||
*
|
||||
* @param modulePath a list of module path entries
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public CompileOperation compileMainModulePath(List<String> modulePath) {
|
||||
compileMainModulePath_.addAll(modulePath);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides entries for the test compilation module path.
|
||||
*
|
||||
* @param modulePath module path entries
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public CompileOperation compileTestModulePath(String... modulePath) {
|
||||
compileTestModulePath_.addAll(Arrays.asList(modulePath));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of entries for the test compilation module path.
|
||||
* <p>
|
||||
* A copy will be created to allow this list to be independently modifiable.
|
||||
*
|
||||
* @param modulePath a list of module path entries
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public CompileOperation compileTestModulePath(List<String> modulePath) {
|
||||
compileTestModulePath_.addAll(modulePath);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides main files that should be compiled.
|
||||
*
|
||||
|
@ -407,6 +472,30 @@ public class CompileOperation extends AbstractOperation<CompileOperation> {
|
|||
return compileTestClasspath_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the list of entries for the main compilation module path.
|
||||
* <p>
|
||||
* This is a modifiable list that can be retrieved and changed.
|
||||
*
|
||||
* @return the main compilation module path list
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<String> compileMainModulePath() {
|
||||
return compileMainModulePath_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the list of entries for the test compilation module path.
|
||||
* <p>
|
||||
* This is a modifiable list that can be retrieved and changed.
|
||||
*
|
||||
* @return the test compilation module path list
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<String> compileTestModulePath() {
|
||||
return compileTestModulePath_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the list of main files that should be compiled.
|
||||
* <p>
|
||||
|
|
|
@ -31,10 +31,15 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
private final List<Repository> repositories_ = new ArrayList<>();
|
||||
private final DependencyScopes dependencies_ = new DependencyScopes();
|
||||
private File libCompileDirectory_;
|
||||
private File libCompileModulesDirectory_;
|
||||
private File libProvidedDirectory_;
|
||||
private File libProvidedModulesDirectory_;
|
||||
private File libRuntimeDirectory_;
|
||||
private File libRuntimeModulesDirectory_;
|
||||
private File libStandaloneDirectory_;
|
||||
private File libStandaloneModulesDirectory_;
|
||||
private File libTestDirectory_;
|
||||
private File libTestModulesDirectory_;
|
||||
private boolean downloadSources_ = false;
|
||||
private boolean downloadJavadoc_ = false;
|
||||
|
||||
|
@ -65,7 +70,7 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
* @since 1.5
|
||||
*/
|
||||
protected void executeDownloadCompileDependencies() {
|
||||
executeDownloadDependencies(libCompileDirectory(), dependencies().resolveCompileDependencies(properties(), artifactRetriever(), repositories()));
|
||||
executeDownloadDependencies(libCompileDirectory(), libCompileModulesDirectory(), dependencies().resolveCompileDependencies(properties(), artifactRetriever(), repositories()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,7 +79,7 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
* @since 1.8
|
||||
*/
|
||||
protected void executeDownloadProvidedDependencies() {
|
||||
executeDownloadDependencies(libProvidedDirectory(), dependencies().resolveProvidedDependencies(properties(), artifactRetriever(), repositories()));
|
||||
executeDownloadDependencies(libProvidedDirectory(), libProvidedModulesDirectory(), dependencies().resolveProvidedDependencies(properties(), artifactRetriever(), repositories()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,7 +88,7 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
* @since 1.5
|
||||
*/
|
||||
protected void executeDownloadRuntimeDependencies() {
|
||||
executeDownloadDependencies(libRuntimeDirectory(), dependencies().resolveRuntimeDependencies(properties(), artifactRetriever(), repositories()));
|
||||
executeDownloadDependencies(libRuntimeDirectory(), libRuntimeModulesDirectory(), dependencies().resolveRuntimeDependencies(properties(), artifactRetriever(), repositories()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -92,7 +97,7 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
* @since 1.5
|
||||
*/
|
||||
protected void executeDownloadStandaloneDependencies() {
|
||||
executeDownloadDependencies(libStandaloneDirectory(), dependencies().resolveStandaloneDependencies(properties(), artifactRetriever(), repositories()));
|
||||
executeDownloadDependencies(libStandaloneDirectory(), libStandaloneModulesDirectory(), dependencies().resolveStandaloneDependencies(properties(), artifactRetriever(), repositories()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,23 +106,18 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
* @since 1.5
|
||||
*/
|
||||
protected void executeDownloadTestDependencies() {
|
||||
executeDownloadDependencies(libTestDirectory(), dependencies().resolveTestDependencies(properties(), artifactRetriever(), repositories()));
|
||||
executeDownloadDependencies(libTestDirectory(), libTestModulesDirectory(), dependencies().resolveTestDependencies(properties(), artifactRetriever(), repositories()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of the {@link #execute} operation, download the artifacts for a particular dependency scope.
|
||||
*
|
||||
* @param destinationDirectory the directory in which the artifacts should be downloaded
|
||||
* @param modulesDirectory the directory in which the modules should be downloaded
|
||||
* @param dependencies the dependencies to download
|
||||
* @since 1.6
|
||||
* @since 2.1
|
||||
*/
|
||||
protected void executeDownloadDependencies(File destinationDirectory, DependencySet dependencies) {
|
||||
if (destinationDirectory == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
destinationDirectory.mkdirs();
|
||||
|
||||
protected void executeDownloadDependencies(File destinationDirectory, File modulesDirectory, DependencySet dependencies) {
|
||||
var additional_classifiers = new String[0];
|
||||
|
||||
if (downloadSources_ || downloadJavadoc_) {
|
||||
|
@ -128,7 +128,7 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
additional_classifiers = classifiers.toArray(new String[0]);
|
||||
}
|
||||
|
||||
dependencies.transferIntoDirectory(new VersionResolution(properties()), artifactRetriever(), repositories(), destinationDirectory, additional_classifiers);
|
||||
dependencies.transferIntoDirectory(new VersionResolution(properties()), artifactRetriever(), repositories(), destinationDirectory, modulesDirectory, additional_classifiers);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -145,10 +145,15 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
.repositories(project.repositories())
|
||||
.dependencies(project.dependencies())
|
||||
.libCompileDirectory(project.libCompileDirectory())
|
||||
.libCompileModulesDirectory(project.libCompileModulesDirectory())
|
||||
.libProvidedDirectory(project.libProvidedDirectory())
|
||||
.libProvidedModulesDirectory(project.libProvidedModulesDirectory())
|
||||
.libRuntimeDirectory(project.libRuntimeDirectory())
|
||||
.libRuntimeModulesDirectory(project.libRuntimeModulesDirectory())
|
||||
.libStandaloneDirectory(project.libStandaloneDirectory())
|
||||
.libStandaloneModulesDirectory(project.libStandaloneModulesDirectory())
|
||||
.libTestDirectory(project.libTestDirectory())
|
||||
.libTestModulesDirectory(project.libTestModulesDirectory())
|
||||
.downloadSources(project.downloadSources())
|
||||
.downloadJavadoc(project.downloadJavadoc());
|
||||
}
|
||||
|
@ -227,6 +232,18 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code compile} scope modules download directory.
|
||||
*
|
||||
* @param directory the directory to download the {@code compile} scope modules into
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public DownloadOperation libCompileModulesDirectory(File directory) {
|
||||
libCompileModulesDirectory_ = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code provided} scope download directory.
|
||||
*
|
||||
|
@ -239,6 +256,18 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code provided} scope modules download directory.
|
||||
*
|
||||
* @param directory the directory to download the {@code provided} scope modules into
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public DownloadOperation libProvidedModulesDirectory(File directory) {
|
||||
libProvidedModulesDirectory_ = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code runtime} scope download directory.
|
||||
*
|
||||
|
@ -251,6 +280,18 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code runtime} scope modules download directory.
|
||||
*
|
||||
* @param directory the directory to download the {@code runtime} scope modules into
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public DownloadOperation libRuntimeModulesDirectory(File directory) {
|
||||
libRuntimeModulesDirectory_ = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code standalone} scope download directory.
|
||||
*
|
||||
|
@ -263,6 +304,18 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code standalone} scope modules download directory.
|
||||
*
|
||||
* @param directory the directory to download the {@code standalone} scope modules into
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public DownloadOperation libStandaloneModulesDirectory(File directory) {
|
||||
libStandaloneModulesDirectory_ = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code test} scope download directory.
|
||||
*
|
||||
|
@ -275,6 +328,18 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code test} scope modules download directory.
|
||||
*
|
||||
* @param directory the directory to download the {@code test} scope modules into
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public DownloadOperation libTestModulesDirectory(File directory) {
|
||||
libTestModulesDirectory_ = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the sources classifier should also be downloaded.
|
||||
*
|
||||
|
@ -359,6 +424,16 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
return libCompileDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code compile} scope modules download directory.
|
||||
*
|
||||
* @return the {@code compile} scope modules download directory
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libCompileModulesDirectory() {
|
||||
return libCompileModulesDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code provided} scope download directory.
|
||||
*
|
||||
|
@ -369,6 +444,16 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
return libProvidedDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code provided} scope modules download directory.
|
||||
*
|
||||
* @return the {@code provided} scope modules download directory
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libProvidedModulesDirectory() {
|
||||
return libProvidedModulesDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code runtime} scope download directory.
|
||||
*
|
||||
|
@ -379,6 +464,16 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
return libRuntimeDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code runtime} scope modules download directory.
|
||||
*
|
||||
* @return the {@code runtime} scope modules download directory
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libRuntimeModulesDirectory() {
|
||||
return libRuntimeModulesDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code standalone} scope download directory.
|
||||
*
|
||||
|
@ -389,6 +484,16 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
return libStandaloneDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code standalone} scope modules download directory.
|
||||
*
|
||||
* @return the {@code standalone} scope modules download directory
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libStandaloneModulesDirectory() {
|
||||
return libStandaloneModulesDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code test} scope download directory.
|
||||
*
|
||||
|
@ -399,6 +504,16 @@ public class DownloadOperation extends AbstractOperation<DownloadOperation> {
|
|||
return libTestDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code test} scope modules download directory.
|
||||
*
|
||||
* @return the {@code test} scope modules download directory
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libTestModulesDirectory() {
|
||||
return libTestModulesDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves whether the sources classifier should also be downloaded.
|
||||
*
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.regex.Pattern;
|
|||
public class JavadocOperation extends AbstractOperation<JavadocOperation> {
|
||||
private File buildDirectory_;
|
||||
private final List<String> classpath_ = new ArrayList<>();
|
||||
private final List<String> modulePath_ = new ArrayList<>();
|
||||
private final List<File> sourceFiles_ = new ArrayList<>();
|
||||
private final List<File> sourceDirectories_ = new ArrayList<>();
|
||||
private final JavadocOptions javadocOptions_ = new JavadocOptions();
|
||||
|
@ -74,6 +75,7 @@ public class JavadocOperation extends AbstractOperation<JavadocOperation> {
|
|||
}
|
||||
executeBuildSources(
|
||||
classpath(),
|
||||
modulePath(),
|
||||
sources,
|
||||
buildDirectory());
|
||||
}
|
||||
|
@ -81,12 +83,13 @@ public class JavadocOperation extends AbstractOperation<JavadocOperation> {
|
|||
/**
|
||||
* Part of the {@link #execute} operation, build sources to a destination.
|
||||
*
|
||||
* @param classpath the classpath list used for the compilation
|
||||
* @param classpath the classpath list used for the javadoc generation
|
||||
* @param modulePath the module path list used for the javadoc generation
|
||||
* @param sources the source files to compile
|
||||
* @param destination the destination directory
|
||||
* @since 1.5.10
|
||||
* @since 2.1
|
||||
*/
|
||||
protected void executeBuildSources(List<String> classpath, List<File> sources, File destination)
|
||||
protected void executeBuildSources(List<String> classpath, List<String> modulePath, List<File> sources, File destination)
|
||||
throws IOException {
|
||||
if (sources.isEmpty() || destination == null) {
|
||||
return;
|
||||
|
@ -103,7 +106,13 @@ public class JavadocOperation extends AbstractOperation<JavadocOperation> {
|
|||
try (var file_manager = documentation.getStandardFileManager(null, null, null)) {
|
||||
var compilation_units = file_manager.getJavaFileObjectsFromFiles(filtered_sources);
|
||||
var diagnostics = new DiagnosticCollector<JavaFileObject>();
|
||||
var options = new ArrayList<>(List.of("-d", destination.getAbsolutePath(), "-cp", FileUtils.joinPaths(classpath)));
|
||||
var options = new ArrayList<>(List.of("-d", destination.getAbsolutePath()));
|
||||
if (!classpath.isEmpty()) {
|
||||
options.addAll(List.of("-cp", FileUtils.joinPaths(classpath)));
|
||||
}
|
||||
if (!modulePath.isEmpty()) {
|
||||
options.addAll(List.of("-p", FileUtils.joinPaths(modulePath)));
|
||||
}
|
||||
options.addAll(javadocOptions());
|
||||
var documentation_task = documentation.getTask(null, file_manager, diagnostics, null, options, compilation_units);
|
||||
if (!documentation_task.call()) {
|
||||
|
@ -146,6 +155,7 @@ public class JavadocOperation extends AbstractOperation<JavadocOperation> {
|
|||
var operation = buildDirectory(project.buildJavadocDirectory())
|
||||
.classpath(project.compileMainClasspath())
|
||||
.classpath(project.buildMainDirectory().getAbsolutePath())
|
||||
.modulePath(project.compileMainModulePath())
|
||||
.sourceFiles(project.mainSourceFiles());
|
||||
if (project.javaRelease() != null && !javadocOptions().containsRelease()) {
|
||||
javadocOptions().release(project.javaRelease());
|
||||
|
@ -191,6 +201,32 @@ public class JavadocOperation extends AbstractOperation<JavadocOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides entries for the javadoc module path.
|
||||
*
|
||||
* @param modulePath module path entries
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavadocOperation modulePath(String... modulePath) {
|
||||
modulePath_.addAll(Arrays.asList(modulePath));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a list of entries for the javadoc moduel path.
|
||||
* <p>
|
||||
* A copy will be created to allow this list to be independently modifiable.
|
||||
*
|
||||
* @param modulePath a list of module path entries
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public JavadocOperation modulePath(List<String> modulePath) {
|
||||
modulePath_.addAll(modulePath);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides files for which documentation should be generated.
|
||||
*
|
||||
|
@ -361,6 +397,18 @@ public class JavadocOperation extends AbstractOperation<JavadocOperation> {
|
|||
return classpath_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the list of entries for the javadoc module path.
|
||||
* <p>
|
||||
* This is a modifiable list that can be retrieved and changed.
|
||||
*
|
||||
* @return the javadoc module path list
|
||||
* @since 2.1
|
||||
*/
|
||||
public List<String> modulePath() {
|
||||
return modulePath_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the list of files for which documentation should be generation.
|
||||
* <p>
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.time.ZonedDateTime;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static rife.bld.dependencies.Dependency.*;
|
||||
import static rife.bld.publish.MetadataBuilder.SNAPSHOT_TIMESTAMP_FORMATTER;
|
||||
import static rife.tools.HttpUtils.*;
|
||||
import static rife.tools.StringUtils.encodeHexLower;
|
||||
|
@ -180,8 +181,8 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
artifact_name.append('-').append(artifact.classifier());
|
||||
}
|
||||
var type = artifact.type();
|
||||
if (type == null) {
|
||||
type = "jar";
|
||||
if (type == null || TYPE_JAR.equals(type) || TYPE_MODULAR_JAR.equals(type) || TYPE_CLASSPATH_JAR.equals(type)) {
|
||||
type = TYPE_JAR;
|
||||
}
|
||||
artifact_name.append('.').append(type);
|
||||
|
||||
|
@ -517,9 +518,9 @@ public class PublishOperation extends AbstractOperation<PublishOperation> {
|
|||
artifactRetriever(project.artifactRetriever());
|
||||
dependencies().include(project.dependencies());
|
||||
artifacts(List.of(
|
||||
new PublishArtifact(new File(project.buildDistDirectory(), project.jarFileName()), "", "jar"),
|
||||
new PublishArtifact(new File(project.buildDistDirectory(), project.sourcesJarFileName()), "sources", "jar"),
|
||||
new PublishArtifact(new File(project.buildDistDirectory(), project.javadocJarFileName()), "javadoc", "jar")));
|
||||
new PublishArtifact(new File(project.buildDistDirectory(), project.jarFileName()), "", TYPE_JAR),
|
||||
new PublishArtifact(new File(project.buildDistDirectory(), project.sourcesJarFileName()), CLASSIFIER_SOURCES, TYPE_JAR),
|
||||
new PublishArtifact(new File(project.buildDistDirectory(), project.javadocJarFileName()), CLASSIFIER_JAVADOC, TYPE_JAR)));
|
||||
if (info().groupId() == null) {
|
||||
info().groupId(project.pkg());
|
||||
}
|
||||
|
|
|
@ -31,10 +31,15 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
private final List<Repository> repositories_ = new ArrayList<>();
|
||||
private final DependencyScopes dependencies_ = new DependencyScopes();
|
||||
private File libCompileDirectory_;
|
||||
private File libCompileModulesDirectory_;
|
||||
private File libProvidedDirectory_;
|
||||
private File libProvidedModulesDirectory_;
|
||||
private File libRuntimeDirectory_;
|
||||
private File libRuntimeModulesDirectory_;
|
||||
private File libStandaloneDirectory_;
|
||||
private File libStandaloneModulesDirectory_;
|
||||
private File libTestDirectory_;
|
||||
private File libTestModulesDirectory_;
|
||||
private boolean preserveSources_ = false;
|
||||
private boolean preserveJavadoc_ = false;
|
||||
|
||||
|
@ -65,7 +70,7 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
* @since 1.5
|
||||
*/
|
||||
protected void executePurgeCompileDependencies() {
|
||||
executePurgeDependencies(libCompileDirectory(), dependencies().resolveCompileDependencies(properties(), artifactRetriever(), repositories()));
|
||||
executePurgeDependencies(libCompileDirectory(), libCompileModulesDirectory(), dependencies().resolveCompileDependencies(properties(), artifactRetriever(), repositories()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,7 +79,7 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
* @since 1.8
|
||||
*/
|
||||
protected void executePurgeProvidedDependencies() {
|
||||
executePurgeDependencies(libProvidedDirectory(), dependencies().resolveProvidedDependencies(properties(), artifactRetriever(), repositories()));
|
||||
executePurgeDependencies(libProvidedDirectory(), libProvidedModulesDirectory(), dependencies().resolveProvidedDependencies(properties(), artifactRetriever(), repositories()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -83,7 +88,7 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
* @since 1.5
|
||||
*/
|
||||
protected void executePurgeRuntimeDependencies() {
|
||||
executePurgeDependencies(libRuntimeDirectory(), dependencies().resolveRuntimeDependencies(properties(), artifactRetriever(), repositories()));
|
||||
executePurgeDependencies(libRuntimeDirectory(), libRuntimeModulesDirectory(), dependencies().resolveRuntimeDependencies(properties(), artifactRetriever(), repositories()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -92,7 +97,7 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
* @since 1.5
|
||||
*/
|
||||
protected void executePurgeStandaloneDependencies() {
|
||||
executePurgeDependencies(libStandaloneDirectory(), dependencies().resolveStandaloneDependencies(properties(), artifactRetriever(), repositories()));
|
||||
executePurgeDependencies(libStandaloneDirectory(), libStandaloneModulesDirectory(), dependencies().resolveStandaloneDependencies(properties(), artifactRetriever(), repositories()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,22 +106,29 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
* @since 1.5
|
||||
*/
|
||||
protected void executePurgeTestDependencies() {
|
||||
executePurgeDependencies(libTestDirectory(), dependencies().resolveTestDependencies(properties(), artifactRetriever(), repositories()));
|
||||
executePurgeDependencies(libTestDirectory(), libTestModulesDirectory(), dependencies().resolveTestDependencies(properties(), artifactRetriever(), repositories()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Part of the {@link #execute} operation, purge the artifacts for a particular dependency scope.
|
||||
*
|
||||
* @param destinationDirectory the directory from which the artifacts should be purged
|
||||
* @param dependencies the dependencies to purge
|
||||
* @since 1.6
|
||||
* @param classpathDirectory the directory from which the artifacts should be purged
|
||||
* @param modulesDirectory the directory from which the modules should be purged
|
||||
* @param dependencies the dependencies to purge
|
||||
* @since 2.1
|
||||
*/
|
||||
protected void executePurgeDependencies(File destinationDirectory, DependencySet dependencies) {
|
||||
if (destinationDirectory == null) {
|
||||
protected void executePurgeDependencies(File classpathDirectory, File modulesDirectory, DependencySet dependencies) {
|
||||
if (classpathDirectory == null && modulesDirectory == null) {
|
||||
return;
|
||||
}
|
||||
var filenames = new HashSet<String>();
|
||||
|
||||
var classpath_names = new HashSet<String>();
|
||||
var modules_names = new HashSet<String>();
|
||||
for (var dependency : dependencies) {
|
||||
var filenames = classpath_names;
|
||||
if (dependency.isModularJar()) {
|
||||
filenames = modules_names;
|
||||
}
|
||||
addTransferLocations(filenames, dependency);
|
||||
if (preserveSources_) {
|
||||
addTransferLocations(filenames, dependency.withClassifier(CLASSIFIER_SOURCES));
|
||||
|
@ -126,15 +138,27 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
}
|
||||
}
|
||||
|
||||
purgeFromDirectory(classpathDirectory, modulesDirectory, classpath_names);
|
||||
purgeFromDirectory(modulesDirectory, classpathDirectory, modules_names);
|
||||
}
|
||||
|
||||
private static void purgeFromDirectory(File directory, File preserveDirectory, HashSet<String> preservedFileNames) {
|
||||
if (directory == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean printed_header = false;
|
||||
for (var file : destinationDirectory.listFiles()) {
|
||||
if (!filenames.contains(file.getName())) {
|
||||
if (!printed_header) {
|
||||
printed_header = true;
|
||||
System.out.println("Deleting from " + destinationDirectory.getName() + ":");
|
||||
var classpath_files = directory.listFiles();
|
||||
if (classpath_files != null) {
|
||||
for (var file : classpath_files) {
|
||||
if (!preservedFileNames.contains(file.getName()) && !file.equals(preserveDirectory)) {
|
||||
if (!printed_header) {
|
||||
printed_header = true;
|
||||
System.out.println("Deleting from " + directory.getName() + ":");
|
||||
}
|
||||
System.out.println(" " + file.getName());
|
||||
file.delete();
|
||||
}
|
||||
System.out.println(" " + file.getName());
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -159,10 +183,15 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
.repositories(project.repositories())
|
||||
.dependencies(project.dependencies())
|
||||
.libCompileDirectory(project.libCompileDirectory())
|
||||
.libCompileModulesDirectory(project.libCompileModulesDirectory())
|
||||
.libProvidedDirectory(project.libProvidedDirectory())
|
||||
.libProvidedModulesDirectory(project.libProvidedModulesDirectory())
|
||||
.libRuntimeDirectory(project.libRuntimeDirectory())
|
||||
.libRuntimeModulesDirectory(project.libRuntimeModulesDirectory())
|
||||
.libStandaloneDirectory(project.libStandaloneDirectory())
|
||||
.libStandaloneModulesDirectory(project.libStandaloneModulesDirectory())
|
||||
.libTestDirectory(project.libTestDirectory())
|
||||
.libTestModulesDirectory(project.libTestModulesDirectory())
|
||||
.preserveSources(project.downloadSources())
|
||||
.preserveJavadoc(project.downloadJavadoc());
|
||||
}
|
||||
|
@ -267,6 +296,18 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code compile} scope modules purge directory.
|
||||
*
|
||||
* @param directory the directory to purge the {@code compile} scope modules from
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public PurgeOperation libCompileModulesDirectory(File directory) {
|
||||
libCompileModulesDirectory_ = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code provided} scope purge directory.
|
||||
*
|
||||
|
@ -279,6 +320,18 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code provided} scope modules purge directory.
|
||||
*
|
||||
* @param directory the directory to purge the {@code provided} scope modules from
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public PurgeOperation libProvidedModulesDirectory(File directory) {
|
||||
libProvidedModulesDirectory_ = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code runtime} scope purge directory.
|
||||
*
|
||||
|
@ -291,6 +344,18 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code runtime} scope modules purge directory.
|
||||
*
|
||||
* @param directory the directory to purge the {@code runtime} scope modules from
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public PurgeOperation libRuntimeModulesDirectory(File directory) {
|
||||
libRuntimeModulesDirectory_ = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code standalone} scope purge directory.
|
||||
*
|
||||
|
@ -303,6 +368,18 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code standalone} scope modules purge directory.
|
||||
*
|
||||
* @param directory the directory to purge the {@code standalone} scope modules from
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public PurgeOperation libStandaloneModulesDirectory(File directory) {
|
||||
libStandaloneModulesDirectory_ = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code test} scope purge directory.
|
||||
*
|
||||
|
@ -315,6 +392,18 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the {@code test} scope modules purge directory.
|
||||
*
|
||||
* @param directory the directory to purge the {@code test} scope modules from
|
||||
* @return this operation instance
|
||||
* @since 2.1
|
||||
*/
|
||||
public PurgeOperation libTestModulesDirectory(File directory) {
|
||||
libTestModulesDirectory_ = directory;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides the artifact retriever to use.
|
||||
*
|
||||
|
@ -373,6 +462,16 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
return libCompileDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code compile} scope modules purge directory.
|
||||
*
|
||||
* @return the {@code compile} scope modules purge directory
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libCompileModulesDirectory() {
|
||||
return libCompileModulesDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code provided} scope purge directory.
|
||||
*
|
||||
|
@ -383,6 +482,16 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
return libProvidedDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code provided} scope modules purge directory.
|
||||
*
|
||||
* @return the {@code provided} scope modules purge directory
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libProvidedModulesDirectory() {
|
||||
return libProvidedModulesDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code runtime} scope purge directory.
|
||||
*
|
||||
|
@ -393,6 +502,16 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
return libRuntimeDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code runtime} scope modules purge directory.
|
||||
*
|
||||
* @return the {@code runtime} scope modules purge directory
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libRuntimeModulesDirectory() {
|
||||
return libRuntimeModulesDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code standalone} scope purge directory.
|
||||
*
|
||||
|
@ -403,6 +522,16 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
return libStandaloneDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code standalone} scope modules purge directory.
|
||||
*
|
||||
* @return the {@code standalone} scope modules purge directory
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libStandaloneModulesDirectory() {
|
||||
return libStandaloneModulesDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code test} scope purge directory.
|
||||
*
|
||||
|
@ -413,6 +542,16 @@ public class PurgeOperation extends AbstractOperation<PurgeOperation> {
|
|||
return libTestDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the {@code test} scope modules purge directory.
|
||||
*
|
||||
* @return the {@code test} scope modules purge directory
|
||||
* @since 2.1
|
||||
*/
|
||||
public File libTestModulesDirectory() {
|
||||
return libTestModulesDirectory_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves whether the sources classifier files should be preserved.
|
||||
*
|
||||
|
|
|
@ -35,6 +35,10 @@ public class RunOperation extends AbstractProcessOperation<RunOperation> {
|
|||
args.add("-cp");
|
||||
args.add(FileUtils.joinPaths(classpath()));
|
||||
}
|
||||
if (!modulePath().isEmpty()) {
|
||||
args.add("-p");
|
||||
args.add(FileUtils.joinPaths(modulePath()));
|
||||
}
|
||||
args.add(mainClass());
|
||||
args.addAll(runOptions());
|
||||
return args;
|
||||
|
@ -50,6 +54,7 @@ public class RunOperation extends AbstractProcessOperation<RunOperation> {
|
|||
var operation = workDirectory(project.workDirectory())
|
||||
.javaTool(project.javaTool())
|
||||
.classpath(project.runClasspath())
|
||||
.modulePath(project.runModulePath())
|
||||
.mainClass(project.mainClass());
|
||||
if (project.usesRife2Agent()) {
|
||||
operation.javaOptions().javaAgent(project.getRife2AgentFile());
|
||||
|
|
|
@ -51,8 +51,14 @@ public class TestOperation<T extends TestOperation<T, O>, O extends List<String>
|
|||
var args = new ArrayList<String>();
|
||||
args.add(javaTool());
|
||||
args.addAll(javaOptions());
|
||||
args.add("-cp");
|
||||
args.add(FileUtils.joinPaths(classpath()));
|
||||
if (!classpath().isEmpty()) {
|
||||
args.add("-cp");
|
||||
args.add(FileUtils.joinPaths(classpath()));
|
||||
}
|
||||
if (!modulePath().isEmpty()) {
|
||||
args.add("-p");
|
||||
args.add(FileUtils.joinPaths(modulePath()));
|
||||
}
|
||||
args.add(mainClass());
|
||||
args.addAll(testToolOptions());
|
||||
|
||||
|
@ -68,7 +74,8 @@ public class TestOperation<T extends TestOperation<T, O>, O extends List<String>
|
|||
public T fromProject(BaseProject project) {
|
||||
var operation = workDirectory(project.workDirectory())
|
||||
.javaTool(project.javaTool())
|
||||
.classpath(project.testClasspath());
|
||||
.classpath(project.testClasspath())
|
||||
.modulePath(project.testModulePath());
|
||||
if (project.usesRife2Agent()) {
|
||||
operation.javaOptions().javaAgent(project.getRife2AgentFile());
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ import rife.tools.exceptions.FileUtilsErrorException;
|
|||
import java.io.File;
|
||||
import java.util.Objects;
|
||||
|
||||
import static rife.bld.dependencies.Dependency.TYPE_JAR;
|
||||
|
||||
/**
|
||||
* Provides the functionalities to build a Maven POM xml file.
|
||||
*
|
||||
|
@ -186,7 +188,7 @@ public class PomBuilder {
|
|||
|
||||
t.blankValue("dependency-type");
|
||||
t.blankValue("dependency-type-tag");
|
||||
if (!"jar".equals(dependency.type())) {
|
||||
if (!TYPE_JAR.equals(dependency.type())) {
|
||||
t.setValueEncoded("dependency-type", dependency.type());
|
||||
t.setBlock("dependency-type-tag");
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ package rife.bld.publish;
|
|||
|
||||
import java.io.File;
|
||||
|
||||
import static rife.bld.dependencies.Dependency.TYPE_JAR;
|
||||
|
||||
/**
|
||||
* Contains the information about an artifact that will be published.
|
||||
*
|
||||
|
@ -19,6 +21,6 @@ public record PublishArtifact(File file, String classifier, String type) {
|
|||
public PublishArtifact(File file, String classifier, String type) {
|
||||
this.file = file;
|
||||
this.classifier = (classifier == null ? "" : classifier);
|
||||
this.type = (type == null ? "jar" : type);
|
||||
this.type = (type == null ? TYPE_JAR : type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ public class WrapperExtensionResolver {
|
|||
additional_classifiers = classifiers.toArray(new String[0]);
|
||||
}
|
||||
|
||||
var artifacts = dependencies.transferIntoDirectory(resolution_, retriever_, repositories_, destinationDirectory_, additional_classifiers);
|
||||
var artifacts = dependencies.transferIntoDirectory(resolution_, retriever_, repositories_, destinationDirectory_, destinationDirectory_, additional_classifiers);
|
||||
for (var artifact : artifacts) {
|
||||
var location = artifact.location();
|
||||
|
||||
|
|
|
@ -114,6 +114,11 @@ public class TestProject {
|
|||
assertNotNull(project.compileTestClasspath());
|
||||
assertNotNull(project.runClasspath());
|
||||
assertNotNull(project.testClasspath());
|
||||
|
||||
assertNotNull(project.compileMainModulePath());
|
||||
assertNotNull(project.compileTestModulePath());
|
||||
assertNotNull(project.runModulePath());
|
||||
assertNotNull(project.testModulePath());
|
||||
}
|
||||
|
||||
static class CustomProject extends Project {
|
||||
|
@ -321,10 +326,6 @@ public class TestProject {
|
|||
.include(dependency("org.jsoup", "jsoup", version(1, 15, 4)))
|
||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 9, 2)))
|
||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 9, 2)));
|
||||
scope(standalone)
|
||||
.include(dependency("org.eclipse.jetty", "jetty-server", version(11, 0, 14)))
|
||||
.include(dependency("org.eclipse.jetty", "jetty-servlet", version(11, 0, 14)))
|
||||
.include(dependency("org.slf4j", "slf4j-simple", version(2, 0, 7)));
|
||||
}
|
||||
|
||||
public void enableAutoDownloadPurge() {
|
||||
|
@ -364,8 +365,6 @@ public class TestProject {
|
|||
/lib/bld/bld.cache
|
||||
/lib/compile
|
||||
/lib/compile/rife2-1.5.11.jar
|
||||
/lib/provided
|
||||
/lib/runtime
|
||||
/lib/test
|
||||
/lib/test/apiguardian-api-1.1.2.jar
|
||||
/lib/test/jsoup-1.15.4.jar
|
||||
|
@ -379,8 +378,6 @@ public class TestProject {
|
|||
/lib/test/opentest4j-1.2.0.jar""", FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
FileUtils.deleteDirectory(new File(tmp, "lib/compile"));
|
||||
FileUtils.deleteDirectory(new File(tmp, "lib/provided"));
|
||||
FileUtils.deleteDirectory(new File(tmp, "lib/runtime"));
|
||||
FileUtils.deleteDirectory(new File(tmp, "lib/test"));
|
||||
assertEquals("""
|
||||
/lib
|
||||
|
@ -405,8 +402,6 @@ public class TestProject {
|
|||
/lib/bld/bld.cache
|
||||
/lib/compile
|
||||
/lib/compile/rife2-1.5.12.jar
|
||||
/lib/provided
|
||||
/lib/runtime
|
||||
/lib/test
|
||||
/lib/test/apiguardian-api-1.1.2.jar
|
||||
/lib/test/jsoup-1.15.4.jar
|
||||
|
@ -429,8 +424,6 @@ public class TestProject {
|
|||
/lib/bld/bld.cache
|
||||
/lib/compile
|
||||
/lib/compile/rife2-1.5.15.jar
|
||||
/lib/provided
|
||||
/lib/runtime
|
||||
/lib/test
|
||||
/lib/test/apiguardian-api-1.1.2.jar
|
||||
/lib/test/jsoup-1.15.4.jar
|
||||
|
|
|
@ -8,9 +8,14 @@ import org.junit.jupiter.api.Test;
|
|||
import rife.bld.dependencies.VersionNumber;
|
||||
import rife.tools.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
|
||||
import static rife.bld.dependencies.Scope.*;
|
||||
import static rife.bld.dependencies.Scope.compile;
|
||||
|
||||
public class TestWebProject {
|
||||
@Test
|
||||
|
@ -149,4 +154,167 @@ public class TestWebProject {
|
|||
FileUtils.deleteDirectory(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
static class CustomWebProjectAutoPurge extends WebProject {
|
||||
CustomWebProjectAutoPurge(File tmp) {
|
||||
workDirectory = tmp;
|
||||
pkg = "test.pkg";
|
||||
name = "my_project";
|
||||
version = new VersionNumber(0, 0, 1);
|
||||
|
||||
repositories = List.of(MAVEN_CENTRAL);
|
||||
scope(compile)
|
||||
.include(dependency("com.uwyn.rife2", "rife2", version(1, 5, 11)));
|
||||
scope(test)
|
||||
.include(dependency("org.jsoup", "jsoup", version(1, 15, 4)))
|
||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 9, 2)))
|
||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 9, 2)));
|
||||
scope(standalone)
|
||||
.include(dependency("org.eclipse.jetty", "jetty-server", version(11, 0, 14)))
|
||||
.include(dependency("org.eclipse.jetty", "jetty-servlet", version(11, 0, 14)))
|
||||
.include(dependency("org.slf4j", "slf4j-simple", version(2, 0, 7)));
|
||||
}
|
||||
|
||||
public void enableAutoDownloadPurge() {
|
||||
autoDownloadPurge = true;
|
||||
}
|
||||
|
||||
public void increaseRife2Version() {
|
||||
scope(compile).clear();
|
||||
scope(compile)
|
||||
.include(dependency("com.uwyn.rife2", "rife2", version(1, 5, 12)));
|
||||
}
|
||||
|
||||
public void increaseRife2VersionMore() {
|
||||
scope(compile).clear();
|
||||
scope(compile)
|
||||
.include(dependency("com.uwyn.rife2", "rife2", version(1, 5, 15)));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAutoDownloadPurge()
|
||||
throws Exception {
|
||||
var tmp = Files.createTempDirectory("test").toFile();
|
||||
try {
|
||||
var project = new CustomWebProjectAutoPurge(tmp);
|
||||
project.execute(new String[]{"version"});
|
||||
|
||||
assertEquals("", FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
project = new CustomWebProjectAutoPurge(tmp);
|
||||
project.enableAutoDownloadPurge();
|
||||
project.execute(new String[]{"version"});
|
||||
|
||||
assertEquals("""
|
||||
/lib
|
||||
/lib/bld
|
||||
/lib/bld/bld.cache
|
||||
/lib/compile
|
||||
/lib/compile/rife2-1.5.11.jar
|
||||
/lib/standalone
|
||||
/lib/standalone/jetty-http-11.0.14.jar
|
||||
/lib/standalone/jetty-io-11.0.14.jar
|
||||
/lib/standalone/jetty-jakarta-servlet-api-5.0.2.jar
|
||||
/lib/standalone/jetty-security-11.0.14.jar
|
||||
/lib/standalone/jetty-server-11.0.14.jar
|
||||
/lib/standalone/jetty-servlet-11.0.14.jar
|
||||
/lib/standalone/jetty-util-11.0.14.jar
|
||||
/lib/standalone/slf4j-api-2.0.7.jar
|
||||
/lib/standalone/slf4j-simple-2.0.7.jar
|
||||
/lib/test
|
||||
/lib/test/apiguardian-api-1.1.2.jar
|
||||
/lib/test/jsoup-1.15.4.jar
|
||||
/lib/test/junit-jupiter-5.9.2.jar
|
||||
/lib/test/junit-jupiter-api-5.9.2.jar
|
||||
/lib/test/junit-jupiter-engine-5.9.2.jar
|
||||
/lib/test/junit-jupiter-params-5.9.2.jar
|
||||
/lib/test/junit-platform-commons-1.9.2.jar
|
||||
/lib/test/junit-platform-console-standalone-1.9.2.jar
|
||||
/lib/test/junit-platform-engine-1.9.2.jar
|
||||
/lib/test/opentest4j-1.2.0.jar""", FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
FileUtils.deleteDirectory(new File(tmp, "lib/compile"));
|
||||
FileUtils.deleteDirectory(new File(tmp, "lib/standalone"));
|
||||
FileUtils.deleteDirectory(new File(tmp, "lib/test"));
|
||||
assertEquals("""
|
||||
/lib
|
||||
/lib/bld
|
||||
/lib/bld/bld.cache""", FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
project = new CustomWebProjectAutoPurge(tmp);
|
||||
project.enableAutoDownloadPurge();
|
||||
project.execute(new String[]{"version"});
|
||||
assertEquals("""
|
||||
/lib
|
||||
/lib/bld
|
||||
/lib/bld/bld.cache""", FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
project = new CustomWebProjectAutoPurge(tmp);
|
||||
project.enableAutoDownloadPurge();
|
||||
project.increaseRife2Version();
|
||||
project.execute(new String[]{"version"});
|
||||
assertEquals("""
|
||||
/lib
|
||||
/lib/bld
|
||||
/lib/bld/bld.cache
|
||||
/lib/compile
|
||||
/lib/compile/rife2-1.5.12.jar
|
||||
/lib/standalone
|
||||
/lib/standalone/jetty-http-11.0.14.jar
|
||||
/lib/standalone/jetty-io-11.0.14.jar
|
||||
/lib/standalone/jetty-jakarta-servlet-api-5.0.2.jar
|
||||
/lib/standalone/jetty-security-11.0.14.jar
|
||||
/lib/standalone/jetty-server-11.0.14.jar
|
||||
/lib/standalone/jetty-servlet-11.0.14.jar
|
||||
/lib/standalone/jetty-util-11.0.14.jar
|
||||
/lib/standalone/slf4j-api-2.0.7.jar
|
||||
/lib/standalone/slf4j-simple-2.0.7.jar
|
||||
/lib/test
|
||||
/lib/test/apiguardian-api-1.1.2.jar
|
||||
/lib/test/jsoup-1.15.4.jar
|
||||
/lib/test/junit-jupiter-5.9.2.jar
|
||||
/lib/test/junit-jupiter-api-5.9.2.jar
|
||||
/lib/test/junit-jupiter-engine-5.9.2.jar
|
||||
/lib/test/junit-jupiter-params-5.9.2.jar
|
||||
/lib/test/junit-platform-commons-1.9.2.jar
|
||||
/lib/test/junit-platform-console-standalone-1.9.2.jar
|
||||
/lib/test/junit-platform-engine-1.9.2.jar
|
||||
/lib/test/opentest4j-1.2.0.jar""", FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
project = new CustomWebProjectAutoPurge(tmp);
|
||||
project.enableAutoDownloadPurge();
|
||||
project.increaseRife2VersionMore();
|
||||
project.execute(new String[]{"version"});
|
||||
assertEquals("""
|
||||
/lib
|
||||
/lib/bld
|
||||
/lib/bld/bld.cache
|
||||
/lib/compile
|
||||
/lib/compile/rife2-1.5.15.jar
|
||||
/lib/standalone
|
||||
/lib/standalone/jetty-http-11.0.14.jar
|
||||
/lib/standalone/jetty-io-11.0.14.jar
|
||||
/lib/standalone/jetty-jakarta-servlet-api-5.0.2.jar
|
||||
/lib/standalone/jetty-security-11.0.14.jar
|
||||
/lib/standalone/jetty-server-11.0.14.jar
|
||||
/lib/standalone/jetty-servlet-11.0.14.jar
|
||||
/lib/standalone/jetty-util-11.0.14.jar
|
||||
/lib/standalone/slf4j-api-2.0.7.jar
|
||||
/lib/standalone/slf4j-simple-2.0.7.jar
|
||||
/lib/test
|
||||
/lib/test/apiguardian-api-1.1.2.jar
|
||||
/lib/test/jsoup-1.15.4.jar
|
||||
/lib/test/junit-jupiter-5.9.2.jar
|
||||
/lib/test/junit-jupiter-api-5.9.2.jar
|
||||
/lib/test/junit-jupiter-engine-5.9.2.jar
|
||||
/lib/test/junit-jupiter-params-5.9.2.jar
|
||||
/lib/test/junit-platform-commons-1.9.2.jar
|
||||
/lib/test/junit-platform-console-standalone-1.9.2.jar
|
||||
/lib/test/junit-platform-engine-1.9.2.jar
|
||||
/lib/test/opentest4j-1.2.0.jar""", FileUtils.generateDirectoryListing(tmp));
|
||||
} finally {
|
||||
FileUtils.deleteDirectory(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ public class TestDependency {
|
|||
assertEquals(VersionNumber.UNKNOWN, dependency1.version());
|
||||
assertEquals("", dependency1.classifier());
|
||||
assertEquals("jar", dependency1.type());
|
||||
assertFalse(dependency1.isModularJar());
|
||||
assertFalse(dependency1.isClasspathJar());
|
||||
|
||||
var dependency2 = new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0));
|
||||
assertNotNull(dependency2);
|
||||
|
@ -26,6 +28,8 @@ public class TestDependency {
|
|||
assertEquals(new VersionNumber(1, 4, 0), dependency2.version());
|
||||
assertEquals("", dependency2.classifier());
|
||||
assertEquals("jar", dependency2.type());
|
||||
assertFalse(dependency2.isModularJar());
|
||||
assertFalse(dependency2.isClasspathJar());
|
||||
|
||||
var dependency3 = new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0), "agent");
|
||||
assertNotNull(dependency3);
|
||||
|
@ -34,6 +38,8 @@ public class TestDependency {
|
|||
assertEquals(new VersionNumber(1, 4, 0), dependency3.version());
|
||||
assertEquals("agent", dependency3.classifier());
|
||||
assertEquals("jar", dependency3.type());
|
||||
assertFalse(dependency3.isModularJar());
|
||||
assertFalse(dependency3.isClasspathJar());
|
||||
|
||||
var dependency4 = new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0), "bld", "zip");
|
||||
assertNotNull(dependency4);
|
||||
|
@ -42,6 +48,65 @@ public class TestDependency {
|
|||
assertEquals(new VersionNumber(1, 4, 0), dependency4.version());
|
||||
assertEquals("bld", dependency4.classifier());
|
||||
assertEquals("zip", dependency4.type());
|
||||
assertFalse(dependency4.isModularJar());
|
||||
assertFalse(dependency4.isClasspathJar());
|
||||
|
||||
var dependency5 = new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0), null, "modular-jar");
|
||||
assertNotNull(dependency5);
|
||||
assertEquals("com.uwyn.rife2", dependency5.groupId());
|
||||
assertEquals("rife2", dependency5.artifactId());
|
||||
assertEquals(new VersionNumber(1, 4, 0), dependency5.version());
|
||||
assertEquals("", dependency5.classifier());
|
||||
assertEquals("modular-jar", dependency5.type());
|
||||
assertTrue(dependency5.isModularJar());
|
||||
assertFalse(dependency5.isClasspathJar());
|
||||
|
||||
var dependency6 = new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0), null, "classpath-jar");
|
||||
assertNotNull(dependency6);
|
||||
assertEquals("com.uwyn.rife2", dependency6.groupId());
|
||||
assertEquals("rife2", dependency6.artifactId());
|
||||
assertEquals(new VersionNumber(1, 4, 0), dependency6.version());
|
||||
assertEquals("", dependency6.classifier());
|
||||
assertEquals("classpath-jar", dependency6.type());
|
||||
assertFalse(dependency6.isModularJar());
|
||||
assertTrue(dependency6.isClasspathJar());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testParent() {
|
||||
var parent1 = new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0));
|
||||
var parent2 = new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0), null, "modular-jar");
|
||||
var parent3 = new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0), null, "classpath-jar");
|
||||
|
||||
var child1a = new Dependency("com.uwyn.rife2", "bld", new VersionNumber(1, 5, 0), null, null, null, parent1);
|
||||
assertFalse(child1a.isModularJar());
|
||||
assertFalse(child1a.isClasspathJar());
|
||||
var child1b = new Dependency("com.uwyn.rife2", "bld", new VersionNumber(1, 5, 0), null, null, null, parent2);
|
||||
assertTrue(child1b.isModularJar());
|
||||
assertFalse(child1b.isClasspathJar());
|
||||
var child1c = new Dependency("com.uwyn.rife2", "bld", new VersionNumber(1, 5, 0), null, null, null, parent3);
|
||||
assertFalse(child1c.isModularJar());
|
||||
assertFalse(child1c.isClasspathJar());
|
||||
|
||||
var child2a = new Dependency("com.uwyn.rife2", "bld", new VersionNumber(1, 5, 0), null, "modular-jar", null, parent1);
|
||||
assertTrue(child2a.isModularJar());
|
||||
assertFalse(child2a.isClasspathJar());
|
||||
var child2b = new Dependency("com.uwyn.rife2", "bld", new VersionNumber(1, 5, 0), null, "modular-jar", null, parent2);
|
||||
assertTrue(child2b.isModularJar());
|
||||
assertFalse(child2b.isClasspathJar());
|
||||
var child2c = new Dependency("com.uwyn.rife2", "bld", new VersionNumber(1, 5, 0), null, "modular-jar", null, parent3);
|
||||
assertTrue(child2c.isModularJar());
|
||||
assertFalse(child2c.isClasspathJar());
|
||||
|
||||
var child3a = new Dependency("com.uwyn.rife2", "bld", new VersionNumber(1, 5, 0), null, "classpath-jar", null, parent1);
|
||||
assertFalse(child3a.isModularJar());
|
||||
assertTrue(child3a.isClasspathJar());
|
||||
var child3b = new Dependency("com.uwyn.rife2", "bld", new VersionNumber(1, 5, 0), null, "classpath-jar", null, parent2);
|
||||
assertFalse(child3b.isModularJar());
|
||||
assertTrue(child3b.isClasspathJar());
|
||||
var child3c = new Dependency("com.uwyn.rife2", "bld", new VersionNumber(1, 5, 0), null, "classpath-jar", null, parent3);
|
||||
assertFalse(child3c.isModularJar());
|
||||
assertTrue(child3c.isClasspathJar());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -99,7 +164,7 @@ public class TestDependency {
|
|||
}
|
||||
|
||||
@Test
|
||||
void testToParse() {
|
||||
void testParse() {
|
||||
assertEquals("com.uwyn.rife2:rife2", Dependency.parse("com.uwyn.rife2:rife2").toString());
|
||||
assertEquals("com.uwyn.rife2:rife2:1.4.0", Dependency.parse("com.uwyn.rife2:rife2:1.4.0").toString());
|
||||
assertEquals("com.uwyn.rife2:rife2:1.4.0:agent", Dependency.parse("com.uwyn.rife2:rife2:1.4.0:agent").toString());
|
||||
|
@ -114,4 +179,102 @@ public class TestDependency {
|
|||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", null, null, "zip").toString(), Dependency.parse("com.uwyn.rife2:rife2@zip").toString());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0), null, "zip").toString(), Dependency.parse("com.uwyn.rife2:rife2:1.4.0@zip").toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEquals() {
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2"), new Dependency("com.uwyn.rife2", "rife2"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2"), new Dependency("com.uwyn.rife2", "rife1"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2"), new Dependency("com.uwyn.rife1", "rife2"));
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1)));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)), new Dependency("com.uwyn.rife2", "rife2", null));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0)));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0)));
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1)));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", null));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0)));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0)));
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), null, "jar"));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", null, null, "jar"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), null, "jar"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), null, "jar"));
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "modular-jar"));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), null, "modular-jar"));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", null, null, "modular-jar"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), null, "modular-jar"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), null, "modular-jar"));
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "classpath-jar"));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), null, "classpath-jar"));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", null, null, "classpath-jar"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), null, "classpath-jar"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), null, "classpath-jar"));
|
||||
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "zip"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), null, "zip"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", null, null, "zip"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), null, "zip"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), null, "zip"));
|
||||
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), "agent", "jar"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), "agent", "jar"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife2", null, "agent", "jar"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), "agent", "jar"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), "agent", "jar"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testHashcode() {
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2").hashCode(), new Dependency("com.uwyn.rife2", "rife2").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2").hashCode(), new Dependency("com.uwyn.rife2", "rife1").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2").hashCode(), new Dependency("com.uwyn.rife1", "rife2").hashCode());
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1)).hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode(), new Dependency("com.uwyn.rife2", "rife2", null).hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode(), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0)).hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode(), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0)).hashCode());
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1)).hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", null).hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0)).hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0)).hashCode());
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), null, "jar").hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", null, null, "jar").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), null, "jar").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode());
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "modular-jar").hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), null, "modular-jar").hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", null, null, "modular-jar").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), null, "modular-jar").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), null, "modular-jar").hashCode());
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "classpath-jar").hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), null, "classpath-jar").hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", null, null, "classpath-jar").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), null, "classpath-jar").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), null, "classpath-jar").hashCode());
|
||||
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "zip").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), null, "zip").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", null, null, "zip").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), null, "zip").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), null, "zip").hashCode());
|
||||
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), "agent", "jar").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), "agent", "jar").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife2", null, "agent", "jar").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), "agent", "jar").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Dependency("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), "agent", "jar").hashCode());
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
111
src/test/java/rife/bld/dependencies/TestModule.java
Normal file
111
src/test/java/rife/bld/dependencies/TestModule.java
Normal file
|
@ -0,0 +1,111 @@
|
|||
/*
|
||||
* Copyright 2001-2023 Geert Bevin (gbevin[remove] at uwyn dot com)
|
||||
* Licensed under the Apache License, Version 2.0 (the "License")
|
||||
*/
|
||||
package rife.bld.dependencies;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
public class TestModule {
|
||||
@Test
|
||||
void testModule() {
|
||||
var module1 = new Module("com.uwyn.rife2", "rife2");
|
||||
assertNotNull(module1);
|
||||
assertEquals("com.uwyn.rife2", module1.groupId());
|
||||
assertEquals("rife2", module1.artifactId());
|
||||
assertEquals(VersionNumber.UNKNOWN, module1.version());
|
||||
assertEquals("", module1.classifier());
|
||||
assertEquals("modular-jar", module1.type());
|
||||
assertTrue(module1.isModularJar());
|
||||
assertFalse(module1.isClasspathJar());
|
||||
|
||||
var module2 = new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0));
|
||||
assertNotNull(module2);
|
||||
assertEquals("com.uwyn.rife2", module2.groupId());
|
||||
assertEquals("rife2", module2.artifactId());
|
||||
assertEquals(new VersionNumber(1, 4, 0), module2.version());
|
||||
assertEquals("", module2.classifier());
|
||||
assertEquals("modular-jar", module2.type());
|
||||
assertTrue(module2.isModularJar());
|
||||
assertFalse(module2.isClasspathJar());
|
||||
|
||||
var module3 = new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0), "agent");
|
||||
assertNotNull(module3);
|
||||
assertEquals("com.uwyn.rife2", module3.groupId());
|
||||
assertEquals("rife2", module3.artifactId());
|
||||
assertEquals(new VersionNumber(1, 4, 0), module3.version());
|
||||
assertEquals("agent", module3.classifier());
|
||||
assertEquals("modular-jar", module3.type());
|
||||
assertTrue(module3.isModularJar());
|
||||
assertFalse(module3.isClasspathJar());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testParse() {
|
||||
assertEquals("com.uwyn.rife2:rife2@modular-jar", Module.parse("com.uwyn.rife2:rife2").toString());
|
||||
assertEquals("com.uwyn.rife2:rife2:1.4.0@modular-jar", Module.parse("com.uwyn.rife2:rife2:1.4.0").toString());
|
||||
assertEquals("com.uwyn.rife2:rife2:1.4.0:agent@modular-jar", Module.parse("com.uwyn.rife2:rife2:1.4.0:agent").toString());
|
||||
assertEquals("com.uwyn.rife2:rife2@modular-jar", Module.parse("com.uwyn.rife2:rife2@modular-jar").toString());
|
||||
assertEquals("com.uwyn.rife2:rife2:1.4.0@modular-jar", Module.parse("com.uwyn.rife2:rife2:1.4.0@modular-jar").toString());
|
||||
assertEquals("com.uwyn.rife2:rife2:1.4.0:agent@modular-jar", Module.parse("com.uwyn.rife2:rife2:1.4.0:agent@modular-jar").toString());
|
||||
|
||||
assertEquals(new Module("com.uwyn.rife2", "rife2").toString(), Module.parse("com.uwyn.rife2:rife2").toString());
|
||||
assertEquals(new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)).toString(), Module.parse("com.uwyn.rife2:rife2:1.4.0").toString());
|
||||
assertEquals(new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0), "agent").toString(), Module.parse("com.uwyn.rife2:rife2:1.4.0:agent").toString());
|
||||
assertEquals(new Module("com.uwyn.rife2", "rife2").toString(), Module.parse("com.uwyn.rife2:rife2@modular-jar").toString());
|
||||
assertEquals(new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0)).toString(), Module.parse("com.uwyn.rife2:rife2:1.4.0@modular-jar").toString());
|
||||
assertEquals(new Module("com.uwyn.rife2", "rife2", new VersionNumber(1, 4, 0), "agent").toString(), Module.parse("com.uwyn.rife2:rife2:1.4.0:agent@modular-jar").toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testEquals() {
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2"), new Module("com.uwyn.rife2", "rife2"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2"), new Module("com.uwyn.rife2", "rife1"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2"), new Module("com.uwyn.rife1", "rife2"));
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1)));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)), new Module("com.uwyn.rife2", "rife2", null));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)), new Module("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0)));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)), new Module("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0)));
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1)));
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Module("com.uwyn.rife2", "rife2", null));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Module("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0)));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Module("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0)));
|
||||
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), "agent"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), "agent"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Module("com.uwyn.rife2", "rife2", null, "agent"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Module("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), "agent"));
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar"), new Module("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), "agent"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testHashcode() {
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2").hashCode(), new Module("com.uwyn.rife2", "rife2").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2").hashCode(), new Module("com.uwyn.rife2", "rife1").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2").hashCode(), new Module("com.uwyn.rife1", "rife2").hashCode());
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode(), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode(), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1)).hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode(), new Module("com.uwyn.rife2", "rife2", null).hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode(), new Module("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0)).hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode(), new Module("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0)).hashCode());
|
||||
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0)).hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1)).hashCode());
|
||||
assertEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Module("com.uwyn.rife2", "rife2", null).hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Module("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0)).hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Module("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0)).hashCode());
|
||||
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), "agent").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Module("com.uwyn.rife2", "rife2", new VersionNumber(1,4,1), "agent").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Module("com.uwyn.rife2", "rife2", null, "agent").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Module("com.uwyn.rife2", "rife1", new VersionNumber(1,4,0), "agent").hashCode());
|
||||
assertNotEquals(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,4,0), null, "jar").hashCode(), new Module("com.uwyn.rife1", "rife2", new VersionNumber(1,4,0), "agent").hashCode());
|
||||
}
|
||||
}
|
|
@ -116,10 +116,15 @@ public class TestCleanOperation {
|
|||
/lib
|
||||
/lib/bld
|
||||
/lib/compile
|
||||
/lib/compile/modules
|
||||
/lib/provided
|
||||
/lib/provided/modules
|
||||
/lib/runtime
|
||||
/lib/runtime/modules
|
||||
/lib/standalone
|
||||
/lib/standalone/modules
|
||||
/lib/test
|
||||
/lib/test/modules
|
||||
/src
|
||||
/src/bld
|
||||
/src/bld/java
|
||||
|
@ -140,10 +145,15 @@ public class TestCleanOperation {
|
|||
/lib
|
||||
/lib/bld
|
||||
/lib/compile
|
||||
/lib/compile/modules
|
||||
/lib/provided
|
||||
/lib/provided/modules
|
||||
/lib/runtime
|
||||
/lib/runtime/modules
|
||||
/lib/standalone
|
||||
/lib/standalone/modules
|
||||
/lib/test
|
||||
/lib/test/modules
|
||||
/src
|
||||
/src/bld
|
||||
/src/bld/java
|
||||
|
|
|
@ -95,8 +95,11 @@ public class TestCreateAppOperation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/test
|
||||
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
|
||||
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar
|
||||
|
@ -114,6 +117,7 @@ public class TestCreateAppOperation {
|
|||
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3-sources\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/modules
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar
|
||||
/myapp/src
|
||||
|
@ -175,8 +179,11 @@ public class TestCreateAppOperation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/test
|
||||
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
|
||||
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar
|
||||
|
@ -194,6 +201,7 @@ public class TestCreateAppOperation {
|
|||
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3-sources\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/modules
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar
|
||||
/myapp/src
|
||||
|
@ -268,9 +276,13 @@ public class TestCreateAppOperation {
|
|||
/yourthing/lib/bld/bld-wrapper.jar
|
||||
/yourthing/lib/bld/bld-wrapper.properties
|
||||
/yourthing/lib/compile
|
||||
/yourthing/lib/compile/modules
|
||||
/yourthing/lib/provided
|
||||
/yourthing/lib/provided/modules
|
||||
/yourthing/lib/runtime
|
||||
/yourthing/lib/runtime/modules
|
||||
/yourthing/lib/test
|
||||
/yourthing/lib/test/modules
|
||||
/yourthing/src
|
||||
/yourthing/src/bld
|
||||
/yourthing/src/bld/java
|
||||
|
@ -374,6 +386,7 @@ public class TestCreateAppOperation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/local
|
||||
/myapp/lib/local/apiguardian-api-1\\.1\\.2-sources\\.jar
|
||||
/myapp/lib/local/apiguardian-api-1\\.1\\.2\\.jar
|
||||
|
@ -394,8 +407,11 @@ public class TestCreateAppOperation {
|
|||
/myapp/lib/local/opentest4j-1\\.3\\.0-sources\\.jar
|
||||
/myapp/lib/local/opentest4j-1\\.3\\.0\\.jar
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/test
|
||||
/myapp/lib/test/modules
|
||||
/myapp/src
|
||||
/myapp/src/bld
|
||||
/myapp/src/bld/java
|
||||
|
@ -495,6 +511,7 @@ public class TestCreateAppOperation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/local_compile
|
||||
/myapp/lib/local_test
|
||||
/myapp/lib/local_test/apiguardian-api-1\\.1\\.2-sources\\.jar
|
||||
|
@ -516,8 +533,11 @@ public class TestCreateAppOperation {
|
|||
/myapp/lib/local_test/opentest4j-1\\.3\\.0-sources\\.jar
|
||||
/myapp/lib/local_test/opentest4j-1\\.3\\.0\\.jar
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/test
|
||||
/myapp/lib/test/modules
|
||||
/myapp/src
|
||||
/myapp/src/bld
|
||||
/myapp/src/bld/java
|
||||
|
|
|
@ -88,9 +88,13 @@ public class TestCreateBaseOperation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/test
|
||||
/myapp/lib/test/modules
|
||||
/myapp/src
|
||||
/myapp/src/bld
|
||||
/myapp/src/bld/java
|
||||
|
@ -150,9 +154,13 @@ public class TestCreateBaseOperation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/test
|
||||
/myapp/lib/test/modules
|
||||
/myapp/src
|
||||
/myapp/src/bld
|
||||
/myapp/src/bld/java
|
||||
|
@ -225,9 +233,13 @@ public class TestCreateBaseOperation {
|
|||
/yourthing/lib/bld/bld-wrapper.jar
|
||||
/yourthing/lib/bld/bld-wrapper.properties
|
||||
/yourthing/lib/compile
|
||||
/yourthing/lib/compile/modules
|
||||
/yourthing/lib/provided
|
||||
/yourthing/lib/provided/modules
|
||||
/yourthing/lib/runtime
|
||||
/yourthing/lib/runtime/modules
|
||||
/yourthing/lib/test
|
||||
/yourthing/lib/test/modules
|
||||
/yourthing/src
|
||||
/yourthing/src/bld
|
||||
/yourthing/src/bld/java
|
||||
|
@ -288,9 +300,13 @@ public class TestCreateBaseOperation {
|
|||
/yourthing/lib/bld/bld-wrapper.jar
|
||||
/yourthing/lib/bld/bld-wrapper.properties
|
||||
/yourthing/lib/compile
|
||||
/yourthing/lib/compile/modules
|
||||
/yourthing/lib/provided
|
||||
/yourthing/lib/provided/modules
|
||||
/yourthing/lib/runtime
|
||||
/yourthing/lib/runtime/modules
|
||||
/yourthing/lib/test
|
||||
/yourthing/lib/test/modules
|
||||
/yourthing/src
|
||||
/yourthing/src/bld
|
||||
/yourthing/src/bld/java
|
||||
|
|
|
@ -87,8 +87,11 @@ public class TestCreateLibOperation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/test
|
||||
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
|
||||
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar
|
||||
|
@ -106,6 +109,7 @@ public class TestCreateLibOperation {
|
|||
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3-sources\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/modules
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar
|
||||
/myapp/src
|
||||
|
@ -166,8 +170,11 @@ public class TestCreateLibOperation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/test
|
||||
/myapp/lib/test/apiguardian-api-1\\.1\\.2-sources\\.jar
|
||||
/myapp/lib/test/apiguardian-api-1\\.1\\.2\\.jar
|
||||
|
@ -185,6 +192,7 @@ public class TestCreateLibOperation {
|
|||
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3-sources\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/modules
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar
|
||||
/myapp/src
|
||||
|
|
|
@ -100,10 +100,13 @@ public class TestCreateRife2Operation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/compile/rife2-.+-sources\\.jar
|
||||
/myapp/lib/compile/rife2-.+\\.jar
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/standalone
|
||||
/myapp/lib/standalone/jakarta\\.servlet-api-6\\.0\\.0-sources\\.jar
|
||||
/myapp/lib/standalone/jakarta\\.servlet-api-6\\.0\\.0\\.jar
|
||||
|
@ -121,6 +124,7 @@ public class TestCreateRife2Operation {
|
|||
/myapp/lib/standalone/jetty-session-12\\.0\\.11\\.jar
|
||||
/myapp/lib/standalone/jetty-util-12\\.0\\.11-sources\\.jar
|
||||
/myapp/lib/standalone/jetty-util-12\\.0\\.11\\.jar
|
||||
/myapp/lib/standalone/modules
|
||||
/myapp/lib/standalone/slf4j-api-2\\.0\\.13-sources\\.jar
|
||||
/myapp/lib/standalone/slf4j-api-2\\.0\\.13\\.jar
|
||||
/myapp/lib/standalone/slf4j-simple-2\\.0\\.13-sources\\.jar
|
||||
|
@ -144,6 +148,7 @@ public class TestCreateRife2Operation {
|
|||
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3-sources\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/modules
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar
|
||||
/myapp/src
|
||||
|
@ -214,10 +219,13 @@ public class TestCreateRife2Operation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/compile/rife2-.+-sources\\.jar
|
||||
/myapp/lib/compile/rife2-.+\\.jar
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/standalone
|
||||
/myapp/lib/standalone/jakarta\\.servlet-api-6\\.0\\.0-sources\\.jar
|
||||
/myapp/lib/standalone/jakarta\\.servlet-api-6\\.0\\.0\\.jar
|
||||
|
@ -235,6 +243,7 @@ public class TestCreateRife2Operation {
|
|||
/myapp/lib/standalone/jetty-session-12\\.0\\.11\\.jar
|
||||
/myapp/lib/standalone/jetty-util-12\\.0\\.11-sources\\.jar
|
||||
/myapp/lib/standalone/jetty-util-12\\.0\\.11\\.jar
|
||||
/myapp/lib/standalone/modules
|
||||
/myapp/lib/standalone/slf4j-api-2\\.0\\.13-sources\\.jar
|
||||
/myapp/lib/standalone/slf4j-api-2\\.0\\.13\\.jar
|
||||
/myapp/lib/standalone/slf4j-simple-2\\.0\\.13-sources\\.jar
|
||||
|
@ -258,6 +267,7 @@ public class TestCreateRife2Operation {
|
|||
/myapp/lib/test/junit-platform-console-standalone-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3-sources\\.jar
|
||||
/myapp/lib/test/junit-platform-engine-1\\.10\\.3\\.jar
|
||||
/myapp/lib/test/modules
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0-sources\\.jar
|
||||
/myapp/lib/test/opentest4j-1\\.3\\.0\\.jar
|
||||
/myapp/src
|
||||
|
@ -347,10 +357,15 @@ public class TestCreateRife2Operation {
|
|||
/yourthing/lib/bld/bld-wrapper.jar
|
||||
/yourthing/lib/bld/bld-wrapper.properties
|
||||
/yourthing/lib/compile
|
||||
/yourthing/lib/compile/modules
|
||||
/yourthing/lib/provided
|
||||
/yourthing/lib/provided/modules
|
||||
/yourthing/lib/runtime
|
||||
/yourthing/lib/runtime/modules
|
||||
/yourthing/lib/standalone
|
||||
/yourthing/lib/standalone/modules
|
||||
/yourthing/lib/test
|
||||
/yourthing/lib/test/modules
|
||||
/yourthing/src
|
||||
/yourthing/src/bld
|
||||
/yourthing/src/bld/java
|
||||
|
@ -388,7 +403,7 @@ public class TestCreateRife2Operation {
|
|||
compile_operation.fromProject(create_operation.project());
|
||||
assertThrows(ExitStatusException.class, compile_operation::execute);
|
||||
var diagnostics = compile_operation.diagnostics();
|
||||
assertEquals(16, diagnostics.size());
|
||||
assertFalse(diagnostics.isEmpty());
|
||||
} finally {
|
||||
FileUtils.deleteDirectory(tmp);
|
||||
}
|
||||
|
@ -468,6 +483,7 @@ public class TestCreateRife2Operation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/local
|
||||
/myapp/lib/local/apiguardian-api-1\\.1\\.2-sources\\.jar
|
||||
/myapp/lib/local/apiguardian-api-1\\.1\\.2\\.jar
|
||||
|
@ -512,9 +528,13 @@ public class TestCreateRife2Operation {
|
|||
/myapp/lib/local/slf4j-simple-2\\.0\\.13-sources\\.jar
|
||||
/myapp/lib/local/slf4j-simple-2\\.0\\.13\\.jar
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/standalone
|
||||
/myapp/lib/standalone/modules
|
||||
/myapp/lib/test
|
||||
/myapp/lib/test/modules
|
||||
/myapp/src
|
||||
/myapp/src/bld
|
||||
/myapp/src/bld/java
|
||||
|
@ -636,6 +656,7 @@ public class TestCreateRife2Operation {
|
|||
/myapp/lib/bld/bld-wrapper\\.jar
|
||||
/myapp/lib/bld/bld-wrapper\\.properties
|
||||
/myapp/lib/compile
|
||||
/myapp/lib/compile/modules
|
||||
/myapp/lib/local_compile
|
||||
/myapp/lib/local_compile/rife2-.*-sources\\.jar
|
||||
/myapp/lib/local_compile/rife2-.*\\.jar
|
||||
|
@ -682,9 +703,13 @@ public class TestCreateRife2Operation {
|
|||
/myapp/lib/local_test/opentest4j-1\\.3\\.0-sources\\.jar
|
||||
/myapp/lib/local_test/opentest4j-1\\.3\\.0\\.jar
|
||||
/myapp/lib/provided
|
||||
/myapp/lib/provided/modules
|
||||
/myapp/lib/runtime
|
||||
/myapp/lib/runtime/modules
|
||||
/myapp/lib/standalone
|
||||
/myapp/lib/standalone/modules
|
||||
/myapp/lib/test
|
||||
/myapp/lib/test/modules
|
||||
/myapp/src
|
||||
/myapp/src/bld
|
||||
/myapp/src/bld/java
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.junit.jupiter.api.Test;
|
|||
import rife.bld.BldVersion;
|
||||
import rife.bld.WebProject;
|
||||
import rife.bld.dependencies.*;
|
||||
import rife.bld.dependencies.Module;
|
||||
import rife.bld.wrapper.Wrapper;
|
||||
import rife.tools.FileUtils;
|
||||
import rife.tools.StringUtils;
|
||||
|
@ -72,7 +73,7 @@ public class TestDependencyTreeOperation {
|
|||
.repositories(List.of(Repository.MAVEN_CENTRAL));
|
||||
operation.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,5,20)))
|
||||
.include(new Dependency("com.stripe", "stripe-java", new VersionNumber(20,136,0)))
|
||||
.include(new Module("com.stripe", "stripe-java", new VersionNumber(20,136,0)))
|
||||
.include(new Dependency("org.json", "json", new VersionNumber(20230227)))
|
||||
.include(new Dependency("com.itextpdf", "itext7-core", new VersionNumber(7,2,5)))
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,7)))
|
||||
|
@ -93,7 +94,7 @@ public class TestDependencyTreeOperation {
|
|||
|
||||
compile:
|
||||
├─ com.uwyn.rife2:rife2:1.5.20
|
||||
├─ com.stripe:stripe-java:20.136.0
|
||||
├─ com.stripe:stripe-java:20.136.0@modular-jar
|
||||
├─ org.json:json:20230227
|
||||
├─ com.itextpdf:itext7-core:7.2.5
|
||||
│ ├─ com.itextpdf:barcodes:7.2.5
|
||||
|
@ -150,12 +151,12 @@ public class TestDependencyTreeOperation {
|
|||
.include(new Dependency("org.eclipse.jetty", "jetty-servlet", new VersionNumber(11,0,15)).exclude("*", "jetty-jakarta-servlet-api"))
|
||||
.include(new Dependency("org.apache.tomcat.embed", "tomcat-embed-core", new VersionNumber(10,1,12)))
|
||||
.include(new Dependency("org.apache.tomcat.embed", "tomcat-embed-jasper", new VersionNumber(10,1,12)))
|
||||
.include(new Dependency("net.imagej", "ij", Version.parse("1.54d")));
|
||||
.include(new Module("net.imagej", "ij", Version.parse("1.54d")));
|
||||
operation.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.jsoup", "jsoup", new VersionNumber(1,16,1)))
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(5,0,0)))
|
||||
.include(new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11,0,15)).exclude("*", "jetty-jakarta-servlet-api"))
|
||||
.include(new Dependency("org.eclipse.jetty", "jetty-servlet", new VersionNumber(11,0,15)).exclude("*", "jetty-jakarta-servlet-api"))
|
||||
.include(new Module("org.eclipse.jetty", "jetty-servlet", new VersionNumber(11,0,15)).exclude("*", "jetty-jakarta-servlet-api"))
|
||||
.include(new Dependency("net.imagej", "ij", Version.parse("1.54d")));
|
||||
|
||||
operation.execute();
|
||||
|
@ -184,7 +185,7 @@ public class TestDependencyTreeOperation {
|
|||
├─ org.apache.tomcat.embed:tomcat-embed-jasper:10.1.12
|
||||
│ ├─ org.apache.tomcat.embed:tomcat-embed-el:10.1.12
|
||||
│ └─ org.eclipse.jdt:ecj:3.33.0
|
||||
└─ net.imagej:ij:1.54d
|
||||
└─ net.imagej:ij:1.54d@modular-jar
|
||||
|
||||
runtime:
|
||||
no dependencies
|
||||
|
@ -197,8 +198,8 @@ public class TestDependencyTreeOperation {
|
|||
│ │ └─ org.eclipse.jetty:jetty-util:11.0.15
|
||||
│ ├─ org.eclipse.jetty:jetty-io:11.0.15
|
||||
│ └─ org.slf4j:slf4j-api:2.0.5
|
||||
├─ org.eclipse.jetty:jetty-servlet:11.0.15
|
||||
│ └─ org.eclipse.jetty:jetty-security:11.0.15
|
||||
├─ org.eclipse.jetty:jetty-servlet:11.0.15@modular-jar
|
||||
│ └─ org.eclipse.jetty:jetty-security:11.0.15@modular-jar
|
||||
└─ net.imagej:ij:1.54d
|
||||
|
||||
"""), tree);
|
||||
|
@ -390,7 +391,7 @@ public class TestDependencyTreeOperation {
|
|||
.include(new Dependency("com.uwyn.rife2", "rife2", new VersionNumber(1,5,20)))
|
||||
.include(new Dependency("com.stripe", "stripe-java", new VersionNumber(20,136,0)))
|
||||
.include(new Dependency("org.json", "json", new VersionNumber(20230227)))
|
||||
.include(new Dependency("com.itextpdf", "itext7-core", new VersionNumber(7,2,5)))
|
||||
.include(new Module("com.itextpdf", "itext7-core", new VersionNumber(7,2,5)))
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,7)))
|
||||
.include(new Dependency("org.apache.thrift", "libthrift", new VersionNumber(0,17,0)))
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,15)))
|
||||
|
@ -411,7 +412,7 @@ public class TestDependencyTreeOperation {
|
|||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(5,0,0)))
|
||||
.include(new Dependency("org.eclipse.jetty", "jetty-server", new VersionNumber(11,0,15)).exclude("*", "jetty-jakarta-servlet-api"))
|
||||
.include(new Dependency("org.eclipse.jetty", "jetty-servlet", new VersionNumber(11,0,15)).exclude("*", "jetty-jakarta-servlet-api"))
|
||||
.include(new Dependency("net.imagej", "ij", Version.parse("1.54d")));
|
||||
.include(new Module("net.imagej", "ij", Version.parse("1.54d")));
|
||||
|
||||
var operation = new DependencyTreeOperation()
|
||||
.fromProject(project);
|
||||
|
@ -442,22 +443,22 @@ public class TestDependencyTreeOperation {
|
|||
├─ com.uwyn.rife2:rife2:1.5.20
|
||||
├─ com.stripe:stripe-java:20.136.0
|
||||
├─ org.json:json:20230227
|
||||
├─ com.itextpdf:itext7-core:7.2.5
|
||||
│ ├─ com.itextpdf:barcodes:7.2.5
|
||||
│ ├─ com.itextpdf:font-asian:7.2.5
|
||||
│ ├─ com.itextpdf:forms:7.2.5
|
||||
│ ├─ com.itextpdf:hyph:7.2.5
|
||||
│ ├─ com.itextpdf:io:7.2.5
|
||||
│ │ └─ com.itextpdf:commons:7.2.5
|
||||
│ ├─ com.itextpdf:kernel:7.2.5
|
||||
│ │ ├─ org.bouncycastle:bcpkix-jdk15on:1.70
|
||||
│ │ │ └─ org.bouncycastle:bcutil-jdk15on:1.70
|
||||
│ │ └─ org.bouncycastle:bcprov-jdk15on:1.70
|
||||
│ ├─ com.itextpdf:layout:7.2.5
|
||||
│ ├─ com.itextpdf:pdfa:7.2.5
|
||||
│ ├─ com.itextpdf:sign:7.2.5
|
||||
│ ├─ com.itextpdf:styled-xml-parser:7.2.5
|
||||
│ └─ com.itextpdf:svg:7.2.5
|
||||
├─ com.itextpdf:itext7-core:7.2.5@modular-jar
|
||||
│ ├─ com.itextpdf:barcodes:7.2.5@modular-jar
|
||||
│ ├─ com.itextpdf:font-asian:7.2.5@modular-jar
|
||||
│ ├─ com.itextpdf:forms:7.2.5@modular-jar
|
||||
│ ├─ com.itextpdf:hyph:7.2.5@modular-jar
|
||||
│ ├─ com.itextpdf:io:7.2.5@modular-jar
|
||||
│ │ └─ com.itextpdf:commons:7.2.5@modular-jar
|
||||
│ ├─ com.itextpdf:kernel:7.2.5@modular-jar
|
||||
│ │ ├─ org.bouncycastle:bcpkix-jdk15on:1.70@modular-jar
|
||||
│ │ │ └─ org.bouncycastle:bcutil-jdk15on:1.70@modular-jar
|
||||
│ │ └─ org.bouncycastle:bcprov-jdk15on:1.70@modular-jar
|
||||
│ ├─ com.itextpdf:layout:7.2.5@modular-jar
|
||||
│ ├─ com.itextpdf:pdfa:7.2.5@modular-jar
|
||||
│ ├─ com.itextpdf:sign:7.2.5@modular-jar
|
||||
│ ├─ com.itextpdf:styled-xml-parser:7.2.5@modular-jar
|
||||
│ └─ com.itextpdf:svg:7.2.5@modular-jar
|
||||
├─ org.slf4j:slf4j-simple:2.0.7
|
||||
│ └─ org.slf4j:slf4j-api:2.0.7
|
||||
├─ org.apache.thrift:libthrift:0.17.0
|
||||
|
@ -498,7 +499,7 @@ public class TestDependencyTreeOperation {
|
|||
│ └─ org.slf4j:slf4j-api:2.0.5
|
||||
├─ org.eclipse.jetty:jetty-servlet:11.0.15
|
||||
│ └─ org.eclipse.jetty:jetty-security:11.0.15
|
||||
└─ net.imagej:ij:1.54d
|
||||
└─ net.imagej:ij:1.54d@modular-jar
|
||||
|
||||
"""), tree);
|
||||
} finally {
|
||||
|
|
|
@ -7,6 +7,7 @@ package rife.bld.operations;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import rife.bld.WebProject;
|
||||
import rife.bld.dependencies.*;
|
||||
import rife.bld.dependencies.Module;
|
||||
import rife.tools.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -23,10 +24,15 @@ public class TestDownloadOperation {
|
|||
assertTrue(operation.dependencies().isEmpty());
|
||||
assertTrue(operation.repositories().isEmpty());
|
||||
assertNull(operation.libCompileDirectory());
|
||||
assertNull(operation.libCompileModulesDirectory());
|
||||
assertNull(operation.libProvidedDirectory());
|
||||
assertNull(operation.libProvidedModulesDirectory());
|
||||
assertNull(operation.libRuntimeDirectory());
|
||||
assertNull(operation.libRuntimeModulesDirectory());
|
||||
assertNull(operation.libStandaloneDirectory());
|
||||
assertNull(operation.libStandaloneModulesDirectory());
|
||||
assertNull(operation.libTestDirectory());
|
||||
assertNull(operation.libTestModulesDirectory());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -40,6 +46,11 @@ public class TestDownloadOperation {
|
|||
var dir3 = new File("dir3");
|
||||
var dir4 = new File("dir4");
|
||||
var dir5 = new File("dir5");
|
||||
var dir6 = new File("dir6");
|
||||
var dir7 = new File("dir7");
|
||||
var dir8 = new File("dir8");
|
||||
var dir9 = new File("dir9");
|
||||
var dir10 = new File("dir10");
|
||||
|
||||
var operation1 = new DownloadOperation()
|
||||
.repositories(List.of(repository1, repository2))
|
||||
|
@ -47,7 +58,12 @@ public class TestDownloadOperation {
|
|||
.libProvidedDirectory(dir2)
|
||||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5);
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10);
|
||||
var dependency_scopes = new DependencyScopes();
|
||||
dependency_scopes.scope(Scope.compile).include(dependency1).include(dependency2);
|
||||
operation1.dependencies(dependency_scopes);
|
||||
|
@ -60,13 +76,23 @@ public class TestDownloadOperation {
|
|||
assertEquals(dir3, operation1.libRuntimeDirectory());
|
||||
assertEquals(dir4, operation1.libStandaloneDirectory());
|
||||
assertEquals(dir5, operation1.libTestDirectory());
|
||||
assertEquals(dir6, operation1.libCompileModulesDirectory());
|
||||
assertEquals(dir7, operation1.libProvidedModulesDirectory());
|
||||
assertEquals(dir8, operation1.libRuntimeModulesDirectory());
|
||||
assertEquals(dir9, operation1.libStandaloneModulesDirectory());
|
||||
assertEquals(dir10, operation1.libTestModulesDirectory());
|
||||
|
||||
var operation2 = new DownloadOperation()
|
||||
.libCompileDirectory(dir1)
|
||||
.libProvidedDirectory(dir2)
|
||||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5);
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10);
|
||||
operation2.repositories().add(repository1);
|
||||
operation2.repositories().add(repository2);
|
||||
operation2.dependencies().scope(Scope.compile).include(dependency1).include(dependency2);
|
||||
|
@ -80,6 +106,11 @@ public class TestDownloadOperation {
|
|||
assertEquals(dir3, operation2.libRuntimeDirectory());
|
||||
assertEquals(dir4, operation2.libStandaloneDirectory());
|
||||
assertEquals(dir5, operation2.libTestDirectory());
|
||||
assertEquals(dir6, operation2.libCompileModulesDirectory());
|
||||
assertEquals(dir7, operation2.libProvidedModulesDirectory());
|
||||
assertEquals(dir8, operation2.libRuntimeModulesDirectory());
|
||||
assertEquals(dir9, operation2.libStandaloneModulesDirectory());
|
||||
assertEquals(dir10, operation2.libTestModulesDirectory());
|
||||
|
||||
var operation3 = new DownloadOperation()
|
||||
.offline(true)
|
||||
|
@ -96,14 +127,14 @@ public class TestDownloadOperation {
|
|||
try {
|
||||
var dir1 = new File(tmp, "dir1");
|
||||
var dir2 = new File(tmp, "dir2");
|
||||
var dir3 = new File(tmp, "dir3");
|
||||
var dir8 = new File(tmp, "dir8");
|
||||
var dir3 = new File(dir8, "dir3");
|
||||
var dir4 = new File(tmp, "dir4");
|
||||
var dir5 = new File(tmp, "dir5");
|
||||
dir1.mkdirs();
|
||||
dir2.mkdirs();
|
||||
dir3.mkdirs();
|
||||
dir4.mkdirs();
|
||||
dir5.mkdirs();
|
||||
var dir6 = new File(tmp, "dir6");
|
||||
var dir7 = new File(tmp, "dir7");
|
||||
var dir9 = new File(dir4, "dir9");
|
||||
var dir10 = new File(dir5, "dir10");
|
||||
|
||||
var operation = new DownloadOperation()
|
||||
.repositories(List.of(Repository.MAVEN_CENTRAL))
|
||||
|
@ -111,17 +142,27 @@ public class TestDownloadOperation {
|
|||
.libProvidedDirectory(dir2)
|
||||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5);
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10);
|
||||
operation.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 12, 0)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,12,0)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240303)));
|
||||
operation.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(6, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,17,0)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,5,3)));
|
||||
operation.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 4)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,4)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
|
||||
operation.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,11)));
|
||||
operation.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 2, 1)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
|
||||
|
||||
operation.execute();
|
||||
|
||||
|
@ -129,17 +170,38 @@ public class TestDownloadOperation {
|
|||
/dir1
|
||||
/dir1/commons-lang3-3.12.0.jar
|
||||
/dir2
|
||||
/dir2/jakarta.servlet-api-6.0.0.jar
|
||||
/dir3
|
||||
/dir3/commons-collections4-4.4.jar
|
||||
/dir2/commons-codec-1.17.0.jar
|
||||
/dir4
|
||||
/dir4/slf4j-api-2.0.6.jar
|
||||
/dir4/dir9
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11.jar
|
||||
/dir4/dir9/jetty-http-12.0.11.jar
|
||||
/dir4/dir9/jetty-io-12.0.11.jar
|
||||
/dir4/dir9/jetty-security-12.0.11.jar
|
||||
/dir4/dir9/jetty-server-12.0.11.jar
|
||||
/dir4/dir9/jetty-session-12.0.11.jar
|
||||
/dir4/dir9/jetty-util-12.0.11.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12.jar
|
||||
/dir4/slf4j-simple-2.0.6.jar
|
||||
/dir5
|
||||
/dir5/dir10
|
||||
/dir5/dir10/jsoup-1.18.1.jar
|
||||
/dir5/httpclient5-5.2.1.jar
|
||||
/dir5/httpcore5-5.2.jar
|
||||
/dir5/httpcore5-h2-5.2.jar
|
||||
/dir5/slf4j-api-1.7.36.jar""",
|
||||
/dir5/slf4j-api-1.7.36.jar
|
||||
/dir6
|
||||
/dir6/json-20240303.jar
|
||||
/dir7
|
||||
/dir7/core-3.5.3.jar
|
||||
/dir7/jai-imageio-core-1.4.0.jar
|
||||
/dir7/javase-3.5.3.jar
|
||||
/dir7/jcommander-1.82.jar
|
||||
/dir8
|
||||
/dir8/checker-qual-3.42.0.jar
|
||||
/dir8/dir3
|
||||
/dir8/dir3/commons-collections4-4.4.jar
|
||||
/dir8/postgresql-42.7.3.jar""",
|
||||
FileUtils.generateDirectoryListing(tmp));
|
||||
} finally {
|
||||
FileUtils.deleteDirectory(tmp);
|
||||
|
@ -153,14 +215,14 @@ public class TestDownloadOperation {
|
|||
try {
|
||||
var dir1 = new File(tmp, "dir1");
|
||||
var dir2 = new File(tmp, "dir2");
|
||||
var dir3 = new File(tmp, "dir3");
|
||||
var dir8 = new File(tmp, "dir8");
|
||||
var dir3 = new File(dir8, "dir3");
|
||||
var dir4 = new File(tmp, "dir4");
|
||||
var dir5 = new File(tmp, "dir5");
|
||||
dir1.mkdirs();
|
||||
dir2.mkdirs();
|
||||
dir3.mkdirs();
|
||||
dir4.mkdirs();
|
||||
dir5.mkdirs();
|
||||
var dir6 = new File(tmp, "dir6");
|
||||
var dir7 = new File(tmp, "dir7");
|
||||
var dir9 = new File(dir4, "dir9");
|
||||
var dir10 = new File(dir5, "dir10");
|
||||
|
||||
var operation = new DownloadOperation()
|
||||
.repositories(List.of(Repository.MAVEN_CENTRAL))
|
||||
|
@ -169,18 +231,28 @@ public class TestDownloadOperation {
|
|||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10)
|
||||
.downloadJavadoc(true)
|
||||
.downloadSources(true);
|
||||
operation.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 12, 0)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,12,0)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240303)));
|
||||
operation.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(6, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,17,0)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,5,3)));
|
||||
operation.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 4)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,4)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
|
||||
operation.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,11)));
|
||||
operation.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 2, 1)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
|
||||
|
||||
operation.execute();
|
||||
|
||||
|
@ -190,21 +262,46 @@ public class TestDownloadOperation {
|
|||
/dir1/commons-lang3-3.12.0-sources.jar
|
||||
/dir1/commons-lang3-3.12.0.jar
|
||||
/dir2
|
||||
/dir2/jakarta.servlet-api-6.0.0-javadoc.jar
|
||||
/dir2/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/dir2/jakarta.servlet-api-6.0.0.jar
|
||||
/dir3
|
||||
/dir3/commons-collections4-4.4-javadoc.jar
|
||||
/dir3/commons-collections4-4.4-sources.jar
|
||||
/dir3/commons-collections4-4.4.jar
|
||||
/dir2/commons-codec-1.17.0-javadoc.jar
|
||||
/dir2/commons-codec-1.17.0-sources.jar
|
||||
/dir2/commons-codec-1.17.0.jar
|
||||
/dir4
|
||||
/dir4/slf4j-api-2.0.6-javadoc.jar
|
||||
/dir4/slf4j-api-2.0.6-sources.jar
|
||||
/dir4/slf4j-api-2.0.6.jar
|
||||
/dir4/dir9
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0-javadoc.jar
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11.jar
|
||||
/dir4/dir9/jetty-http-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-http-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-http-12.0.11.jar
|
||||
/dir4/dir9/jetty-io-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-io-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-io-12.0.11.jar
|
||||
/dir4/dir9/jetty-security-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-security-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-security-12.0.11.jar
|
||||
/dir4/dir9/jetty-server-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-server-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-server-12.0.11.jar
|
||||
/dir4/dir9/jetty-session-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-session-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-session-12.0.11.jar
|
||||
/dir4/dir9/jetty-util-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-util-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-util-12.0.11.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12-javadoc.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12-sources.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12.jar
|
||||
/dir4/slf4j-simple-2.0.6-javadoc.jar
|
||||
/dir4/slf4j-simple-2.0.6-sources.jar
|
||||
/dir4/slf4j-simple-2.0.6.jar
|
||||
/dir5
|
||||
/dir5/dir10
|
||||
/dir5/dir10/jsoup-1.18.1-javadoc.jar
|
||||
/dir5/dir10/jsoup-1.18.1-sources.jar
|
||||
/dir5/dir10/jsoup-1.18.1.jar
|
||||
/dir5/httpclient5-5.2.1-javadoc.jar
|
||||
/dir5/httpclient5-5.2.1-sources.jar
|
||||
/dir5/httpclient5-5.2.1.jar
|
||||
|
@ -216,7 +313,35 @@ public class TestDownloadOperation {
|
|||
/dir5/httpcore5-h2-5.2.jar
|
||||
/dir5/slf4j-api-1.7.36-javadoc.jar
|
||||
/dir5/slf4j-api-1.7.36-sources.jar
|
||||
/dir5/slf4j-api-1.7.36.jar""",
|
||||
/dir5/slf4j-api-1.7.36.jar
|
||||
/dir6
|
||||
/dir6/json-20240303-javadoc.jar
|
||||
/dir6/json-20240303-sources.jar
|
||||
/dir6/json-20240303.jar
|
||||
/dir7
|
||||
/dir7/core-3.5.3-javadoc.jar
|
||||
/dir7/core-3.5.3-sources.jar
|
||||
/dir7/core-3.5.3.jar
|
||||
/dir7/jai-imageio-core-1.4.0-javadoc.jar
|
||||
/dir7/jai-imageio-core-1.4.0-sources.jar
|
||||
/dir7/jai-imageio-core-1.4.0.jar
|
||||
/dir7/javase-3.5.3-javadoc.jar
|
||||
/dir7/javase-3.5.3-sources.jar
|
||||
/dir7/javase-3.5.3.jar
|
||||
/dir7/jcommander-1.82-javadoc.jar
|
||||
/dir7/jcommander-1.82-sources.jar
|
||||
/dir7/jcommander-1.82.jar
|
||||
/dir8
|
||||
/dir8/checker-qual-3.42.0-javadoc.jar
|
||||
/dir8/checker-qual-3.42.0-sources.jar
|
||||
/dir8/checker-qual-3.42.0.jar
|
||||
/dir8/dir3
|
||||
/dir8/dir3/commons-collections4-4.4-javadoc.jar
|
||||
/dir8/dir3/commons-collections4-4.4-sources.jar
|
||||
/dir8/dir3/commons-collections4-4.4.jar
|
||||
/dir8/postgresql-42.7.3-javadoc.jar
|
||||
/dir8/postgresql-42.7.3-sources.jar
|
||||
/dir8/postgresql-42.7.3.jar""",
|
||||
FileUtils.generateDirectoryListing(tmp));
|
||||
} finally {
|
||||
FileUtils.deleteDirectory(tmp);
|
||||
|
@ -240,15 +365,20 @@ public class TestDownloadOperation {
|
|||
project.createProjectStructure();
|
||||
project.repositories().add(Repository.MAVEN_CENTRAL);
|
||||
project.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 12, 0)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,12,0)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240303)));
|
||||
project.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(6, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,17,0)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,5,3)));
|
||||
project.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 4)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,4)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
|
||||
project.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,11)));
|
||||
project.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 2, 1)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
|
||||
|
||||
var operation = new DownloadOperation()
|
||||
.fromProject(project);
|
||||
|
@ -261,15 +391,49 @@ public class TestDownloadOperation {
|
|||
/lib/compile
|
||||
/lib/compile/commons-lang3-3.12.0-sources.jar
|
||||
/lib/compile/commons-lang3-3.12.0.jar
|
||||
/lib/compile/modules
|
||||
/lib/compile/modules/json-20240303-sources.jar
|
||||
/lib/compile/modules/json-20240303.jar
|
||||
/lib/provided
|
||||
/lib/provided/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/lib/provided/jakarta.servlet-api-6.0.0.jar
|
||||
/lib/provided/commons-codec-1.17.0-sources.jar
|
||||
/lib/provided/commons-codec-1.17.0.jar
|
||||
/lib/provided/modules
|
||||
/lib/provided/modules/core-3.5.3-sources.jar
|
||||
/lib/provided/modules/core-3.5.3.jar
|
||||
/lib/provided/modules/jai-imageio-core-1.4.0-sources.jar
|
||||
/lib/provided/modules/jai-imageio-core-1.4.0.jar
|
||||
/lib/provided/modules/javase-3.5.3-sources.jar
|
||||
/lib/provided/modules/javase-3.5.3.jar
|
||||
/lib/provided/modules/jcommander-1.82-sources.jar
|
||||
/lib/provided/modules/jcommander-1.82.jar
|
||||
/lib/runtime
|
||||
/lib/runtime/commons-collections4-4.4-sources.jar
|
||||
/lib/runtime/commons-collections4-4.4.jar
|
||||
/lib/runtime/modules
|
||||
/lib/runtime/modules/checker-qual-3.42.0-sources.jar
|
||||
/lib/runtime/modules/checker-qual-3.42.0.jar
|
||||
/lib/runtime/modules/postgresql-42.7.3-sources.jar
|
||||
/lib/runtime/modules/postgresql-42.7.3.jar
|
||||
/lib/standalone
|
||||
/lib/standalone/slf4j-api-2.0.6-sources.jar
|
||||
/lib/standalone/slf4j-api-2.0.6.jar
|
||||
/lib/standalone/modules
|
||||
/lib/standalone/modules/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/lib/standalone/modules/jakarta.servlet-api-6.0.0.jar
|
||||
/lib/standalone/modules/jetty-ee10-servlet-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-ee10-servlet-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-http-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-http-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-io-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-io-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-security-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-security-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-server-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-server-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-session-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-session-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-util-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-util-12.0.11.jar
|
||||
/lib/standalone/modules/slf4j-api-2.0.12-sources.jar
|
||||
/lib/standalone/modules/slf4j-api-2.0.12.jar
|
||||
/lib/standalone/slf4j-simple-2.0.6-sources.jar
|
||||
/lib/standalone/slf4j-simple-2.0.6.jar
|
||||
/lib/test
|
||||
|
@ -279,6 +443,9 @@ public class TestDownloadOperation {
|
|||
/lib/test/httpcore5-5.2.jar
|
||||
/lib/test/httpcore5-h2-5.2-sources.jar
|
||||
/lib/test/httpcore5-h2-5.2.jar
|
||||
/lib/test/modules
|
||||
/lib/test/modules/jsoup-1.18.1-sources.jar
|
||||
/lib/test/modules/jsoup-1.18.1.jar
|
||||
/lib/test/slf4j-api-1.7.36-sources.jar
|
||||
/lib/test/slf4j-api-1.7.36.jar
|
||||
/src
|
||||
|
@ -308,6 +475,8 @@ public class TestDownloadOperation {
|
|||
project.repositories().add(Repository.MAVEN_CENTRAL);
|
||||
project.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("com.stripe", "stripe-java", new VersionNumber(20,136,0)));
|
||||
project.dependencies().scope(Scope.runtime)
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240303)));
|
||||
|
||||
var operation = new DownloadOperation()
|
||||
.fromProject(project);
|
||||
|
@ -318,14 +487,21 @@ public class TestDownloadOperation {
|
|||
/lib
|
||||
/lib/bld
|
||||
/lib/compile
|
||||
/lib/compile/modules
|
||||
/lib/compile/stripe-java-20.136.0-sources.jar
|
||||
/lib/compile/stripe-java-20.136.0.jar
|
||||
/lib/provided
|
||||
/lib/provided/modules
|
||||
/lib/runtime
|
||||
/lib/runtime/gson-2.9.0-sources.jar
|
||||
/lib/runtime/gson-2.9.0.jar
|
||||
/lib/runtime/modules
|
||||
/lib/runtime/modules/json-20240303-sources.jar
|
||||
/lib/runtime/modules/json-20240303.jar
|
||||
/lib/standalone
|
||||
/lib/standalone/modules
|
||||
/lib/test
|
||||
/lib/test/modules
|
||||
/src
|
||||
/src/bld
|
||||
/src/bld/java
|
||||
|
|
|
@ -7,6 +7,7 @@ package rife.bld.operations;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import rife.bld.WebProject;
|
||||
import rife.bld.dependencies.*;
|
||||
import rife.bld.dependencies.Module;
|
||||
import rife.tools.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -40,6 +41,11 @@ public class TestPurgeOperation {
|
|||
var dir3 = new File("dir3");
|
||||
var dir4 = new File("dir4");
|
||||
var dir5 = new File("dir5");
|
||||
var dir6 = new File("dir6");
|
||||
var dir7 = new File("dir7");
|
||||
var dir8 = new File("dir8");
|
||||
var dir9 = new File("dir9");
|
||||
var dir10 = new File("dir10");
|
||||
|
||||
var operation1 = new PurgeOperation()
|
||||
.repositories(List.of(repository1, repository2))
|
||||
|
@ -47,7 +53,12 @@ public class TestPurgeOperation {
|
|||
.libProvidedDirectory(dir2)
|
||||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5);
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10);
|
||||
var dependency_scopes = new DependencyScopes();
|
||||
dependency_scopes.scope(Scope.compile).include(dependency1).include(dependency2);
|
||||
operation1.dependencies(dependency_scopes);
|
||||
|
@ -60,13 +71,23 @@ public class TestPurgeOperation {
|
|||
assertEquals(dir3, operation1.libRuntimeDirectory());
|
||||
assertEquals(dir4, operation1.libStandaloneDirectory());
|
||||
assertEquals(dir5, operation1.libTestDirectory());
|
||||
assertEquals(dir6, operation1.libCompileModulesDirectory());
|
||||
assertEquals(dir7, operation1.libProvidedModulesDirectory());
|
||||
assertEquals(dir8, operation1.libRuntimeModulesDirectory());
|
||||
assertEquals(dir9, operation1.libStandaloneModulesDirectory());
|
||||
assertEquals(dir10, operation1.libTestModulesDirectory());
|
||||
|
||||
var operation2 = new PurgeOperation()
|
||||
.libCompileDirectory(dir1)
|
||||
.libProvidedDirectory(dir2)
|
||||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5);
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10);
|
||||
operation2.repositories().add(repository1);
|
||||
operation2.repositories().add(repository2);
|
||||
operation2.dependencies().scope(Scope.compile).include(dependency1).include(dependency2);
|
||||
|
@ -80,6 +101,11 @@ public class TestPurgeOperation {
|
|||
assertEquals(dir3, operation2.libRuntimeDirectory());
|
||||
assertEquals(dir4, operation2.libStandaloneDirectory());
|
||||
assertEquals(dir5, operation2.libTestDirectory());
|
||||
assertEquals(dir6, operation2.libCompileModulesDirectory());
|
||||
assertEquals(dir7, operation2.libProvidedModulesDirectory());
|
||||
assertEquals(dir8, operation2.libRuntimeModulesDirectory());
|
||||
assertEquals(dir9, operation2.libStandaloneModulesDirectory());
|
||||
assertEquals(dir10, operation2.libTestModulesDirectory());
|
||||
|
||||
var operation3 = new PurgeOperation()
|
||||
.offline(true)
|
||||
|
@ -96,14 +122,14 @@ public class TestPurgeOperation {
|
|||
try {
|
||||
var dir1 = new File(tmp, "dir1");
|
||||
var dir2 = new File(tmp, "dir2");
|
||||
var dir3 = new File(tmp, "dir3");
|
||||
var dir8 = new File(tmp, "dir8");
|
||||
var dir3 = new File(dir8, "dir3");
|
||||
var dir4 = new File(tmp, "dir4");
|
||||
var dir5 = new File(tmp, "dir5");
|
||||
dir1.mkdirs();
|
||||
dir2.mkdirs();
|
||||
dir3.mkdirs();
|
||||
dir4.mkdirs();
|
||||
dir5.mkdirs();
|
||||
var dir6 = new File(tmp, "dir6");
|
||||
var dir7 = new File(tmp, "dir7");
|
||||
var dir9 = new File(dir4, "dir9");
|
||||
var dir10 = new File(dir5, "dir10");
|
||||
|
||||
var operation_download1 = new DownloadOperation()
|
||||
.repositories(List.of(Repository.MAVEN_CENTRAL))
|
||||
|
@ -111,17 +137,27 @@ public class TestPurgeOperation {
|
|||
.libProvidedDirectory(dir2)
|
||||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5);
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10);
|
||||
operation_download1.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 1)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,1)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240205)));
|
||||
operation_download1.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(5, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,14)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,4,0)));
|
||||
operation_download1.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 3)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,3)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,4,5)));
|
||||
operation_download1.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 0)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,0)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,6)));
|
||||
operation_download1.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 0)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,0)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,15,3)));
|
||||
|
||||
operation_download1.execute();
|
||||
|
||||
|
@ -131,17 +167,27 @@ public class TestPurgeOperation {
|
|||
.libProvidedDirectory(dir2)
|
||||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5);
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10);
|
||||
operation_download2.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 12, 0)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,12,0)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240303)));
|
||||
operation_download2.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(6, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,17,0)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,5,3)));
|
||||
operation_download2.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 4)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,4)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
|
||||
operation_download2.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,11)));
|
||||
operation_download2.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 2, 1)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
|
||||
|
||||
operation_download2.execute();
|
||||
|
||||
|
@ -150,18 +196,34 @@ public class TestPurgeOperation {
|
|||
/dir1/commons-lang3-3.1.jar
|
||||
/dir1/commons-lang3-3.12.0.jar
|
||||
/dir2
|
||||
/dir2/jakarta.servlet-api-5.0.0.jar
|
||||
/dir2/jakarta.servlet-api-6.0.0.jar
|
||||
/dir3
|
||||
/dir3/commons-collections4-4.3.jar
|
||||
/dir3/commons-collections4-4.4.jar
|
||||
/dir2/commons-codec-1.14.jar
|
||||
/dir2/commons-codec-1.17.0.jar
|
||||
/dir4
|
||||
/dir4/slf4j-api-2.0.0.jar
|
||||
/dir4/slf4j-api-2.0.6.jar
|
||||
/dir4/dir9
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.6.jar
|
||||
/dir4/dir9/jetty-http-12.0.11.jar
|
||||
/dir4/dir9/jetty-http-12.0.6.jar
|
||||
/dir4/dir9/jetty-io-12.0.11.jar
|
||||
/dir4/dir9/jetty-io-12.0.6.jar
|
||||
/dir4/dir9/jetty-security-12.0.11.jar
|
||||
/dir4/dir9/jetty-security-12.0.6.jar
|
||||
/dir4/dir9/jetty-server-12.0.11.jar
|
||||
/dir4/dir9/jetty-server-12.0.6.jar
|
||||
/dir4/dir9/jetty-session-12.0.11.jar
|
||||
/dir4/dir9/jetty-session-12.0.6.jar
|
||||
/dir4/dir9/jetty-util-12.0.11.jar
|
||||
/dir4/dir9/jetty-util-12.0.6.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12.jar
|
||||
/dir4/dir9/slf4j-api-2.0.9.jar
|
||||
/dir4/slf4j-simple-2.0.0.jar
|
||||
/dir4/slf4j-simple-2.0.6.jar
|
||||
/dir5
|
||||
/dir5/commons-codec-1.13.jar
|
||||
/dir5/dir10
|
||||
/dir5/dir10/jsoup-1.15.3.jar
|
||||
/dir5/dir10/jsoup-1.18.1.jar
|
||||
/dir5/httpclient5-5.0.jar
|
||||
/dir5/httpclient5-5.2.1.jar
|
||||
/dir5/httpcore5-5.0.jar
|
||||
|
@ -169,7 +231,26 @@ public class TestPurgeOperation {
|
|||
/dir5/httpcore5-h2-5.0.jar
|
||||
/dir5/httpcore5-h2-5.2.jar
|
||||
/dir5/slf4j-api-1.7.25.jar
|
||||
/dir5/slf4j-api-1.7.36.jar""",
|
||||
/dir5/slf4j-api-1.7.36.jar
|
||||
/dir6
|
||||
/dir6/json-20240205.jar
|
||||
/dir6/json-20240303.jar
|
||||
/dir7
|
||||
/dir7/core-3.4.0.jar
|
||||
/dir7/core-3.5.3.jar
|
||||
/dir7/jai-imageio-core-1.4.0.jar
|
||||
/dir7/javase-3.4.0.jar
|
||||
/dir7/javase-3.5.3.jar
|
||||
/dir7/jcommander-1.72.jar
|
||||
/dir7/jcommander-1.82.jar
|
||||
/dir8
|
||||
/dir8/checker-qual-3.42.0.jar
|
||||
/dir8/checker-qual-3.5.0.jar
|
||||
/dir8/dir3
|
||||
/dir8/dir3/commons-collections4-4.3.jar
|
||||
/dir8/dir3/commons-collections4-4.4.jar
|
||||
/dir8/postgresql-42.4.5.jar
|
||||
/dir8/postgresql-42.7.3.jar""",
|
||||
FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
var operation_purge = new PurgeOperation()
|
||||
|
@ -178,17 +259,27 @@ public class TestPurgeOperation {
|
|||
.libProvidedDirectory(dir2)
|
||||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5);
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10);
|
||||
operation_purge.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 12, 0)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,12,0)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240303)));
|
||||
operation_purge.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(6, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,17,0)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,5,3)));
|
||||
operation_purge.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 4)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,4)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
|
||||
operation_purge.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,11)));
|
||||
operation_purge.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 2, 1)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
|
||||
|
||||
operation_purge.execute();
|
||||
|
||||
|
@ -196,19 +287,39 @@ public class TestPurgeOperation {
|
|||
/dir1
|
||||
/dir1/commons-lang3-3.12.0.jar
|
||||
/dir2
|
||||
/dir2/jakarta.servlet-api-6.0.0.jar
|
||||
/dir3
|
||||
/dir3/commons-collections4-4.4.jar
|
||||
/dir2/commons-codec-1.17.0.jar
|
||||
/dir4
|
||||
/dir4/slf4j-api-2.0.6.jar
|
||||
/dir4/dir9
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11.jar
|
||||
/dir4/dir9/jetty-http-12.0.11.jar
|
||||
/dir4/dir9/jetty-io-12.0.11.jar
|
||||
/dir4/dir9/jetty-security-12.0.11.jar
|
||||
/dir4/dir9/jetty-server-12.0.11.jar
|
||||
/dir4/dir9/jetty-session-12.0.11.jar
|
||||
/dir4/dir9/jetty-util-12.0.11.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12.jar
|
||||
/dir4/slf4j-simple-2.0.6.jar
|
||||
/dir5
|
||||
/dir5/dir10
|
||||
/dir5/dir10/jsoup-1.18.1.jar
|
||||
/dir5/httpclient5-5.2.1.jar
|
||||
/dir5/httpcore5-5.2.jar
|
||||
/dir5/httpcore5-h2-5.2.jar
|
||||
/dir5/slf4j-api-1.7.36.jar""",
|
||||
/dir5/slf4j-api-1.7.36.jar
|
||||
/dir6
|
||||
/dir6/json-20240303.jar
|
||||
/dir7
|
||||
/dir7/core-3.5.3.jar
|
||||
/dir7/jai-imageio-core-1.4.0.jar
|
||||
/dir7/javase-3.5.3.jar
|
||||
/dir7/jcommander-1.82.jar
|
||||
/dir8
|
||||
/dir8/checker-qual-3.42.0.jar
|
||||
/dir8/dir3
|
||||
/dir8/dir3/commons-collections4-4.4.jar
|
||||
/dir8/postgresql-42.7.3.jar""",
|
||||
FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
} finally {
|
||||
FileUtils.deleteDirectory(tmp);
|
||||
}
|
||||
|
@ -221,13 +332,14 @@ public class TestPurgeOperation {
|
|||
try {
|
||||
var dir1 = new File(tmp, "dir1");
|
||||
var dir2 = new File(tmp, "dir2");
|
||||
var dir3 = new File(tmp, "dir3");
|
||||
var dir8 = new File(tmp, "dir8");
|
||||
var dir3 = new File(dir8, "dir3");
|
||||
var dir4 = new File(tmp, "dir4");
|
||||
var dir5 = new File(tmp, "dir5");
|
||||
dir1.mkdirs();
|
||||
dir3.mkdirs();
|
||||
dir4.mkdirs();
|
||||
dir5.mkdirs();
|
||||
var dir6 = new File(tmp, "dir6");
|
||||
var dir7 = new File(tmp, "dir7");
|
||||
var dir9 = new File(dir4, "dir9");
|
||||
var dir10 = new File(dir5, "dir10");
|
||||
|
||||
var operation_download1 = new DownloadOperation()
|
||||
.repositories(List.of(Repository.MAVEN_CENTRAL))
|
||||
|
@ -236,18 +348,28 @@ public class TestPurgeOperation {
|
|||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10)
|
||||
.downloadJavadoc(true)
|
||||
.downloadSources(true);
|
||||
operation_download1.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 1)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,1)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240205)));
|
||||
operation_download1.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(5, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,14)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,4,0)));
|
||||
operation_download1.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 3)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,3)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,4,5)));
|
||||
operation_download1.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 0)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,0)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,6)));
|
||||
operation_download1.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 0)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,0)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,15,3)));
|
||||
|
||||
operation_download1.execute();
|
||||
|
||||
|
@ -258,18 +380,28 @@ public class TestPurgeOperation {
|
|||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10)
|
||||
.downloadJavadoc(true)
|
||||
.downloadSources(true);
|
||||
operation_download2.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 12, 0)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,12,0)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240303)));
|
||||
operation_download2.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(6, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,17,0)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,5,3)));
|
||||
operation_download2.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 4)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,4)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
|
||||
operation_download2.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,11)));
|
||||
operation_download2.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 2, 1)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
|
||||
|
||||
operation_download2.execute();
|
||||
|
||||
|
@ -282,26 +414,65 @@ public class TestPurgeOperation {
|
|||
/dir1/commons-lang3-3.12.0-sources.jar
|
||||
/dir1/commons-lang3-3.12.0.jar
|
||||
/dir2
|
||||
/dir2/jakarta.servlet-api-5.0.0-javadoc.jar
|
||||
/dir2/jakarta.servlet-api-5.0.0-sources.jar
|
||||
/dir2/jakarta.servlet-api-5.0.0.jar
|
||||
/dir2/jakarta.servlet-api-6.0.0-javadoc.jar
|
||||
/dir2/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/dir2/jakarta.servlet-api-6.0.0.jar
|
||||
/dir3
|
||||
/dir3/commons-collections4-4.3-javadoc.jar
|
||||
/dir3/commons-collections4-4.3-sources.jar
|
||||
/dir3/commons-collections4-4.3.jar
|
||||
/dir3/commons-collections4-4.4-javadoc.jar
|
||||
/dir3/commons-collections4-4.4-sources.jar
|
||||
/dir3/commons-collections4-4.4.jar
|
||||
/dir2/commons-codec-1.14-javadoc.jar
|
||||
/dir2/commons-codec-1.14-sources.jar
|
||||
/dir2/commons-codec-1.14.jar
|
||||
/dir2/commons-codec-1.17.0-javadoc.jar
|
||||
/dir2/commons-codec-1.17.0-sources.jar
|
||||
/dir2/commons-codec-1.17.0.jar
|
||||
/dir4
|
||||
/dir4/slf4j-api-2.0.0-javadoc.jar
|
||||
/dir4/slf4j-api-2.0.0-sources.jar
|
||||
/dir4/slf4j-api-2.0.0.jar
|
||||
/dir4/slf4j-api-2.0.6-javadoc.jar
|
||||
/dir4/slf4j-api-2.0.6-sources.jar
|
||||
/dir4/slf4j-api-2.0.6.jar
|
||||
/dir4/dir9
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0-javadoc.jar
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.6-javadoc.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.6-sources.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.6.jar
|
||||
/dir4/dir9/jetty-http-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-http-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-http-12.0.11.jar
|
||||
/dir4/dir9/jetty-http-12.0.6-javadoc.jar
|
||||
/dir4/dir9/jetty-http-12.0.6-sources.jar
|
||||
/dir4/dir9/jetty-http-12.0.6.jar
|
||||
/dir4/dir9/jetty-io-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-io-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-io-12.0.11.jar
|
||||
/dir4/dir9/jetty-io-12.0.6-javadoc.jar
|
||||
/dir4/dir9/jetty-io-12.0.6-sources.jar
|
||||
/dir4/dir9/jetty-io-12.0.6.jar
|
||||
/dir4/dir9/jetty-security-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-security-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-security-12.0.11.jar
|
||||
/dir4/dir9/jetty-security-12.0.6-javadoc.jar
|
||||
/dir4/dir9/jetty-security-12.0.6-sources.jar
|
||||
/dir4/dir9/jetty-security-12.0.6.jar
|
||||
/dir4/dir9/jetty-server-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-server-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-server-12.0.11.jar
|
||||
/dir4/dir9/jetty-server-12.0.6-javadoc.jar
|
||||
/dir4/dir9/jetty-server-12.0.6-sources.jar
|
||||
/dir4/dir9/jetty-server-12.0.6.jar
|
||||
/dir4/dir9/jetty-session-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-session-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-session-12.0.11.jar
|
||||
/dir4/dir9/jetty-session-12.0.6-javadoc.jar
|
||||
/dir4/dir9/jetty-session-12.0.6-sources.jar
|
||||
/dir4/dir9/jetty-session-12.0.6.jar
|
||||
/dir4/dir9/jetty-util-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-util-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-util-12.0.11.jar
|
||||
/dir4/dir9/jetty-util-12.0.6-javadoc.jar
|
||||
/dir4/dir9/jetty-util-12.0.6-sources.jar
|
||||
/dir4/dir9/jetty-util-12.0.6.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12-javadoc.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12-sources.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12.jar
|
||||
/dir4/dir9/slf4j-api-2.0.9-javadoc.jar
|
||||
/dir4/dir9/slf4j-api-2.0.9-sources.jar
|
||||
/dir4/dir9/slf4j-api-2.0.9.jar
|
||||
/dir4/slf4j-simple-2.0.0-javadoc.jar
|
||||
/dir4/slf4j-simple-2.0.0-sources.jar
|
||||
/dir4/slf4j-simple-2.0.0.jar
|
||||
|
@ -312,6 +483,13 @@ public class TestPurgeOperation {
|
|||
/dir5/commons-codec-1.13-javadoc.jar
|
||||
/dir5/commons-codec-1.13-sources.jar
|
||||
/dir5/commons-codec-1.13.jar
|
||||
/dir5/dir10
|
||||
/dir5/dir10/jsoup-1.15.3-javadoc.jar
|
||||
/dir5/dir10/jsoup-1.15.3-sources.jar
|
||||
/dir5/dir10/jsoup-1.15.3.jar
|
||||
/dir5/dir10/jsoup-1.18.1-javadoc.jar
|
||||
/dir5/dir10/jsoup-1.18.1-sources.jar
|
||||
/dir5/dir10/jsoup-1.18.1.jar
|
||||
/dir5/httpclient5-5.0-javadoc.jar
|
||||
/dir5/httpclient5-5.0-sources.jar
|
||||
/dir5/httpclient5-5.0.jar
|
||||
|
@ -335,7 +513,56 @@ public class TestPurgeOperation {
|
|||
/dir5/slf4j-api-1.7.25.jar
|
||||
/dir5/slf4j-api-1.7.36-javadoc.jar
|
||||
/dir5/slf4j-api-1.7.36-sources.jar
|
||||
/dir5/slf4j-api-1.7.36.jar""",
|
||||
/dir5/slf4j-api-1.7.36.jar
|
||||
/dir6
|
||||
/dir6/json-20240205-javadoc.jar
|
||||
/dir6/json-20240205-sources.jar
|
||||
/dir6/json-20240205.jar
|
||||
/dir6/json-20240303-javadoc.jar
|
||||
/dir6/json-20240303-sources.jar
|
||||
/dir6/json-20240303.jar
|
||||
/dir7
|
||||
/dir7/core-3.4.0-javadoc.jar
|
||||
/dir7/core-3.4.0-sources.jar
|
||||
/dir7/core-3.4.0.jar
|
||||
/dir7/core-3.5.3-javadoc.jar
|
||||
/dir7/core-3.5.3-sources.jar
|
||||
/dir7/core-3.5.3.jar
|
||||
/dir7/jai-imageio-core-1.4.0-javadoc.jar
|
||||
/dir7/jai-imageio-core-1.4.0-sources.jar
|
||||
/dir7/jai-imageio-core-1.4.0.jar
|
||||
/dir7/javase-3.4.0-javadoc.jar
|
||||
/dir7/javase-3.4.0-sources.jar
|
||||
/dir7/javase-3.4.0.jar
|
||||
/dir7/javase-3.5.3-javadoc.jar
|
||||
/dir7/javase-3.5.3-sources.jar
|
||||
/dir7/javase-3.5.3.jar
|
||||
/dir7/jcommander-1.72-javadoc.jar
|
||||
/dir7/jcommander-1.72-sources.jar
|
||||
/dir7/jcommander-1.72.jar
|
||||
/dir7/jcommander-1.82-javadoc.jar
|
||||
/dir7/jcommander-1.82-sources.jar
|
||||
/dir7/jcommander-1.82.jar
|
||||
/dir8
|
||||
/dir8/checker-qual-3.42.0-javadoc.jar
|
||||
/dir8/checker-qual-3.42.0-sources.jar
|
||||
/dir8/checker-qual-3.42.0.jar
|
||||
/dir8/checker-qual-3.5.0-javadoc.jar
|
||||
/dir8/checker-qual-3.5.0-sources.jar
|
||||
/dir8/checker-qual-3.5.0.jar
|
||||
/dir8/dir3
|
||||
/dir8/dir3/commons-collections4-4.3-javadoc.jar
|
||||
/dir8/dir3/commons-collections4-4.3-sources.jar
|
||||
/dir8/dir3/commons-collections4-4.3.jar
|
||||
/dir8/dir3/commons-collections4-4.4-javadoc.jar
|
||||
/dir8/dir3/commons-collections4-4.4-sources.jar
|
||||
/dir8/dir3/commons-collections4-4.4.jar
|
||||
/dir8/postgresql-42.4.5-javadoc.jar
|
||||
/dir8/postgresql-42.4.5-sources.jar
|
||||
/dir8/postgresql-42.4.5.jar
|
||||
/dir8/postgresql-42.7.3-javadoc.jar
|
||||
/dir8/postgresql-42.7.3-sources.jar
|
||||
/dir8/postgresql-42.7.3.jar""",
|
||||
FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
var operation_purge = new PurgeOperation()
|
||||
|
@ -345,18 +572,28 @@ public class TestPurgeOperation {
|
|||
.libRuntimeDirectory(dir3)
|
||||
.libStandaloneDirectory(dir4)
|
||||
.libTestDirectory(dir5)
|
||||
.libCompileModulesDirectory(dir6)
|
||||
.libProvidedModulesDirectory(dir7)
|
||||
.libRuntimeModulesDirectory(dir8)
|
||||
.libStandaloneModulesDirectory(dir9)
|
||||
.libTestModulesDirectory(dir10)
|
||||
.preserveSources(true)
|
||||
.preserveJavadoc(true);
|
||||
operation_purge.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 12, 0)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,12,0)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240303)));
|
||||
operation_purge.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(6, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,17,0)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,5,3)));
|
||||
operation_purge.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 4)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,4)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
|
||||
operation_purge.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,11)));
|
||||
operation_purge.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 2, 1)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
|
||||
|
||||
operation_purge.execute();
|
||||
|
||||
|
@ -366,21 +603,46 @@ public class TestPurgeOperation {
|
|||
/dir1/commons-lang3-3.12.0-sources.jar
|
||||
/dir1/commons-lang3-3.12.0.jar
|
||||
/dir2
|
||||
/dir2/jakarta.servlet-api-6.0.0-javadoc.jar
|
||||
/dir2/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/dir2/jakarta.servlet-api-6.0.0.jar
|
||||
/dir3
|
||||
/dir3/commons-collections4-4.4-javadoc.jar
|
||||
/dir3/commons-collections4-4.4-sources.jar
|
||||
/dir3/commons-collections4-4.4.jar
|
||||
/dir2/commons-codec-1.17.0-javadoc.jar
|
||||
/dir2/commons-codec-1.17.0-sources.jar
|
||||
/dir2/commons-codec-1.17.0.jar
|
||||
/dir4
|
||||
/dir4/slf4j-api-2.0.6-javadoc.jar
|
||||
/dir4/slf4j-api-2.0.6-sources.jar
|
||||
/dir4/slf4j-api-2.0.6.jar
|
||||
/dir4/dir9
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0-javadoc.jar
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11.jar
|
||||
/dir4/dir9/jetty-http-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-http-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-http-12.0.11.jar
|
||||
/dir4/dir9/jetty-io-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-io-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-io-12.0.11.jar
|
||||
/dir4/dir9/jetty-security-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-security-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-security-12.0.11.jar
|
||||
/dir4/dir9/jetty-server-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-server-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-server-12.0.11.jar
|
||||
/dir4/dir9/jetty-session-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-session-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-session-12.0.11.jar
|
||||
/dir4/dir9/jetty-util-12.0.11-javadoc.jar
|
||||
/dir4/dir9/jetty-util-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-util-12.0.11.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12-javadoc.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12-sources.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12.jar
|
||||
/dir4/slf4j-simple-2.0.6-javadoc.jar
|
||||
/dir4/slf4j-simple-2.0.6-sources.jar
|
||||
/dir4/slf4j-simple-2.0.6.jar
|
||||
/dir5
|
||||
/dir5/dir10
|
||||
/dir5/dir10/jsoup-1.18.1-javadoc.jar
|
||||
/dir5/dir10/jsoup-1.18.1-sources.jar
|
||||
/dir5/dir10/jsoup-1.18.1.jar
|
||||
/dir5/httpclient5-5.2.1-javadoc.jar
|
||||
/dir5/httpclient5-5.2.1-sources.jar
|
||||
/dir5/httpclient5-5.2.1.jar
|
||||
|
@ -392,7 +654,35 @@ public class TestPurgeOperation {
|
|||
/dir5/httpcore5-h2-5.2.jar
|
||||
/dir5/slf4j-api-1.7.36-javadoc.jar
|
||||
/dir5/slf4j-api-1.7.36-sources.jar
|
||||
/dir5/slf4j-api-1.7.36.jar""",
|
||||
/dir5/slf4j-api-1.7.36.jar
|
||||
/dir6
|
||||
/dir6/json-20240303-javadoc.jar
|
||||
/dir6/json-20240303-sources.jar
|
||||
/dir6/json-20240303.jar
|
||||
/dir7
|
||||
/dir7/core-3.5.3-javadoc.jar
|
||||
/dir7/core-3.5.3-sources.jar
|
||||
/dir7/core-3.5.3.jar
|
||||
/dir7/jai-imageio-core-1.4.0-javadoc.jar
|
||||
/dir7/jai-imageio-core-1.4.0-sources.jar
|
||||
/dir7/jai-imageio-core-1.4.0.jar
|
||||
/dir7/javase-3.5.3-javadoc.jar
|
||||
/dir7/javase-3.5.3-sources.jar
|
||||
/dir7/javase-3.5.3.jar
|
||||
/dir7/jcommander-1.82-javadoc.jar
|
||||
/dir7/jcommander-1.82-sources.jar
|
||||
/dir7/jcommander-1.82.jar
|
||||
/dir8
|
||||
/dir8/checker-qual-3.42.0-javadoc.jar
|
||||
/dir8/checker-qual-3.42.0-sources.jar
|
||||
/dir8/checker-qual-3.42.0.jar
|
||||
/dir8/dir3
|
||||
/dir8/dir3/commons-collections4-4.4-javadoc.jar
|
||||
/dir8/dir3/commons-collections4-4.4-sources.jar
|
||||
/dir8/dir3/commons-collections4-4.4.jar
|
||||
/dir8/postgresql-42.7.3-javadoc.jar
|
||||
/dir8/postgresql-42.7.3-sources.jar
|
||||
/dir8/postgresql-42.7.3.jar""",
|
||||
FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
operation_purge
|
||||
|
@ -403,17 +693,34 @@ public class TestPurgeOperation {
|
|||
/dir1/commons-lang3-3.12.0-sources.jar
|
||||
/dir1/commons-lang3-3.12.0.jar
|
||||
/dir2
|
||||
/dir2/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/dir2/jakarta.servlet-api-6.0.0.jar
|
||||
/dir3
|
||||
/dir3/commons-collections4-4.4-sources.jar
|
||||
/dir3/commons-collections4-4.4.jar
|
||||
/dir2/commons-codec-1.17.0-sources.jar
|
||||
/dir2/commons-codec-1.17.0.jar
|
||||
/dir4
|
||||
/dir4/slf4j-api-2.0.6-sources.jar
|
||||
/dir4/slf4j-api-2.0.6.jar
|
||||
/dir4/dir9
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11.jar
|
||||
/dir4/dir9/jetty-http-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-http-12.0.11.jar
|
||||
/dir4/dir9/jetty-io-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-io-12.0.11.jar
|
||||
/dir4/dir9/jetty-security-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-security-12.0.11.jar
|
||||
/dir4/dir9/jetty-server-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-server-12.0.11.jar
|
||||
/dir4/dir9/jetty-session-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-session-12.0.11.jar
|
||||
/dir4/dir9/jetty-util-12.0.11-sources.jar
|
||||
/dir4/dir9/jetty-util-12.0.11.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12-sources.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12.jar
|
||||
/dir4/slf4j-simple-2.0.6-sources.jar
|
||||
/dir4/slf4j-simple-2.0.6.jar
|
||||
/dir5
|
||||
/dir5/dir10
|
||||
/dir5/dir10/jsoup-1.18.1-sources.jar
|
||||
/dir5/dir10/jsoup-1.18.1.jar
|
||||
/dir5/httpclient5-5.2.1-sources.jar
|
||||
/dir5/httpclient5-5.2.1.jar
|
||||
/dir5/httpcore5-5.2-sources.jar
|
||||
|
@ -421,7 +728,27 @@ public class TestPurgeOperation {
|
|||
/dir5/httpcore5-h2-5.2-sources.jar
|
||||
/dir5/httpcore5-h2-5.2.jar
|
||||
/dir5/slf4j-api-1.7.36-sources.jar
|
||||
/dir5/slf4j-api-1.7.36.jar""",
|
||||
/dir5/slf4j-api-1.7.36.jar
|
||||
/dir6
|
||||
/dir6/json-20240303-sources.jar
|
||||
/dir6/json-20240303.jar
|
||||
/dir7
|
||||
/dir7/core-3.5.3-sources.jar
|
||||
/dir7/core-3.5.3.jar
|
||||
/dir7/jai-imageio-core-1.4.0-sources.jar
|
||||
/dir7/jai-imageio-core-1.4.0.jar
|
||||
/dir7/javase-3.5.3-sources.jar
|
||||
/dir7/javase-3.5.3.jar
|
||||
/dir7/jcommander-1.82-sources.jar
|
||||
/dir7/jcommander-1.82.jar
|
||||
/dir8
|
||||
/dir8/checker-qual-3.42.0-sources.jar
|
||||
/dir8/checker-qual-3.42.0.jar
|
||||
/dir8/dir3
|
||||
/dir8/dir3/commons-collections4-4.4-sources.jar
|
||||
/dir8/dir3/commons-collections4-4.4.jar
|
||||
/dir8/postgresql-42.7.3-sources.jar
|
||||
/dir8/postgresql-42.7.3.jar""",
|
||||
FileUtils.generateDirectoryListing(tmp));
|
||||
|
||||
operation_purge
|
||||
|
@ -431,17 +758,38 @@ public class TestPurgeOperation {
|
|||
/dir1
|
||||
/dir1/commons-lang3-3.12.0.jar
|
||||
/dir2
|
||||
/dir2/jakarta.servlet-api-6.0.0.jar
|
||||
/dir3
|
||||
/dir3/commons-collections4-4.4.jar
|
||||
/dir2/commons-codec-1.17.0.jar
|
||||
/dir4
|
||||
/dir4/slf4j-api-2.0.6.jar
|
||||
/dir4/dir9
|
||||
/dir4/dir9/jakarta.servlet-api-6.0.0.jar
|
||||
/dir4/dir9/jetty-ee10-servlet-12.0.11.jar
|
||||
/dir4/dir9/jetty-http-12.0.11.jar
|
||||
/dir4/dir9/jetty-io-12.0.11.jar
|
||||
/dir4/dir9/jetty-security-12.0.11.jar
|
||||
/dir4/dir9/jetty-server-12.0.11.jar
|
||||
/dir4/dir9/jetty-session-12.0.11.jar
|
||||
/dir4/dir9/jetty-util-12.0.11.jar
|
||||
/dir4/dir9/slf4j-api-2.0.12.jar
|
||||
/dir4/slf4j-simple-2.0.6.jar
|
||||
/dir5
|
||||
/dir5/dir10
|
||||
/dir5/dir10/jsoup-1.18.1.jar
|
||||
/dir5/httpclient5-5.2.1.jar
|
||||
/dir5/httpcore5-5.2.jar
|
||||
/dir5/httpcore5-h2-5.2.jar
|
||||
/dir5/slf4j-api-1.7.36.jar""",
|
||||
/dir5/slf4j-api-1.7.36.jar
|
||||
/dir6
|
||||
/dir6/json-20240303.jar
|
||||
/dir7
|
||||
/dir7/core-3.5.3.jar
|
||||
/dir7/jai-imageio-core-1.4.0.jar
|
||||
/dir7/javase-3.5.3.jar
|
||||
/dir7/jcommander-1.82.jar
|
||||
/dir8
|
||||
/dir8/checker-qual-3.42.0.jar
|
||||
/dir8/dir3
|
||||
/dir8/dir3/commons-collections4-4.4.jar
|
||||
/dir8/postgresql-42.7.3.jar""",
|
||||
FileUtils.generateDirectoryListing(tmp));
|
||||
} finally {
|
||||
FileUtils.deleteDirectory(tmp);
|
||||
|
@ -465,29 +813,39 @@ public class TestPurgeOperation {
|
|||
project1.createProjectStructure();
|
||||
project1.repositories().add(Repository.MAVEN_CENTRAL);
|
||||
project1.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 1)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,1)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240205)));
|
||||
project1.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(5, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,14)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,4,0)));
|
||||
project1.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 3)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,3)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,4,5)));
|
||||
project1.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 0)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,0)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,6)));
|
||||
project1.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 0)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,0)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,15,3)));
|
||||
|
||||
var project2 = new TestProject(tmp);
|
||||
project2.createProjectStructure();
|
||||
project2.repositories().add(Repository.MAVEN_CENTRAL);
|
||||
project2.dependencies().scope(Scope.compile)
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3, 12, 0)));
|
||||
.include(new Dependency("org.apache.commons", "commons-lang3", new VersionNumber(3,12,0)))
|
||||
.include(new Module("org.json", "json", new VersionNumber(20240303)));
|
||||
project2.dependencies().scope(Scope.provided)
|
||||
.include(new Dependency("jakarta.servlet", "jakarta.servlet-api", new VersionNumber(6, 0, 0)));
|
||||
.include(new Dependency("commons-codec", "commons-codec", new VersionNumber(1,17,0)))
|
||||
.include(new Module("com.google.zxing", "javase", new VersionNumber(3,5,3)));
|
||||
project2.dependencies().scope(Scope.runtime)
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4, 4)));
|
||||
.include(new Dependency("org.apache.commons", "commons-collections4", new VersionNumber(4,4)))
|
||||
.include(new Module("org.postgresql", "postgresql", new VersionNumber(42,7,3)));
|
||||
project2.dependencies().scope(Scope.standalone)
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2, 0, 6)));
|
||||
.include(new Dependency("org.slf4j", "slf4j-simple", new VersionNumber(2,0,6)))
|
||||
.include(new Module("org.eclipse.jetty.ee10", "jetty-ee10-servlet", new VersionNumber(12,0,11)));
|
||||
project2.dependencies().scope(Scope.test)
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5, 2, 1)));
|
||||
.include(new Dependency("org.apache.httpcomponents.client5", "httpclient5", new VersionNumber(5,2,1)))
|
||||
.include(new Module("org.jsoup", "jsoup", new VersionNumber(1,18,1)));
|
||||
|
||||
new DownloadOperation()
|
||||
.fromProject(project1)
|
||||
|
@ -504,21 +862,81 @@ public class TestPurgeOperation {
|
|||
/lib/compile/commons-lang3-3.1.jar
|
||||
/lib/compile/commons-lang3-3.12.0-sources.jar
|
||||
/lib/compile/commons-lang3-3.12.0.jar
|
||||
/lib/compile/modules
|
||||
/lib/compile/modules/json-20240205-sources.jar
|
||||
/lib/compile/modules/json-20240205.jar
|
||||
/lib/compile/modules/json-20240303-sources.jar
|
||||
/lib/compile/modules/json-20240303.jar
|
||||
/lib/provided
|
||||
/lib/provided/jakarta.servlet-api-5.0.0-sources.jar
|
||||
/lib/provided/jakarta.servlet-api-5.0.0.jar
|
||||
/lib/provided/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/lib/provided/jakarta.servlet-api-6.0.0.jar
|
||||
/lib/provided/commons-codec-1.14-sources.jar
|
||||
/lib/provided/commons-codec-1.14.jar
|
||||
/lib/provided/commons-codec-1.17.0-sources.jar
|
||||
/lib/provided/commons-codec-1.17.0.jar
|
||||
/lib/provided/modules
|
||||
/lib/provided/modules/core-3.4.0-sources.jar
|
||||
/lib/provided/modules/core-3.4.0.jar
|
||||
/lib/provided/modules/core-3.5.3-sources.jar
|
||||
/lib/provided/modules/core-3.5.3.jar
|
||||
/lib/provided/modules/jai-imageio-core-1.4.0-sources.jar
|
||||
/lib/provided/modules/jai-imageio-core-1.4.0.jar
|
||||
/lib/provided/modules/javase-3.4.0-sources.jar
|
||||
/lib/provided/modules/javase-3.4.0.jar
|
||||
/lib/provided/modules/javase-3.5.3-sources.jar
|
||||
/lib/provided/modules/javase-3.5.3.jar
|
||||
/lib/provided/modules/jcommander-1.72-sources.jar
|
||||
/lib/provided/modules/jcommander-1.72.jar
|
||||
/lib/provided/modules/jcommander-1.82-sources.jar
|
||||
/lib/provided/modules/jcommander-1.82.jar
|
||||
/lib/runtime
|
||||
/lib/runtime/commons-collections4-4.3-sources.jar
|
||||
/lib/runtime/commons-collections4-4.3.jar
|
||||
/lib/runtime/commons-collections4-4.4-sources.jar
|
||||
/lib/runtime/commons-collections4-4.4.jar
|
||||
/lib/runtime/modules
|
||||
/lib/runtime/modules/checker-qual-3.42.0-sources.jar
|
||||
/lib/runtime/modules/checker-qual-3.42.0.jar
|
||||
/lib/runtime/modules/checker-qual-3.5.0-sources.jar
|
||||
/lib/runtime/modules/checker-qual-3.5.0.jar
|
||||
/lib/runtime/modules/postgresql-42.4.5-sources.jar
|
||||
/lib/runtime/modules/postgresql-42.4.5.jar
|
||||
/lib/runtime/modules/postgresql-42.7.3-sources.jar
|
||||
/lib/runtime/modules/postgresql-42.7.3.jar
|
||||
/lib/standalone
|
||||
/lib/standalone/slf4j-api-2.0.0-sources.jar
|
||||
/lib/standalone/slf4j-api-2.0.0.jar
|
||||
/lib/standalone/slf4j-api-2.0.6-sources.jar
|
||||
/lib/standalone/slf4j-api-2.0.6.jar
|
||||
/lib/standalone/modules
|
||||
/lib/standalone/modules/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/lib/standalone/modules/jakarta.servlet-api-6.0.0.jar
|
||||
/lib/standalone/modules/jetty-ee10-servlet-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-ee10-servlet-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-ee10-servlet-12.0.6-sources.jar
|
||||
/lib/standalone/modules/jetty-ee10-servlet-12.0.6.jar
|
||||
/lib/standalone/modules/jetty-http-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-http-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-http-12.0.6-sources.jar
|
||||
/lib/standalone/modules/jetty-http-12.0.6.jar
|
||||
/lib/standalone/modules/jetty-io-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-io-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-io-12.0.6-sources.jar
|
||||
/lib/standalone/modules/jetty-io-12.0.6.jar
|
||||
/lib/standalone/modules/jetty-security-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-security-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-security-12.0.6-sources.jar
|
||||
/lib/standalone/modules/jetty-security-12.0.6.jar
|
||||
/lib/standalone/modules/jetty-server-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-server-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-server-12.0.6-sources.jar
|
||||
/lib/standalone/modules/jetty-server-12.0.6.jar
|
||||
/lib/standalone/modules/jetty-session-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-session-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-session-12.0.6-sources.jar
|
||||
/lib/standalone/modules/jetty-session-12.0.6.jar
|
||||
/lib/standalone/modules/jetty-util-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-util-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-util-12.0.6-sources.jar
|
||||
/lib/standalone/modules/jetty-util-12.0.6.jar
|
||||
/lib/standalone/modules/slf4j-api-2.0.12-sources.jar
|
||||
/lib/standalone/modules/slf4j-api-2.0.12.jar
|
||||
/lib/standalone/modules/slf4j-api-2.0.9-sources.jar
|
||||
/lib/standalone/modules/slf4j-api-2.0.9.jar
|
||||
/lib/standalone/slf4j-simple-2.0.0-sources.jar
|
||||
/lib/standalone/slf4j-simple-2.0.0.jar
|
||||
/lib/standalone/slf4j-simple-2.0.6-sources.jar
|
||||
|
@ -538,6 +956,11 @@ public class TestPurgeOperation {
|
|||
/lib/test/httpcore5-h2-5.0.jar
|
||||
/lib/test/httpcore5-h2-5.2-sources.jar
|
||||
/lib/test/httpcore5-h2-5.2.jar
|
||||
/lib/test/modules
|
||||
/lib/test/modules/jsoup-1.15.3-sources.jar
|
||||
/lib/test/modules/jsoup-1.15.3.jar
|
||||
/lib/test/modules/jsoup-1.18.1-sources.jar
|
||||
/lib/test/modules/jsoup-1.18.1.jar
|
||||
/lib/test/slf4j-api-1.7.25-sources.jar
|
||||
/lib/test/slf4j-api-1.7.25.jar
|
||||
/lib/test/slf4j-api-1.7.36-sources.jar
|
||||
|
@ -565,15 +988,49 @@ public class TestPurgeOperation {
|
|||
/lib/compile
|
||||
/lib/compile/commons-lang3-3.12.0-sources.jar
|
||||
/lib/compile/commons-lang3-3.12.0.jar
|
||||
/lib/compile/modules
|
||||
/lib/compile/modules/json-20240303-sources.jar
|
||||
/lib/compile/modules/json-20240303.jar
|
||||
/lib/provided
|
||||
/lib/provided/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/lib/provided/jakarta.servlet-api-6.0.0.jar
|
||||
/lib/provided/commons-codec-1.17.0-sources.jar
|
||||
/lib/provided/commons-codec-1.17.0.jar
|
||||
/lib/provided/modules
|
||||
/lib/provided/modules/core-3.5.3-sources.jar
|
||||
/lib/provided/modules/core-3.5.3.jar
|
||||
/lib/provided/modules/jai-imageio-core-1.4.0-sources.jar
|
||||
/lib/provided/modules/jai-imageio-core-1.4.0.jar
|
||||
/lib/provided/modules/javase-3.5.3-sources.jar
|
||||
/lib/provided/modules/javase-3.5.3.jar
|
||||
/lib/provided/modules/jcommander-1.82-sources.jar
|
||||
/lib/provided/modules/jcommander-1.82.jar
|
||||
/lib/runtime
|
||||
/lib/runtime/commons-collections4-4.4-sources.jar
|
||||
/lib/runtime/commons-collections4-4.4.jar
|
||||
/lib/runtime/modules
|
||||
/lib/runtime/modules/checker-qual-3.42.0-sources.jar
|
||||
/lib/runtime/modules/checker-qual-3.42.0.jar
|
||||
/lib/runtime/modules/postgresql-42.7.3-sources.jar
|
||||
/lib/runtime/modules/postgresql-42.7.3.jar
|
||||
/lib/standalone
|
||||
/lib/standalone/slf4j-api-2.0.6-sources.jar
|
||||
/lib/standalone/slf4j-api-2.0.6.jar
|
||||
/lib/standalone/modules
|
||||
/lib/standalone/modules/jakarta.servlet-api-6.0.0-sources.jar
|
||||
/lib/standalone/modules/jakarta.servlet-api-6.0.0.jar
|
||||
/lib/standalone/modules/jetty-ee10-servlet-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-ee10-servlet-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-http-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-http-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-io-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-io-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-security-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-security-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-server-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-server-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-session-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-session-12.0.11.jar
|
||||
/lib/standalone/modules/jetty-util-12.0.11-sources.jar
|
||||
/lib/standalone/modules/jetty-util-12.0.11.jar
|
||||
/lib/standalone/modules/slf4j-api-2.0.12-sources.jar
|
||||
/lib/standalone/modules/slf4j-api-2.0.12.jar
|
||||
/lib/standalone/slf4j-simple-2.0.6-sources.jar
|
||||
/lib/standalone/slf4j-simple-2.0.6.jar
|
||||
/lib/test
|
||||
|
@ -583,6 +1040,9 @@ public class TestPurgeOperation {
|
|||
/lib/test/httpcore5-5.2.jar
|
||||
/lib/test/httpcore5-h2-5.2-sources.jar
|
||||
/lib/test/httpcore5-h2-5.2.jar
|
||||
/lib/test/modules
|
||||
/lib/test/modules/jsoup-1.18.1-sources.jar
|
||||
/lib/test/modules/jsoup-1.18.1.jar
|
||||
/lib/test/slf4j-api-1.7.36-sources.jar
|
||||
/lib/test/slf4j-api-1.7.36.jar
|
||||
/src
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue