GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — preprocess() method in JavaBuild returns PreprocessorResult object · D-I-R-M/processing4@ffc64d0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • java/src/processing/mode/java
    • JavaBuild.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎java/src/processing/mode/java/JavaBuild.java‎

Copy file name to clipboardExpand all lines: java/src/processing/mode/java/JavaBuild.java
+9-8Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ public String build(File srcFolder, File binFolder, boolean sizeWarning) throws
107107
this.binFolder = binFolder;
108108

109109
// run the preprocessor
110-
String classNameFound = preprocess(srcFolder, sizeWarning);
110+
PreprocessorResult result = preprocess(srcFolder, sizeWarning);
111+
String classNameFound = result.getClassName();
111112

112113
// compile the program. errors will happen as a RunnerException
113114
// that will bubble up to whomever called build().
@@ -139,7 +140,7 @@ public String getSketchClassName() {
139140
* @param srcFolder Location to copy all the .java files
140141
* @return null if compilation failed, main class name if not
141142
*/
142-
public String preprocess(File srcFolder, boolean sizeWarning) throws SketchException {
143+
public PreprocessorResult preprocess(File srcFolder, boolean sizeWarning) throws SketchException {
143144
PdePreprocessor preprocessor = PdePreprocessor.builderFor(sketch.getMainName()).build();
144145
return preprocess(srcFolder, null, preprocessor, sizeWarning);
145146
}
@@ -149,13 +150,13 @@ public String preprocess(File srcFolder, boolean sizeWarning) throws SketchExcep
149150
* @param srcFolder location where the .java source files will be placed
150151
* @param packageName null, or the package name that should be used as default
151152
* @param preprocessor the preprocessor object ready to do the work
152-
* @return main PApplet class name found during preprocess, or null if error
153+
* @return PreprocessorResult object containing the preprocessing results
153154
* @throws SketchException details of where the preprocessing failed
154155
*/
155-
public String preprocess(File srcFolder,
156-
String packageName,
157-
PdePreprocessor preprocessor,
158-
boolean sizeWarning) throws SketchException {
156+
public PreprocessorResult preprocess(File srcFolder,
157+
String packageName,
158+
PdePreprocessor preprocessor,
159+
boolean sizeWarning) throws SketchException {
159160
// make sure the user isn't playing "hide the sketch folder"
160161
sketch.ensureExistence();
161162

@@ -379,7 +380,7 @@ public String preprocess(File srcFolder,
379380
}
380381
}
381382
foundMain = preprocessor.hasMain();
382-
return result.getClassName();
383+
return result;
383384
}
384385

385386

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.