Skip to content

Commit

Permalink
Merge pull request simpligility#197 from rtyley/oracle-mac-jdk
Browse files Browse the repository at this point in the history
Only use the Mac OS X JDK-path tweak if the path exists
  • Loading branch information
mosabua committed Apr 9, 2013
2 parents b46667a + ec49808 commit b3f7e8c
Showing 1 changed file with 12 additions and 2 deletions.
Expand Up @@ -502,10 +502,10 @@ private void collectLibraryInputFiles()
// that is shipped with the SDK (since that is not a complete Java distribution)
String javaHome = System.getProperty( "java.home" );
String jdkLibsPath = null;
if ( javaHome.startsWith( "/System/Library/Java" ) || javaHome.startsWith( "/Library/Java" ) )
if ( isMacOSXJDKbyApple( javaHome ) )
{
// MacOS X uses different naming conventions for JDK installations
jdkLibsPath = javaHome + "/../Classes";
jdkLibsPath = appleJDKLibsPath( javaHome );
addLibraryJar( jdkLibsPath + "/classes.jar" );
}
else
Expand Down Expand Up @@ -544,6 +544,16 @@ private void collectLibraryInputFiles()
}
}

private boolean isMacOSXJDKbyApple( String javaHome )
{
return ( javaHome.startsWith( "/System/Library/Java" ) || javaHome.startsWith( "/Library/Java" ) )
&& new File( appleJDKLibsPath( javaHome ) ).exists();
}

private String appleJDKLibsPath( String javaHome )
{
return javaHome + "/../Classes";
}

/**
* Get the path to the proguard jar.
Expand Down

0 comments on commit b3f7e8c

Please sign in to comment.