adiaz004
(angel diaz)
April 9, 2015, 6:58pm
1
I’d like to tack on the target platform to the executable’s name.
for example, if I build my project on a 64-bit machine I want the name to be my_executable_x64
executables {
main {
baseName = project.name
targetPlatforms "x86", "x64"
}
}
Is there a way to capture what the current target platform is?
sterling
(Sterling Greene)
April 12, 2015, 11:50pm
4
The naming scheme is built into the plugin that makes it hard to change, but you can try something like this:
binaries.withType(NativeExecutableBinary) {
def outputDir = executableFile.parentFile
def exeName = platformToolProvider.getExecutableName("${component.baseName}${targetPlatform.name}")
executableFile = new File(outputDir, exeName)
}
platformToolProvider
is an internal API and might change (I tried this with 2.3).
adiaz004
(angel diaz)
April 14, 2015, 2:23pm
5
I’m on 2.0, I might have to wait until I can get my project migrated to 2.3.
Thanks @sterling