Example #1
0
        public virtual BuildEngine Build(IProcessFactory processFactory, IPackageTree packageTree, string mode)
        {
            if (builtPackages.ContainsKey(packageTree.Name))
            {
                return(this);
            }

            SetBuildMode(mode);

            string pathToBuildFile = string.Format("{0}", GetBuildFilePath(packageTree).QuotePath());

            if (GenerateStrongKey)
            {
                GenerateKeyFile(processFactory, packageTree);
            }

            CopyDependenciesTo(packageTree);

            var cmdLineArguments = BuildTool.CommandLineArguments(pathToBuildFile, this, packageTree, Version);

            var pathToBuildTool = string.Format("{0}", BuildTool.PathToBuildTool(packageTree, Version).QuotePath());

            ProcessBuild(packageTree, processFactory, pathToBuildTool, cmdLineArguments);

            CopyArtifactsToBuildDirectory(packageTree);

            builtPackages.Add(packageTree.Name, packageTree.Name);

            return(this);
        }