Skip to content

Commit

Permalink
Added a method to return the provided scope classpath JARs
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Nov 3, 2023
1 parent 0e6f988 commit 7435e13
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main/java/rife/bld/BaseProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,22 @@ public List<File> compileClasspathJars() {
return classpath;
}

/**
* Returns all the jar files that are in the provided scope classpath.
*
* @since 1.7.6
*/
public List<File> providedClasspathJars() {
// detect the jar files in the compile lib directory
var dir_abs = libCompileDirectory().getAbsoluteFile();
var jar_files = FileUtils.getFileList(dir_abs, INCLUDED_JARS, EXCLUDED_JARS);

// build the provided classpath
var classpath = new ArrayList<>(jar_files.stream().map(file -> new File(dir_abs, file)).toList());
addLocalDependencies(classpath, Scope.provided);
return classpath;
}

/**
* Returns all the jar files that are in the runtime scope classpath.
* <p>
Expand Down
1 change: 1 addition & 0 deletions src/test/java/rife/bld/TestProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void testInstantiation() {
assertNotNull(project.mainSourceFiles());
assertNotNull(project.testSourceFiles());
assertNotNull(project.compileClasspathJars());
assertNotNull(project.providedClasspathJars());
assertNotNull(project.runtimeClasspathJars());
assertNotNull(project.standaloneClasspathJars());
assertNotNull(project.testClasspathJars());
Expand Down
1 change: 1 addition & 0 deletions src/test/java/rife/bld/TestWebProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ void testInstantiation() {
assertNotNull(project.mainSourceFiles());
assertNotNull(project.testSourceFiles());
assertNotNull(project.compileClasspathJars());
assertNotNull(project.providedClasspathJars());
assertNotNull(project.runtimeClasspathJars());
assertNotNull(project.standaloneClasspathJars());
assertNotNull(project.testClasspathJars());
Expand Down

0 comments on commit 7435e13

Please sign in to comment.