Skip to content

Commit d1641a2

Browse files
authored
Also look into the modules folder for native jars (#1345)
1 parent 0491c4d commit d1641a2

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

app/src/processing/app/Library.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
package processing.app;
22

3-
import java.io.*;
4-
import java.util.*;
5-
import java.util.zip.ZipFile;
6-
7-
import processing.app.contrib.*;
8-
import processing.core.*;
3+
import processing.app.contrib.ContributionType;
4+
import processing.app.contrib.LocalContribution;
5+
import processing.core.PApplet;
96
import processing.data.StringDict;
107
import processing.data.StringList;
118

9+
import java.io.File;
10+
import java.io.FilenameFilter;
11+
import java.io.IOException;
12+
import java.util.*;
13+
import java.util.zip.ZipFile;
14+
1215

1316
public class Library extends LocalContribution {
1417
// static final String[] platformNames = PConstants.platformNames;
@@ -398,27 +401,24 @@ public String getJarPath() {
398401
// so that it can be appended to other paths safely
399402
public String getClassPath() {
400403
StringBuilder cp = new StringBuilder();
401-
402-
String[] jarHeads = libraryFolder.list(jarFilter);
403-
if (jarHeads != null) {
404-
for (String jar : jarHeads) {
405-
cp.append(File.pathSeparatorChar);
406-
cp.append(new File(libraryFolder, jar).getAbsolutePath());
407-
}
408-
}
404+
addJars(libraryFolder, cp);
409405
File nativeLibraryFolder = new File(nativeLibraryPath);
410406
if (!libraryFolder.equals(nativeLibraryFolder)) {
411-
jarHeads = new File(nativeLibraryPath).list(jarFilter);
412-
if (jarHeads != null) {
413-
for (String jar : jarHeads) {
414-
cp.append(File.pathSeparatorChar);
415-
cp.append(new File(nativeLibraryPath, jar).getAbsolutePath());
416-
}
417-
}
407+
addJars(nativeLibraryFolder, cp);
408+
addJars(new File(nativeLibraryFolder, "modules"), cp);
418409
}
419410
return cp.toString();
420411
}
421412

413+
private void addJars(File folder, StringBuilder cp) {
414+
String[] jarHeads = folder.list(jarFilter);
415+
if (jarHeads != null) {
416+
for (String jar : jarHeads) {
417+
cp.append(File.pathSeparatorChar);
418+
cp.append(new File(folder, jar).getAbsolutePath());
419+
}
420+
}
421+
}
422422

423423
public String getNativePath() {
424424
return nativeLibraryPath;

0 commit comments

Comments
 (0)