public override bool Execute() { // System.Diagnostics.Debugger.Launch(); var referenceCopyLocalPaths = ReferenceCopyLocalFiles.Select(x => x.ItemSpec).ToList(); var defineConstants = DefineConstants.GetConstants(); processor = new Processor { Logger = new BuildLogger { BuildEngine = BuildEngine, }, AssemblyFilePath = AssemblyFile, IntermediateDirectory = IntermediateDirectory, KeyFilePath = KeyOriginatorFile ?? AssemblyOriginatorKeyFile, SignAssembly = SignAssembly, ProjectDirectory = ProjectDirectory, DocumentationFilePath = DocumentationFile, References = References, SolutionDirectory = SolutionDirectoryFinder.Find(SolutionDirectory, NCrunchOriginalSolutionDirectory, ProjectDirectory), ReferenceCopyLocalPaths = referenceCopyLocalPaths, DefineConstants = defineConstants, NuGetPackageRoot = NuGetPackageRoot, MSBuildDirectory = MSBuildThisFileDirectory, WeaverFilesFromProps = GetWeaverFilesFromProps(), DebugSymbols = GetDebugSymbolsType() }; var success = processor.Execute(); if (success) { var weavers = processor.Weavers.Select(x => x.AssemblyName); ExecutedWeavers = string.Join(";", weavers) + ";"; File.WriteAllLines(IntermediateCopyLocalFilesCache, processor.ReferenceCopyLocalPaths); } else { if (File.Exists(IntermediateCopyLocalFilesCache)) { File.Delete(IntermediateCopyLocalFilesCache); } } return(success); }
public override bool Execute() { var defineConstants = DefineConstants.GetConstants(); var verifier = new Verifier { Logger = new BuildLogger { BuildEngine = BuildEngine, }, SolutionDirectory = SolutionDirectoryFinder.Find(SolutionDirectory, NCrunchOriginalSolutionDirectory, ProjectDirectory), ProjectDirectory = ProjectDirectory, DefineConstants = defineConstants, TargetPath = TargetPath, }; return(verifier.Verify()); }
public override bool Execute() { var referenceCopyLocalPaths = ReferenceCopyLocalFiles.Select(x => x.ItemSpec).ToList(); var defineConstants = DefineConstants.GetConstants(); var buildLogger = new BuildLogger { BuildEngine = BuildEngine, }; processor = new Processor { Logger = buildLogger, AssemblyFilePath = AssemblyFile, IntermediateDirectory = IntermediateDirectory, KeyFilePath = KeyOriginatorFile ?? AssemblyOriginatorKeyFile, SignAssembly = SignAssembly, ProjectDirectory = ProjectDirectory, DocumentationFilePath = DocumentationFile, References = References, SolutionDirectory = SolutionDirectoryFinder.Find(SolutionDirectory, NCrunchOriginalSolutionDirectory, ProjectDirectory), ReferenceCopyLocalPaths = referenceCopyLocalPaths, DefineConstants = defineConstants, NuGetPackageRoot = NuGetPackageRoot, MSBuildDirectory = MSBuildThisFileDirectory, WeaverFilesFromProps = GetWeaverFilesFromProps(), DebugSymbols = GetDebugSymbolsType(), GenerateXsd = GenerateXsd }; var success = processor.Execute(); if (success) { var weavers = processor.Weavers.Select(x => x.AssemblyName); ExecutedWeavers = string.Join(";", weavers) + ";"; try { File.WriteAllLines(IntermediateCopyLocalFilesCache, processor.ReferenceCopyLocalPaths); } catch (Exception ex) { buildLogger.LogInfo("ProjectDirectory: " + ProjectDirectory); buildLogger.LogInfo("IntermediateDirectory: " + IntermediateDirectory); buildLogger.LogInfo("CurrentDirectory: " + Directory.GetCurrentDirectory()); buildLogger.LogInfo("AssemblyFile: " + AssemblyFile); buildLogger.LogInfo("IntermediateCopyLocalFilesCache: " + IntermediateCopyLocalFilesCache); buildLogger.LogError("Error writing IntermediateCopyLocalFilesCache: " + ex.Message); return(false); } } else { if (File.Exists(IntermediateCopyLocalFilesCache)) { File.Delete(IntermediateCopyLocalFilesCache); } } return(success); }
public Task Find() => Verify(SolutionDirectoryFinder.Find(SourceFile));
public void ReturnNCrunchSolutionWhenPresent() { var result = SolutionDirectoryFinder.Find("Foo", "Baz", "Bar"); Assert.Equal("Baz", result); }
public void IgnoreUndefinedSolution() { var result = SolutionDirectoryFinder.Find("*Undefined*", null, Environment.CurrentDirectory); Assert.Equal(Path.GetDirectoryName(Environment.CurrentDirectory), result); }
public void ReturnProjectParentWhenSolutionIsEmpty() { var result = SolutionDirectoryFinder.Find(null, null, Environment.CurrentDirectory); Assert.Equal(Path.GetDirectoryName(Environment.CurrentDirectory), result); }
public Task Find() { return(Verifier.Verify(SolutionDirectoryFinder.Find(SourceFile))); }