示例#1
0
        private string GetArguments(RestorePackageArgs args)
        {
            var list = GetBaseArguments(args);

            if (args.OutputDirectory != null)
            {
                list.Add("-OutputDirectory \"{0}\"".F(args.OutputDirectory));
            }

            args.Sources.Each(s => list.Add("-Source \"{0}\"".F(s)));

            return(string.Join(" ", list));
        }
示例#2
0
        public void RestorePackage(BuildItem file, Action <RestorePackageArgs> config)
        {
            using (_tracer.StartTask("Nuget - Restore Package"))
            {
                var args = new RestorePackageArgs();
                if (config != null)
                {
                    config(args);
                }

                _tracer.Info("Restoring packages in '{0}'.", file);

                ExecNuget(
                    GetExecutable(args.ToolPath),
                    "restore \"{0}\" ".F(file) + GetArguments(args),
                    args.Timeout);
            }
        }