mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
the Contents/Java switch ain't all that useful
This commit is contained in:
@@ -2355,14 +2355,16 @@ public class Base {
|
||||
// This works for Windows, Linux, and Apple's Java 6 on OS X.
|
||||
processingRoot = jarFolder.getParentFile();
|
||||
} else if (Base.isMacOS()) {
|
||||
// This works for Java 7 on OS X.
|
||||
// This works for Java 7 on OS X. The 'lib' folder is not part of the
|
||||
// classpath on OS X, and adding it creates more problems than it's
|
||||
// worth.
|
||||
processingRoot = jarFolder;
|
||||
}
|
||||
if (processingRoot == null || !processingRoot.exists()) {
|
||||
// Try working directory instead (user.dir, different from user.home)
|
||||
Base.log("Could not find lib folder via " +
|
||||
jarFolder.getAbsolutePath() +
|
||||
", switching to user.dir");
|
||||
System.err.println("Could not find lib folder via " +
|
||||
jarFolder.getAbsolutePath() +
|
||||
", switching to user.dir");
|
||||
processingRoot = new File(System.getProperty("user.dir"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@
|
||||
|
||||
<chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
|
||||
|
||||
<copy todir="macosx/work/Processing.app/Contents/Resources/Java/lib"
|
||||
<copy todir="macosx/work/Processing.app/Contents/Java/lib"
|
||||
flatten="true">
|
||||
<fileset refid="runtime.jars"/>
|
||||
</copy>
|
||||
@@ -515,12 +515,6 @@
|
||||
<delete file="processing.icns" />
|
||||
<delete file="pde.icns" />
|
||||
|
||||
<!-- Work around auto-included folder (from appbundler? or Oracle Java?)
|
||||
that causes the p5 Compiler to crash if it doesn't exist. -->
|
||||
<!--
|
||||
<mkdir dir="macosx/work/Processing.app/Contents/Java/Classes" />
|
||||
-->
|
||||
|
||||
<copy todir="macosx/work/Processing.app/Contents/Java">
|
||||
<fileset dir=".." includes="core/library/**" />
|
||||
<fileset dir="shared" includes="launch4j/**" />
|
||||
|
||||
@@ -142,17 +142,21 @@ int launch(char *commandName) {
|
||||
|
||||
// Set the class path
|
||||
NSString *mainBundlePath = [mainBundle bundlePath];
|
||||
NSString *javaPath = [mainBundlePath stringByAppendingString:@"/Contents/Java"];
|
||||
//NSMutableString *classPath = [NSMutableString stringWithFormat:@"-Djava.class.path=%@/Classes", javaPath];
|
||||
NSString *javaPath =
|
||||
[mainBundlePath stringByAppendingString:@"/Contents/Java"];
|
||||
// Changed Contents/Java to the old Contents/Resources/Java [fry]
|
||||
//[mainBundlePath stringByAppendingString:@"/Contents/Resources/Java"];
|
||||
// Removed the /Classes, because the P5 compiler (ECJ?) will throw an
|
||||
// error if it doesn't exist. But it's harmless to leave this as including
|
||||
// the root dir, since it will always exist, and I guess if you wanted to
|
||||
// put .class files in there, they'd work. If I knew more Cocoa, I'd just
|
||||
// make this an empty string to start, to be appended a few lines later.
|
||||
// error if it doesn't exist. But it's harmless to leave the root dir,
|
||||
// since it will always exist, and I guess if you wanted to put .class
|
||||
// files in there, they'd work. If I knew more Cocoa, I'd just make this
|
||||
// an empty string to start, to be appended a few lines later. [fry]
|
||||
//NSMutableString *classPath = [NSMutableString stringWithFormat:@"-Djava.class.path=%@/Classes", javaPath];
|
||||
NSMutableString *classPath = [NSMutableString stringWithFormat:@"-Djava.class.path=%@", javaPath];
|
||||
|
||||
NSFileManager *defaultFileManager = [NSFileManager defaultManager];
|
||||
NSArray *javaDirectoryContents = [defaultFileManager contentsOfDirectoryAtPath:javaPath error:nil];
|
||||
NSArray *javaDirectoryContents =
|
||||
[defaultFileManager contentsOfDirectoryAtPath:javaPath error:nil];
|
||||
if (javaDirectoryContents == nil) {
|
||||
[[NSException exceptionWithName:@JAVA_LAUNCH_ERROR
|
||||
reason:NSLocalizedString(@"JavaDirectoryNotFound", @UNSPECIFIED_ERROR)
|
||||
@@ -165,6 +169,21 @@ int launch(char *commandName) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// search the 'lib' subfolder as well [fry]
|
||||
NSString *libPath =
|
||||
[mainBundlePath stringByAppendingString:@"/Contents/Resources/Java/lib"];
|
||||
NSArray *libDirectoryContents =
|
||||
[defaultFileManager contentsOfDirectoryAtPath:libPath error:nil];
|
||||
if (libDirectoryContents != nil) {
|
||||
for (NSString *file in libDirectoryContents) {
|
||||
if ([file hasSuffix:@".jar"]) {
|
||||
[classPath appendFormat:@":%@/%@", libPath, file];
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Set the library path
|
||||
NSString *libraryPath = [NSString stringWithFormat:@"-Djava.library.path=%@/Contents/MacOS", mainBundlePath];
|
||||
|
||||
|
||||
@@ -330,6 +330,10 @@ public class AppBundlerTask extends Task {
|
||||
File resourcesDirectory = new File(contentsDirectory, "Resources");
|
||||
resourcesDirectory.mkdir();
|
||||
|
||||
// // Move back to Contents/Resources/Java instead of Contents/Java [fry]
|
||||
// File javaDirectory = new File(resourcesDirectory, "Java");
|
||||
// javaDirectory.mkdir();
|
||||
|
||||
// Generate Info.plist
|
||||
File infoPlistFile = new File(contentsDirectory, "Info.plist");
|
||||
infoPlistFile.createNewFile();
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
X MovieMaker needs to be compiling as 1.6
|
||||
X deal with null/missing folders for Tools and Modes
|
||||
X https://github.com/processing/processing/issues/2068
|
||||
o bad JS mode causing crash on startup
|
||||
X https://github.com/processing/processing/issues/2088
|
||||
X looks like issue that was covered in 2.0.3 changes
|
||||
|
||||
high
|
||||
_ remove video library for other platforms in download
|
||||
@@ -35,10 +38,11 @@ X the "Classes" folder is included
|
||||
X appears to be line 138 of main.m
|
||||
o maybe this is a holdover from OS X Java? don't know.
|
||||
_ icon location uses path, even when embedded
|
||||
_ add indents to the Info.plist output file
|
||||
_ inside writeInfoPlist from AppBundlerTask.java
|
||||
_ use Contents/Resources/Java instead of Contents/Java?
|
||||
_ this is in main.m. why the change?
|
||||
X add indents to the Info.plist output file
|
||||
X inside writeInfoPlist from AppBundlerTask.java
|
||||
o use Contents/Resources/Java instead of Contents/Java?
|
||||
o this is in main.m. why the change?
|
||||
X doesn't make any difference, just use Contents/Java
|
||||
_ any missing args from our app (copyrights/versions?)
|
||||
_ make sure it's only running on 64-bit machines?
|
||||
_ add MinimumSystemVersion?
|
||||
|
||||
Reference in New Issue
Block a user