public class JavaBuild extends Object
| Modifier and Type | Field and Description |
|---|---|
protected File |
binFolder |
protected Mode |
mode |
static String |
PACKAGE_REGEX |
protected Sketch |
sketch |
protected String |
sketchClassName |
protected File |
srcFolder |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addClasses(ZipOutputStream zos,
File dir) |
protected void |
addClasses(ZipOutputStream zos,
File dir,
String rootPath) |
protected void |
addDataFolder(ZipOutputStream zos) |
protected void |
addManifest(ZipOutputStream zos) |
String |
build(boolean sizeWarning)
Run the build inside a temporary build folder.
|
String |
build(File srcFolder,
File binFolder,
boolean sizeWarning)
Preprocess and compile all the code for this sketch.
|
protected boolean |
buildWindowsLauncher(File buildFile,
String target)
Run the launch4j build.xml file through ant to create the exe.
|
protected boolean |
exportApplication()
Export to application via GUI.
|
protected boolean |
exportApplication(File destFolder,
int exportPlatform,
String exportVariant,
boolean embedJava)
Export to application without GUI.
|
protected int |
findErrorFile(int errorLine) |
File |
getBinFolder() |
String |
getClassPath()
Class path determined during build.
|
boolean |
getFoundMain()
Whether the preprocessor found a main() method.
|
List<Library> |
getImportedLibraries()
Get the list of imported libraries.
|
String |
getJavaLibraryPath()
Return the java.library.path for this sketch (for all the native DLLs etc).
|
String |
getSketchClassName() |
String |
getSketchPath()
Absolute path to the sketch folder.
|
File |
getSrcFolder()
Path to the folder that will contain processed .java source files.
|
protected boolean |
ignorableImport(String pkg)
Returns true if this package isn't part of a library (it's a system import
or something like that).
|
protected static boolean |
isXcodeInstalled() |
protected void |
packClassPathIntoZipFile(String path,
ZipOutputStream zos,
HashMap<String,Object> zipFileContents)
Slurps up .class files from a colon (or semicolon on windows)
separated list of paths and adds them to a ZipOutputStream.
|
protected static void |
packClassPathIntoZipFileRecursive(File dir,
String sofar,
ZipOutputStream zos)
Continue the process of magical exporting.
|
SketchException |
placeException(String message,
String dotJavaFilename,
int dotJavaLine)
Map an error from a set of processed .java files back to its location
in the actual sketch.
|
String |
preprocess(File srcFolder,
boolean sizeWarning)
Build all the code for this sketch.
|
String |
preprocess(File srcFolder,
String packageName,
PdePreprocessor preprocessor,
boolean sizeWarning) |
public static final String PACKAGE_REGEX
protected Sketch sketch
protected Mode mode
protected File srcFolder
protected File binFolder
protected String sketchClassName
public JavaBuild(Sketch sketch)
public String build(boolean sizeWarning) throws SketchException
RunnerExceptionSketchExceptionpublic String build(File srcFolder, File binFolder, boolean sizeWarning) throws SketchException
SketchExceptionpublic String getSketchClassName()
public String preprocess(File srcFolder, boolean sizeWarning) throws SketchException
buildPath - Location to copy all the .java filesSketchExceptionpublic String preprocess(File srcFolder, String packageName, PdePreprocessor preprocessor, boolean sizeWarning) throws SketchException
srcFolder - location where the .java source files will be placedpackageName - null, or the package name that should be used as defaultpreprocessor - the preprocessor object ready to do the workSketchExceptionprotected boolean ignorableImport(String pkg)
protected int findErrorFile(int errorLine)
public File getSrcFolder()
public File getBinFolder()
public String getSketchPath()
public String getClassPath()
public String getJavaLibraryPath()
public boolean getFoundMain()
public List<Library> getImportedLibraries()
public SketchException placeException(String message, String dotJavaFilename, int dotJavaLine)
message - The error message.filename - The .java file where the exception was found.line - Line number of the .java file for the exception (0-indexed!)protected boolean exportApplication()
throws IOException,
SketchException
IOExceptionSketchExceptionprotected boolean exportApplication(File destFolder, int exportPlatform, String exportVariant, boolean embedJava) throws IOException, SketchException
IOExceptionSketchExceptionprotected static boolean isXcodeInstalled()
protected boolean buildWindowsLauncher(File buildFile, String target)
protected void addManifest(ZipOutputStream zos) throws IOException
IOExceptionprotected void addClasses(ZipOutputStream zos, File dir) throws IOException
IOExceptionprotected void addClasses(ZipOutputStream zos, File dir, String rootPath) throws IOException
IOExceptionprotected void addDataFolder(ZipOutputStream zos) throws IOException
IOExceptionprotected void packClassPathIntoZipFile(String path, ZipOutputStream zos, HashMap<String,Object> zipFileContents) throws IOException
IOExceptionprotected static void packClassPathIntoZipFileRecursive(File dir, String sofar, ZipOutputStream zos) throws IOException
IOExceptionCopyright © 2001–2017 Processing Foundation. All rights reserved.