|
1 | 1 | package processing.app; |
2 | 2 |
|
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; |
9 | 6 | import processing.data.StringDict; |
10 | 7 | import processing.data.StringList; |
11 | 8 |
|
| 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 | + |
12 | 15 |
|
13 | 16 | public class Library extends LocalContribution { |
14 | 17 | // static final String[] platformNames = PConstants.platformNames; |
@@ -398,27 +401,24 @@ public String getJarPath() { |
398 | 401 | // so that it can be appended to other paths safely |
399 | 402 | public String getClassPath() { |
400 | 403 | 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); |
409 | 405 | File nativeLibraryFolder = new File(nativeLibraryPath); |
410 | 406 | 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); |
418 | 409 | } |
419 | 410 | return cp.toString(); |
420 | 411 | } |
421 | 412 |
|
| 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 | + } |
422 | 422 |
|
423 | 423 | public String getNativePath() { |
424 | 424 | return nativeLibraryPath; |
|
0 commit comments