Get targetPlatform from current tasks

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?

anyone have any ideas?

@daz @sterling @Gary_Hale ?

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).

I’m on 2.0, I might have to wait until I can get my project migrated to 2.3.
Thanks @sterling