fix Mac SDK selection

This commit is contained in:
Doug MacEachern 2009-08-18 13:20:17 -07:00
parent 75c2671110
commit a3260dc2fc
1 changed files with 2 additions and 8 deletions

View File

@ -21,7 +21,6 @@ package org.hyperic.jni;
import java.io.File; import java.io.File;
import java.io.FileFilter; import java.io.FileFilter;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator;
import org.apache.tools.ant.Task; import org.apache.tools.ant.Task;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
@ -97,16 +96,11 @@ public class ArchNameTask extends Task {
} }
}); });
if (sdks != null) { if (sdks != null) {
Arrays.sort(sdks, new Comparator() { Arrays.sort(sdks);
public int compare(Object s1, Object s2) {
return (int)(((File)s2).lastModified() -
((File)s1).lastModified());
}
});
final String prop = "uni.sdk"; final String prop = "uni.sdk";
String sdk = getProject().getProperty(prop); String sdk = getProject().getProperty(prop);
if (sdk == null) { if (sdk == null) {
sdk = sdks[0].getPath(); sdk = sdks[sdks.length-1].getPath();
getProject().setProperty(prop, sdk); getProject().setProperty(prop, sdk);
} }
System.out.println("Using SDK=" + sdk); System.out.println("Using SDK=" + sdk);