binariesOutputDir = new File(buildDir, "binaries");
}
public void execute(NativeBinarySpec nativeBinary) {
BinaryNamingScheme namingScheme = ((NativeBinarySpecInternal) nativeBinary).getNamingScheme();
PlatformToolProvider toolProvider = ((NativeBinarySpecInternal) nativeBinary).getPlatformToolProvider();
File binaryOutputDir = new File(binariesOutputDir, namingScheme.getOutputDirectoryBase());
String baseName = nativeBinary.getComponent().getBaseName();
if (nativeBinary instanceof NativeExecutableBinarySpec) {
((NativeExecutableBinarySpec) nativeBinary).setExecutableFile(new File(binaryOutputDir, toolProvider.getExecutableName(baseName)));
} else if (nativeBinary instanceof SharedLibraryBinarySpec) {
((SharedLibraryBinarySpec) nativeBinary).setSharedLibraryFile(new File(binaryOutputDir, toolProvider.getSharedLibraryName(baseName)));
((SharedLibraryBinarySpec) nativeBinary).setSharedLibraryLinkFile(new File(binaryOutputDir, toolProvider.getSharedLibraryLinkFileName(baseName)));
} else if (nativeBinary instanceof StaticLibraryBinarySpec) {
((StaticLibraryBinarySpec) nativeBinary).setStaticLibraryFile(new File(binaryOutputDir, toolProvider.getStaticLibraryName(baseName)));
}
}