Search in sources :

Example 1 with StaticLibraryBinarySpecInternal

use of org.gradle.nativeplatform.internal.StaticLibraryBinarySpecInternal in project gradle by gradle.

the class WindowsResourcesCompileTaskConfig method configureResourceCompileTask.

private void configureResourceCompileTask(WindowsResourceCompile task, final NativeBinarySpecInternal binary, final WindowsResourceSet sourceSet) {
    task.setDescription("Compiles resources of the " + sourceSet + " of " + binary);
    task.setToolChain(binary.getToolChain());
    task.setTargetPlatform(binary.getTargetPlatform());
    task.includes(sourceSet.getExportedHeaders().getSourceDirectories());
    task.source(sourceSet.getSource());
    final Project project = task.getProject();
    task.setOutputDir(new File(binary.getNamingScheme().getOutputDirectory(project.getBuildDir(), "objs"), ((LanguageSourceSetInternal) sourceSet).getProjectScopedName()));
    PreprocessingTool rcCompiler = (PreprocessingTool) binary.getToolByName("rcCompiler");
    task.setMacros(rcCompiler.getMacros());
    task.setCompilerArgs(rcCompiler.getArgs());
    FileTree resourceOutputs = task.getOutputs().getFiles().getAsFileTree().matching(new PatternSet().include("**/*.res"));
    binary.binaryInputs(resourceOutputs);
    if (binary instanceof StaticLibraryBinarySpecInternal) {
        ((StaticLibraryBinarySpecInternal) binary).additionalLinkFiles(resourceOutputs);
    }
}
Also used : Project(org.gradle.api.Project) LanguageSourceSetInternal(org.gradle.language.base.internal.LanguageSourceSetInternal) PreprocessingTool(org.gradle.nativeplatform.PreprocessingTool) FileTree(org.gradle.api.file.FileTree) StaticLibraryBinarySpecInternal(org.gradle.nativeplatform.internal.StaticLibraryBinarySpecInternal) File(java.io.File) PatternSet(org.gradle.api.tasks.util.PatternSet)

Aggregations

File (java.io.File)1 Project (org.gradle.api.Project)1 FileTree (org.gradle.api.file.FileTree)1 PatternSet (org.gradle.api.tasks.util.PatternSet)1 LanguageSourceSetInternal (org.gradle.language.base.internal.LanguageSourceSetInternal)1 PreprocessingTool (org.gradle.nativeplatform.PreprocessingTool)1 StaticLibraryBinarySpecInternal (org.gradle.nativeplatform.internal.StaticLibraryBinarySpecInternal)1