Skip to content

Commit

Permalink
moving this into JavaMode
Browse files Browse the repository at this point in the history
  • Loading branch information
benfry committed Aug 17, 2015
1 parent f0dc231 commit 8fdd5f7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
7 changes: 4 additions & 3 deletions app/src/processing/app/Mode.java
Original file line number Diff line number Diff line change
Expand Up @@ -937,9 +937,10 @@ public void prepareExportFolder(File targetFolder) {
// }


public String getSearchPath() {
return null;
}
// this is Java-specific, so keeping it in JavaMode
// public String getSearchPath() {
// return null;
// }


@Override
Expand Down
3 changes: 3 additions & 0 deletions build/shared/revisions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ the bugs. See "your contributions are funding graphics fixes," below.
+ Implement add(x, y) and sub(x, y) in PVector
https://github.com/processing/processing/issues/3593

+ Add method to JavaMode for search path
https://github.com/processing/processing/pull/3648


[ google summer of code ]

Expand Down
29 changes: 14 additions & 15 deletions java/src/processing/mode/java/pdex/ASTGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,34 +306,34 @@ protected void done() {
protected void loadJars() {
factory = new ClassPathFactory();

StringBuilder tehPath = new StringBuilder();
String modeClassPath = editor.getMode().getSearchPath();
StringBuilder path = new StringBuilder();
String modeClassPath = ((JavaMode) editor.getMode()).getSearchPath();
if (modeClassPath != null) {
tehPath.append(modeClassPath);
path.append(modeClassPath);
}

if (errorCheckerService.classpathJars != null) {
synchronized (errorCheckerService.classpathJars) {
for (URL jarPath : errorCheckerService.classpathJars) {
//log(jarPath.getPath());
tehPath.append(jarPath.getPath() + File.pathSeparatorChar);
path.append(jarPath.getPath() + File.pathSeparatorChar);
}
}
}

classPath = factory.createFromPath(tehPath.toString());
classPath = factory.createFromPath(path.toString());
log("Classpath created " + (classPath != null));
log("Sketch classpath jars loaded.");
if (Platform.isMacOS()) {
File f = new File(System.getProperty("java.home") + File.separator + "bundle"
+ File.separator + "Classes" + File.separator + "classes.jar");
log(f.getAbsolutePath() + " | classes.jar found?"
+ f.exists());
File f = new File(System.getProperty("java.home") +
File.separator + "bundle" +
File.separator + "Classes" +
File.separator + "classes.jar");
log(f.getAbsolutePath() + " | classes.jar found?" + f.exists());
} else {
File f = new File(System.getProperty("java.home") + File.separator
+ "lib" + File.separator + "rt.jar" + File.separator);
log(f.getAbsolutePath() + " | rt.jar found?"
+ f.exists());
File f = new File(System.getProperty("java.home") + File.separator +
"lib" + File.separator + "rt.jar" + File.separator);
log(f.getAbsolutePath() + " | rt.jar found?" + f.exists());
}
}

Expand Down Expand Up @@ -3523,8 +3523,7 @@ protected boolean ignorableImport(String impName, String fullClassName) {
if (impName.startsWith("processing")) {
if (JavaMode.suggestionsMap.get(processingInclude).contains(impName)) {
return false;
} else if (JavaMode.suggestionsMap.get(processingExclude)
.contains(impName)) {
} else if (JavaMode.suggestionsMap.get(processingExclude).contains(impName)) {
return true;
}
} else if (impName.startsWith("java")) {
Expand Down
2 changes: 2 additions & 0 deletions todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ X https://github.com/processing/processing/pull/3630
X Set font correctly in Contribution Manager dialog
X https://github.com/processing/processing/issues/3601
X https://github.com/processing/processing/pull/3626
X Add method to JavaMode for search path
X https://github.com/processing/processing/pull/3648

earlier
X closing the color selector makes things freeze (only Linux and Windows?)
Expand Down

0 comments on commit 8fdd5f7

Please sign in to comment.