Clean up win32/64 extraction

This commit is contained in:
Seth Goings 2014-08-28 15:46:10 -06:00
parent 214cecfbc5
commit 1be50ba412

View File

@ -117,19 +117,26 @@ model {
tasks { tasks {
platforms.each { platform -> platforms.each { platform ->
if(platform.operatingSystem.name == "windows") {
def artifactName = platform.architecture.name == "i386" ? 'win32' : 'win64'
task "extract${platform.name}"(type: Copy) {
from {
tarTree(configurations."${platform.name}".find { it.name =~ artifactName })
}
into "${libDir}/tools"
}
}
task "build${platform.name}"(type: Exec) { task "build${platform.name}"(type: Exec) {
executable "make" executable "make"
args "platform=${platform.operatingSystem.name}", args "platform=${platform.operatingSystem.name}",
"arch=${platform.architecture.name}" "arch=${platform.architecture.name}"
switch ( platform.name ) { if(platform.operatingSystem.name == "windows") {
case "windows-i386": dependsOn "extract${platform.name}"
dependsOn extractWin32 args "win32=${libDir}/tools/win32",
args "win32=${libDir}/tools/win32" "win64=${libDir}/tools/win64"
break }
case "windows-x86_64":
dependsOn extractWin64
args "win32=${libDir}/tools/win64"
break
environment JAVA_HOME: java_home environment JAVA_HOME: java_home
} }
@ -140,20 +147,6 @@ model {
} }
} }
task extractWin32(type: Copy) {
from {
tarTree(configurations."windows-i386".find { it.name =~ 'win32' })
}
into "${libDir}/tools"
}
task extractWin64(type: Copy) {
from {
tarTree(configurations."windows-x86_64".find { it.name =~ 'win64' })
}
into "${libDir}/tools"
}
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
sourceCompatibility = "1.6" sourceCompatibility = "1.6"
targetCompatibility = "1.6" targetCompatibility = "1.6"