Skip to content

New macosx build #2590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 3, 2015
Merged

New macosx build #2590

merged 4 commits into from
Feb 3, 2015

Conversation

ffissore
Copy link
Contributor

Upgraded appbundler, doubled build.xml targets so that it can package TWO macosx versions.
platform=oldmacosx packages the IDE the old way, with automatic installation of java6
platform=macosx packages the IDE so that it uses the most recent jre installed

Hopefully fixes many issues

@cmaglie

@Lauszus
Copy link
Contributor

Lauszus commented Feb 1, 2015

Just tested this on Mac 10.9.5 and it works fine.

@wayoda
Copy link

wayoda commented Feb 1, 2015

Please have a look at issue #1493 !

Your changes to file BaseNoGui.java tackle the same problem as in issue #1493

static public File getContentFile(String name) {
    File path = new File(System.getProperty("user.dir"));

    if (OSUtils.isMacOS()) {
      path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile();
    }

    return new File(path, name);
  }

Near the end of the discussion of #1493 there are solutions for for getting rid of the reference to System.getProperty("user.dir") on Windows and Linux .
The unanswered question remained : "Does this work on a Mac too?"
Well obviously it does.
This version of the above code should work fine on Windows, Linux and Mac

static public File getContentFile(String name) {
      path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile();
    return new File(path, name);
}

There are only 4 calls to System.getProperty("user.dir"),

  • 2 in BaseNoGui.java
  • 2 in src/processing/app/windows/Platform.java

They all can easily be replaced by BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().getPath().

Eberhard

@jlefevre2
Copy link

Just downloaded and tried the fix. It works fine now on Macs with the Oracle Java installs. Thanks

@wayoda
Copy link

wayoda commented Feb 1, 2015

I was wrong in :

Please have a look at issue #1493 !

My claim: This version of the above code should work fine on Windows, Linux and Mac

static public File getContentFile(String name) {
  path = new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile();
  return new File(path, name);
}

was wrong. On a Linux (and windows machine)

`new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile();` 

points into the lib-directory of the distributed app. To make the file point to the correct location (user.dir), another getParentFile()call needs to be added.

`new File(BaseNoGui.class.getProtectionDomain().getCodeSource().getLocation().getPath()).getParentFile().getParentFile();` 

now the file points to the root-dir of the arduino distribution

Sorry
Eberhard

@ffissore
Copy link
Contributor Author

ffissore commented Feb 2, 2015

Thanks everyone for the feedback :)
@wayoda new implementation of getContentFile uses BaseNoGui.class.getProtectionDomain()... only on mac. See this code portion. Does it make sense?

@wayoda
Copy link

wayoda commented Feb 2, 2015

@wayoda new implementation of getContentFile uses BaseNoGui.class.getProtectionDomain()...
only on mac. See this code portion. Does it make sense?

Yes, it does. I just got a bit carried away.... Sorry for the noise

@ffissore
Copy link
Contributor Author

ffissore commented Feb 2, 2015

This new build fixes an issue when the Arduino.app folder name had spaces, Arduino 2.app for example

@ffissore
Copy link
Contributor Author

ffissore commented Feb 3, 2015

If you're having issues with MacOSX, try this version
http://arduino.cc/download.php?f=/javaide/pull_requests/arduino-PR-2590-BUILD-142-macosxnew.zip

@cmaglie cmaglie merged commit 3303774 into arduino:ide-1.6.0 Feb 3, 2015
@ffissore ffissore deleted the ide-1.6.0-appbundler-and-java6 branch February 9, 2015 10:54
@PaulStoffregen
Copy link
Contributor

Should this page be updated with at least a mention about how to build the 2 different versions?

http://code.google.com/p/arduino/wiki/BuildingArduino

@ffissore
Copy link
Contributor Author

Yes, and we need to migrate those pages on github wiki. Opening a new issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants