task.source(sourceSet.getSource());
final Project project = task.getProject();
task.setOutputDir(project.file(String.valueOf(project.getBuildDir()) + "/objs/" + binary.getNamingScheme().getOutputDirectoryBase() + "/" + ((LanguageSourceSetInternal) sourceSet).getFullName()));
PreprocessingTool rcCompiler = (PreprocessingTool) ((ExtensionAware) binary).getExtensions().getByName("rcCompiler");
task.setMacros(rcCompiler.getMacros());
task.setCompilerArgs(rcCompiler.getArgs());
FileTree resourceOutputs = task.getOutputs().getFiles().getAsFileTree().matching(new PatternSet().include("**/*.res"));
binary.getTasks().getCreateOrLink().source(resourceOutputs);
if (binary instanceof StaticLibraryBinarySpecInternal) {
((StaticLibraryBinarySpecInternal) binary).additionalLinkFiles(resourceOutputs);