From a6a9dfb0a62b4623e8020fe94ffe2288bfcc4668 Mon Sep 17 00:00:00 2001 From: German Laullon Date: Mon, 23 Mar 2015 11:15:58 +0100 Subject: [PATCH] build on OS X Yosemite. --- .gitignore | 3 +- bindings/java/build.xml | 2 +- bindings/java/hyperic_jni/jni-build.xml | 31 ++++++------------- .../src/org/hyperic/jni/ArchNameTask.java | 13 +++++++- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index 0ef7a1efa..fe4d8477d 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,5 @@ debian/files config.sub* config.guess* bindings/java/${dist} -bindings/python/build \ No newline at end of file +bindings/python/build +.DS_Store diff --git a/bindings/java/build.xml b/bindings/java/build.xml index d6d749dfb..7e509b526 100644 --- a/bindings/java/build.xml +++ b/bindings/java/build.xml @@ -96,7 +96,7 @@ diff --git a/bindings/java/hyperic_jni/jni-build.xml b/bindings/java/hyperic_jni/jni-build.xml index 38abedd99..c2461288d 100644 --- a/bindings/java/hyperic_jni/jni-build.xml +++ b/bindings/java/hyperic_jni/jni-build.xml @@ -161,7 +161,7 @@ @@ -224,37 +224,23 @@ - - - + - + - + - - - - - - - - - - - - - + - + - + @@ -372,6 +358,8 @@ + + @@ -379,7 +367,6 @@ dir="${jni.libset.dir}" libs="${jni.libset.libs}"/> - diff --git a/bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java b/bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java index 4cf53924f..fe0ed1e69 100644 --- a/bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java +++ b/bindings/java/hyperic_jni/src/org/hyperic/jni/ArchNameTask.java @@ -24,6 +24,7 @@ import java.io.FileReader; import java.io.Reader; import java.util.Arrays; +import java.util.Comparator; import org.apache.tools.ant.Task; import org.apache.tools.ant.BuildException; @@ -105,7 +106,17 @@ public boolean accept(File file) { }); if (sdks != null) { - Arrays.sort(sdks); + Arrays.sort(sdks, new Comparator() { + + @Override + public int compare(File o1, File o2) { + String name1 = o1.getName(); + String name2 = o2.getName(); + String v1 = name1.substring("MacOSX10.".length(),name1.length()-".sdk".length()); + String v2 = name2.substring("MacOSX10.".length(),name2.length()-".sdk".length()); + return Integer.parseInt(v1)-Integer.parseInt(v2); + } + }); String prop = "uni.sdk"; String sdk = getProject().getProperty(prop); String defaultMin = "10.3";