Ejemplo n.º 1
0
        private ProjectFileInfo CreateProjectFileInfo(ErgonProjectInstance project)
        {
            var commandLineArgs = GetCommandLineArgs(project);

            var outputFilePath = project.ReadPropertyString(PropertyNames.TargetPath);

            if (!string.IsNullOrWhiteSpace(outputFilePath))
            {
                outputFilePath = GetAbsolutePathRelativeToProject(outputFilePath);
            }

            var outputRefFilePath = project.ReadPropertyString(PropertyNames.TargetRefPath);

            if (!string.IsNullOrWhiteSpace(outputRefFilePath))
            {
                outputRefFilePath = GetAbsolutePathRelativeToProject(outputRefFilePath);
            }

            // Right now VB doesn't have the concept of "default namespace". But we conjure one in workspace
            // by assigning the value of the project's root namespace to it. So various feature can choose to
            // use it for their own purpose.
            // In the future, we might consider officially exposing "default namespace" for VB project
            // (e.g. through a <defaultnamespace> msbuild property)
            var defaultNamespace = project.ReadPropertyString(PropertyNames.RootNamespace) ?? string.Empty;

            var targetFramework = project.ReadPropertyString(PropertyNames.TargetFramework);

            if (string.IsNullOrWhiteSpace(targetFramework))
            {
                targetFramework = null;
            }

            var docs = project.GetDocuments()
                       .Where(IsNotTemporaryGeneratedFile)
                       .Select(MakeDocumentFileInfo)
                       .ToImmutableArray();

            var additionalDocs = project.GetAdditionalFiles()
                                 .Select(MakeAdditionalDocumentFileInfo)
                                 .ToImmutableArray();

            return(ProjectFileInfo.Create(
                       Language,
                       project.FullPath,
                       outputFilePath,
                       outputRefFilePath,
                       defaultNamespace,
                       targetFramework,
                       commandLineArgs,
                       docs,
                       additionalDocs,
                       project.GetProjectReferences().ToImmutableArray(),
                       Log));
        }
Ejemplo n.º 2
0
        protected void ReadDebugInfo()
        {
            var emitDebugInfo = Project.ReadPropertyBool(PropertyNames.DebugSymbols);

            if (emitDebugInfo)
            {
                var debugType = Project.ReadPropertyString(PropertyNames.DebugType);
                if (debugType != null && s_debugTypeValues.TryGetValue(debugType, out var value))
                {
                    Add("debug", value);
                }
            }
        }
Ejemplo n.º 3
0
 public static TEnum?ReadPropertyEnum <TEnum>(this ErgonProjectInstance executedProject, string propertyName, bool ignoreCase)
     where TEnum : struct
 => Conversions.ToEnum <TEnum>(executedProject.ReadPropertyString(propertyName), ignoreCase);
Ejemplo n.º 4
0
 public static ulong ReadPropertyULong(this ErgonProjectInstance executedProject, string propertyName)
 => Conversions.ToULong(executedProject.ReadPropertyString(propertyName));
Ejemplo n.º 5
0
 public static int ReadPropertyInt(this ErgonProjectInstance executedProject, string propertyName)
 => Conversions.ToInt(executedProject.ReadPropertyString(propertyName));
Ejemplo n.º 6
0
 public static bool ReadPropertyBool(this ErgonProjectInstance executedProject, string propertyName)
 => Conversions.ToBool(executedProject.ReadPropertyString(propertyName));