Skip to content

Commit

Permalink
use the osx binaries on mac osx 10.8 and onwards
Browse files Browse the repository at this point in the history
This commit will use the `workdir-osx` artifact to get the correct binaries for OS X Mountain Lion and newer versions.
  • Loading branch information
TheBoegl committed May 23, 2017
1 parent 95c1b53 commit b399475
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main/groovy/edu/sc/seis/launch4j/Launch4jPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Launch4jPlugin implements Plugin<Project> {
if (os.isWindows()) {
return 'workdir-win32'
} else if (os.isMacOsX()) {
return 'workdir-mac'
return "workdir-${isBelowMacOsX108() ? 'mac' : 'osx'}"
} else if (os.isLinux() || os.isUnix()) { // isUnix will also match MacOs, hence, call it as last resort
String arch = System.getProperty("os.arch")
if ("amd64".equals(arch) || "x86_64".equals(arch)) {
Expand All @@ -110,4 +110,11 @@ class Launch4jPlugin implements Plugin<Project> {
}
return ''
}

static boolean isBelowMacOsX108() {
def version = System.getProperty("os.version").split('\\.')
def major = version[0] as int
def minor = version[0] as int
return major < 10 || (major == 10 && minor < 8)
}
}

0 comments on commit b399475

Please sign in to comment.