Esempio n. 1
0
        public static CompilerOptions GetCompilerOptions(this Project project,
                                                         FrameworkName targetFramework,
                                                         string configurationName)
        {
            // Get all project options and combine them
            var rootOptions          = project.GetCompilerOptions();
            var configurationOptions = configurationName != null?project.GetCompilerOptions(configurationName) : null;

            var targetFrameworkOptions = targetFramework != null?project.GetCompilerOptions(targetFramework) : null;

            // Combine all of the options
            return(CompilerOptions.Combine(rootOptions, configurationOptions, targetFrameworkOptions));
        }
Esempio n. 2
0
 internal static CompilationProjectContext ToCompilationContext(this Project project, CompilationTarget target)
 {
     Debug.Assert(string.Equals(target.Name, project.Name, StringComparison.Ordinal), "The provided target should be for the current project!");
     return(new CompilationProjectContext(
                target,
                project.ProjectDirectory,
                project.ProjectFilePath,
                project.Version.GetNormalizedVersionString(),
                project.AssemblyFileVersion,
                project.EmbedInteropTypes,
                project.Files.GetCompilationFiles(),
                project.GetCompilerOptions(target.TargetFramework, target.Configuration)));
 }