ProjectAliases.

ParseProject(ICakeContext, FilePath) Method

Summary

Parses project information from project file
Namespace
Cake.Common.Solution.Project
Containing Type
ProjectAliases

Syntax

[CakeMethodAlias]
public static ProjectParserResult ParseProject(this ICakeContext context, FilePath projectPath)

Examples

var parsedProject = ParseProject("./src/Cake/Cake.csproj");
Information(
    @"    Parsed project file:
    Configuration         : {0}
    Platform              : {1}
    OutputType            : {2}
    OutputPath            : {3}
    RootNameSpace         : {4}
    AssemblyName          : {5}
    TargetFrameworkVersion: {6}
    Files                 : {7}",
    parsedProject.Configuration,
    parsedProject.Platform,
    parsedProject.OutputType,
    parsedProject.OutputPath,
    parsedProject.RootNameSpace,
    parsedProject.AssemblyName,
    parsedProject.TargetFrameworkVersion,
    string.Concat(
        parsedProject
            .Files
            .Select(
                file=>  string.Format(
                            "\r\n            {0}",
                            file.FilePath
                        )
            )
    )
);

Attributes

Type Description
CakeMethodAliasAttribute An attribute used to mark script method aliases.

Parameters

Name Type Description
context ICakeContext The context.
projectPath FilePath The project file path.

Return Value

Type Description
ProjectParserResult A parsed project.