Skip to content

Commit c94a3e0

Browse files
committed
no libs needed
1 parent e38f72f commit c94a3e0

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

mode/src/processing/mode/android/AndroidTool.java

+14-7
Original file line numberDiff line numberDiff line change
@@ -93,27 +93,34 @@ public String initLoader(String className) throws Exception {
9393
File[] toolArchives = Util.listJarFiles(toolDir);
9494
File[] libArchives = Util.listJarFiles(libDir);
9595

96-
if (toolArchives != null && toolArchives.length > 0 &&
97-
libArchives != null && libArchives.length > 0) {
98-
URL[] urlList = new URL[toolArchives.length + libArchives.length + 1];
96+
if (toolArchives != null && toolArchives.length > 0) {
97+
98+
int nArchives = toolArchives.length + 1;
99+
if (libArchives != null && libArchives.length > 0) {
100+
nArchives += libArchives.length;
101+
}
102+
URL[] urlList = new URL[nArchives];
99103

100104
int j;
101105
for (j = 0; j < toolArchives.length; j++) {
102106
Messages.log("Found archive " + toolArchives[j] + " for " + getName());
103107
urlList[j] = toolArchives[j].toURI().toURL();
104108
}
105-
for (int k = 0; k < libArchives.length; k++, j++) {
106-
Messages.log("Found archive " + libArchives[k] + " for " + getName());
107-
urlList[j] = libArchives[k].toURI().toURL();
109+
if (libArchives != null) {
110+
for (int k = 0; k < libArchives.length; k++, j++) {
111+
Messages.log("Found archive " + libArchives[k] + " for " + getName());
112+
urlList[j] = libArchives[k].toURI().toURL();
113+
}
108114
}
109115
urlList[urlList.length - 1] = new File(mode.getModeJar()).toURI().toURL();
110116

111-
112117
// String modePath = new File(dmode.getFolder(), "mode").getAbsolutePath();
113118
// urlList[urlList.length - 1] = new File(modePath + File.separator + "JavaMode.jar").toURI().toURL();
114119

115120
loader = new URLClassLoader(urlList);
116121
Messages.log("loading above JARs with loader " + loader);
122+
} else {
123+
throw new IgnorableException("Could not find any files inside " + toolDir.getAbsolutePath());
117124
}
118125
}
119126

0 commit comments

Comments
 (0)