fix Mac SDK selection
This commit is contained in:
parent
6500952e5b
commit
315c8474d9
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue