示例#1
0
        public override bool Execute()
        {
            var referenceCopyLocalPaths = ReferenceCopyLocalPaths.Select(x => x.ItemSpec).ToList();
            var defineConstants         = DefineConstants.GetConstants();

            processor = new Processor
            {
                Logger = new BuildLogger
                {
                    BuildEngine = BuildEngine,
                },
                AssemblyFilePath        = AssemblyPath,
                IntermediateDirectory   = IntermediateDir,
                KeyFilePath             = KeyFilePath,
                SignAssembly            = SignAssembly,
                ProjectDirectory        = ProjectDirectory,
                References              = References,
                SolutionDirectory       = SolutionDir,
                ReferenceCopyLocalPaths = referenceCopyLocalPaths,
                DefineConstants         = defineConstants,
                NuGetPackageRoot        = NuGetPackageRoot,
                PackageDefinitions      = PackageDefinitions?.ToList()
            };
            var success = processor.Execute();

            if (success)
            {
                var weavers = processor.Weavers.Select(x => x.AssemblyName);
                ExecutedWeavers = string.Join(";", weavers) + ";";
            }

            return(success);
        }
示例#2
0
        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);
        }
示例#3
0
文件: VerifyTask.cs 项目: 0x53A/Fody
        public override bool Execute()
        {
            var defineConstants = DefineConstants.GetConstants();
            var verifier        = new Verifier
            {
                Logger = new BuildLogger
                {
                    BuildEngine = BuildEngine,
                },
                SolutionDirectory = SolutionDir,
                ProjectDirectory  = ProjectDirectory,
                DefineConstants   = defineConstants,
                TargetPath        = TargetPath,
            };

            return(verifier.Verify());
        }
示例#4
0
        public override bool Execute()
        {
            var defineConstants = DefineConstants.GetConstants();
            var verifier        = new Verifier
            {
                Logger = new BuildLogger
                {
                    BuildEngine = BuildEngine,
                },
                SolutionDirectory   = SolutionDirectoryFinder.Find(SolutionDirectory, NCrunchOriginalSolutionDirectory, ProjectDirectory),
                WeaverConfiguration = WeaverConfiguration,
                ProjectDirectory    = ProjectDirectory,
                DefineConstants     = defineConstants,
                TargetPath          = TargetPath,
            };

            return(verifier.Verify());
        }
示例#5
0
        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);
        }