public Context( PipExecutionContext pipContext, PipGraph pipGraph, IReadonlyDirectedGraph scheduledGraph, AbsolutePath configFilePath, IIdeConfiguration ideConfig) { Contract.Requires(pipGraph != null); Contract.Requires(scheduledGraph != null); Contract.Requires(configFilePath.IsValid); Contract.Requires(ideConfig.SolutionRoot.IsValid); Contract.Requires(ideConfig.SolutionName.IsValid); Contract.Requires(ideConfig.IsEnabled); Contract.Requires(!ideConfig.IsNewEnabled); PipGraph = pipGraph; ScheduledGraph = scheduledGraph; StringTable = pipContext.StringTable; PathTable = pipContext.PathTable; SymbolTable = pipContext.SymbolTable; QualifierTable = pipContext.QualifierTable; DotSettingsPathStr = ideConfig.DotSettingsFile.IsValid ? ideConfig.DotSettingsFile.ToString(PathTable) : null; ConfigFilePathStr = configFilePath.ToString(PathTable); EnlistmentRoot = configFilePath.GetParent(PathTable); EnlistmentRootStr = EnlistmentRoot.ToString(PathTable); SolutionRoot = ideConfig.SolutionRoot; SolutionRootStr = SolutionRoot.ToString(PathTable); SolutionFilePathStr = IdeGenerator.GetSolutionPath(ideConfig, PathTable).ToString(PathTable); CanWriteToSrc = ideConfig.CanWriteToSrc ?? false; ProjectsRoot = CanWriteToSrc ? EnlistmentRoot : SolutionRoot.Combine(PathTable, PathAtom.Create(PathTable.StringTable, "Projects")); ResxExtensionName = PathAtom.Create(StringTable, ".resx"); CscExeName = PathAtom.Create(StringTable, "csc.exe"); ResgenExeName = PathAtom.Create(StringTable, "ResGen.exe"); ResourcesExtensionName = PathAtom.Create(StringTable, ".resources"); CsExtensionName = PathAtom.Create(StringTable, ".cs"); DllExtensionName = PathAtom.Create(StringTable, ".dll"); ClExeName = PathAtom.Create(StringTable, "cl.exe"); LinkExeName = PathAtom.Create(StringTable, "Link.exe"); VsTestExeName = PathAtom.Create(StringTable, "vstest.console.exe"); AssemblyDeploymentTag = StringId.Create(StringTable, "assemblyDeployment"); TestDeploymentTag = StringId.Create(StringTable, "testDeployment"); }
/// <summary> /// Constructs an Ide Generator and generates the files /// </summary> public static bool Generate(PipExecutionContext pipContext, PipGraph pipGraph, IReadonlyDirectedGraph scheduledGraph, AbsolutePath configFilePath, IIdeConfiguration ideConfig) { var generator = new IdeGenerator(pipContext, pipGraph, scheduledGraph, configFilePath, ideConfig); return(generator.Generate()); }