Search in sources :

Example 1 with VisualStudioProjectFile

use of org.gradle.ide.visualstudio.tasks.internal.VisualStudioProjectFile in project gradle by gradle.

the class GenerateProjectFileTask method configure.

@Override
protected void configure(VisualStudioProjectFile projectFile) {
    DefaultVisualStudioProject vsProject = visualStudioProject;
    projectFile.setGradleCommand(buildGradleCommand());
    projectFile.setProjectUuid(DefaultVisualStudioProject.getUUID(getOutputFile()));
    projectFile.setVisualStudioVersion(visualStudioProject.getVisualStudioVersion().get());
    projectFile.setSdkVersion(visualStudioProject.getSdkVersion().get());
    for (File sourceFile : vsProject.getSourceFiles()) {
        projectFile.addSourceFile(sourceFile);
    }
    for (File resourceFile : vsProject.getResourceFiles()) {
        projectFile.addResource(resourceFile);
    }
    for (File headerFile : vsProject.getHeaderFiles()) {
        projectFile.addHeaderFile(headerFile);
    }
    if (vsProject.getConfigurations().stream().noneMatch(it -> it.isBuildable())) {
        getLogger().warn("'" + vsProject.getComponentName() + "' component in project '" + getProject().getPath() + "' is not buildable.");
    }
    for (VisualStudioProjectConfiguration configuration : vsProject.getConfigurations()) {
        projectFile.addConfiguration(configuration);
    }
    for (Action<? super XmlProvider> xmlAction : vsProject.getProjectFile().getXmlActions()) {
        getXmlTransformer().addAction(xmlAction);
    }
}
Also used : DefaultVisualStudioProject(org.gradle.ide.visualstudio.internal.DefaultVisualStudioProject) VisualStudioProjectConfiguration(org.gradle.ide.visualstudio.internal.VisualStudioProjectConfiguration) VisualStudioProjectFile(org.gradle.ide.visualstudio.tasks.internal.VisualStudioProjectFile) File(java.io.File) OutputFile(org.gradle.api.tasks.OutputFile)

Aggregations

File (java.io.File)1 OutputFile (org.gradle.api.tasks.OutputFile)1 DefaultVisualStudioProject (org.gradle.ide.visualstudio.internal.DefaultVisualStudioProject)1 VisualStudioProjectConfiguration (org.gradle.ide.visualstudio.internal.VisualStudioProjectConfiguration)1 VisualStudioProjectFile (org.gradle.ide.visualstudio.tasks.internal.VisualStudioProjectFile)1