mirror of
https://github.com/processing/processing4.git
synced 2026-01-30 03:41:15 +01:00
cosmetic fixes and note-taking
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2012-15 The Processing Foundation
|
||||
Copyright (c) 2012-19 The Processing Foundation
|
||||
Copyright (c) 2008-12 Ben Fry and Casey Reas
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -42,8 +42,6 @@ import processing.mode.java.runner.Runner;
|
||||
|
||||
/**
|
||||
* Class to handle running Processing from the command line.
|
||||
*
|
||||
* @author fry
|
||||
*/
|
||||
public class Commander implements RunnerListener {
|
||||
static final String helpArg = "--help";
|
||||
@@ -65,7 +63,6 @@ public class Commander implements RunnerListener {
|
||||
static final int BUILD = 1;
|
||||
static final int RUN = 2;
|
||||
static final int PRESENT = 3;
|
||||
// static final int EXPORT_APPLET = 4;
|
||||
static final int EXPORT = 4;
|
||||
|
||||
Sketch sketch;
|
||||
@@ -74,19 +71,6 @@ public class Commander implements RunnerListener {
|
||||
PrintStream systemErr;
|
||||
|
||||
|
||||
static public void main(String[] args) {
|
||||
// Do this early so that error messages go to the console
|
||||
Base.setCommandLine();
|
||||
// init the platform so that prefs and other native code is ready to go
|
||||
Platform.init();
|
||||
// make sure a full JDK is installed
|
||||
//Base.initRequirements();
|
||||
|
||||
// launch command line handler
|
||||
new Commander(args);
|
||||
}
|
||||
|
||||
|
||||
public Commander(String[] args) {
|
||||
String sketchPath = null;
|
||||
File sketchFolder = null;
|
||||
@@ -152,7 +136,6 @@ public class Commander implements RunnerListener {
|
||||
embedJava = false;
|
||||
|
||||
} else if (arg.startsWith(platformArg)) {
|
||||
// complainAndQuit("The --platform option has been removed from Processing 2.1.", false);
|
||||
String platformStr = arg.substring(platformArg.length());
|
||||
platform = Platform.getIndex(platformStr);
|
||||
if (platform == -1) {
|
||||
@@ -160,17 +143,6 @@ public class Commander implements RunnerListener {
|
||||
"'windows', 'macosx', or 'linux'.", true);
|
||||
}
|
||||
|
||||
} else if (arg.startsWith(bitsArg)) {
|
||||
complainAndQuit("The --bits option has been removed.", false);
|
||||
// String bitsStr = arg.substring(bitsArg.length());
|
||||
// if (bitsStr.equals("32")) {
|
||||
// platformBits = 32;
|
||||
// } else if (bitsStr.equals("64")) {
|
||||
// platformBits = 64;
|
||||
// } else {
|
||||
// complainAndQuit("Bits should be either 32 or 64, not " + bitsStr, true);
|
||||
// }
|
||||
|
||||
} else if (arg.startsWith(sketchArg)) {
|
||||
sketchPath = arg.substring(sketchArg.length());
|
||||
sketchFolder = new File(sketchPath);
|
||||
@@ -199,13 +171,6 @@ public class Commander implements RunnerListener {
|
||||
}
|
||||
String[] sketchArgs = PApplet.subset(args, argOffset);
|
||||
|
||||
// if ((outputPath == null) &&
|
||||
// (task == PREPROCESS || task == BUILD ||
|
||||
// task == RUN || task == PRESENT)) {
|
||||
// complainAndQuit("An output path must be specified when using " +
|
||||
// preprocArg + ", " + buildArg + ", " +
|
||||
// runArg + ", or " + presentArg + ".");
|
||||
// }
|
||||
if (task == HELP) {
|
||||
printCommandLine(systemOut);
|
||||
System.exit(0);
|
||||
@@ -256,8 +221,6 @@ public class Commander implements RunnerListener {
|
||||
|
||||
boolean success = false;
|
||||
|
||||
// JavaMode javaMode =
|
||||
// new JavaMode(null, Base.getContentFile("modes/java"));
|
||||
JavaMode javaMode = (JavaMode)
|
||||
ModeContribution.load(null, Platform.getContentFile("modes/java"),
|
||||
"processing.mode.java.JavaMode").getMode();
|
||||
@@ -389,9 +352,6 @@ public class Commander implements RunnerListener {
|
||||
out.println("--no-java Do not embed Java. Use at your own risk!");
|
||||
out.println("--platform Specify the platform (export to application only).");
|
||||
out.println(" Should be one of 'windows', 'macosx', or 'linux'.");
|
||||
// out.println("--bits Must be specified if libraries are used that are");
|
||||
// out.println(" 32- or 64-bit specific such as the OpenGL library.");
|
||||
// out.println(" Otherwise specify 0 or leave it out.");
|
||||
|
||||
out.println();
|
||||
out.println("The --build, --run, --present, or --export must be the final parameter");
|
||||
@@ -406,22 +366,31 @@ public class Commander implements RunnerListener {
|
||||
|
||||
|
||||
@Override
|
||||
public void startIndeterminate() {
|
||||
}
|
||||
public void startIndeterminate() { }
|
||||
|
||||
|
||||
@Override
|
||||
public void stopIndeterminate() {
|
||||
}
|
||||
public void stopIndeterminate() { }
|
||||
|
||||
|
||||
@Override
|
||||
public void statusHalt() {
|
||||
}
|
||||
public void statusHalt() { }
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isHalted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static public void main(String[] args) {
|
||||
// Do this early so that error messages go to the console
|
||||
Base.setCommandLine();
|
||||
|
||||
// init the platform so that prefs and other native code is ready to go
|
||||
Platform.init();
|
||||
|
||||
// launch command line handler
|
||||
new Commander(args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,6 @@ import java.io.*;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
|
||||
//import org.eclipse.jdt.core.compiler.batch.BatchCompiler;
|
||||
//import org.eclipse.jdt.core.compiler.CompilationProgress;
|
||||
|
||||
|
||||
public class Compiler {
|
||||
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
||||
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2012-19 The Processing Foundation
|
||||
Copyright (c) 2004-12 Ben Fry and Casey Reas
|
||||
Copyright (c) 2001-04 Massachusetts Institute of Technology
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package processing.mode.java;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2010-11 Ben Fry and Casey Reas
|
||||
Copyright (c) 2012-15 The Processing Foundation
|
||||
Copyright (c) 2012-19 The Processing Foundation
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
@@ -37,6 +37,7 @@ import processing.app.*;
|
||||
import processing.app.ui.Editor;
|
||||
import processing.app.ui.EditorException;
|
||||
import processing.app.ui.EditorState;
|
||||
|
||||
import processing.mode.java.runner.Runner;
|
||||
import processing.mode.java.tweak.SketchParser;
|
||||
|
||||
|
||||
@@ -20,22 +20,31 @@ along with this program; if not, write to the Free Software Foundation, Inc.
|
||||
|
||||
package processing.mode.java.pdex.util;
|
||||
|
||||
import com.google.classpath.ClassPathFactory;
|
||||
import processing.app.*;
|
||||
import processing.mode.java.JavaMode;
|
||||
import processing.mode.java.pdex.ImportStatement;
|
||||
import processing.mode.java.pdex.PreprocessedSketch;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.StringJoiner;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.google.classpath.ClassPathFactory;
|
||||
|
||||
import processing.app.Library;
|
||||
import processing.app.Messages;
|
||||
import processing.app.Sketch;
|
||||
import processing.app.SketchException;
|
||||
import processing.app.Util;
|
||||
import processing.mode.java.JavaMode;
|
||||
import processing.mode.java.pdex.ImportStatement;
|
||||
import processing.mode.java.pdex.PreprocessedSketch;
|
||||
|
||||
|
||||
/**
|
||||
* Builder which generates runtime paths using a series of caches.
|
||||
|
||||
Reference in New Issue
Block a user