Example #1
0
 public static void CocoaPodUpdate(this ICakeContext context, DirectoryPath projectDirectory, CocoaPodUpdateSettings settings)
 {
     CocoaPodUpdate(context, projectDirectory, null, settings);
 }
Example #2
0
        public static void CocoaPodUpdate(this ICakeContext context, DirectoryPath projectDirectory, string[] podNames, CocoaPodUpdateSettings settings)
        {
            var r = new CocoaPodRunner(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools);

            r.Update(context, projectDirectory, podNames, settings);
        }
Example #3
0
        public void Update(ICakeContext context, DirectoryPath projectDirectory, string[] podNames, CocoaPodUpdateSettings settings)
        {
            if (settings == null)
            {
                settings = new CocoaPodUpdateSettings();
            }

            var version = GetVersion(settings);

            var builder = new ProcessArgumentBuilder();

            builder.Append("update");

            if (podNames != null && podNames.Length > 0)
            {
                foreach (var pn in podNames)
                {
                    builder.Append(pn);
                }
            }

            if (version < new Version(1, 0))
            {
                if (settings.NoClean)
                {
                    builder.Append("--no-clean");
                }

                if (settings.NoIntegrate)
                {
                    builder.Append("--no-integrate");
                }
            }
            else
            {
                if (settings.NoClean)
                {
                    Warn(context, "--no-clean is not a valid option for CocoaPods >= 1.0");
                }
                if (settings.NoIntegrate)
                {
                    Warn(context, "--no-integrate is not a valid option for CocoaPods >= 1.0"
                         + Environment.NewLine
                         + "Use `install! 'cocoapods', :integrate_targets => false` in your Podfile instead");
                }
            }

            if (settings.NoRepoUpdate)
            {
                builder.Append("--no-repo-update");
            }

            if (settings.Silent)
            {
                builder.Append("--silent");
            }

            if (settings.Verbose)
            {
                builder.Append("--verbose");
            }

            if (settings.NoAnsi)
            {
                builder.Append("--no-ansi");
            }

            if (projectDirectory != null)
            {
                builder.Append("--project-directory=" + projectDirectory.MakeAbsolute(_cakeEnvironment).FullPath.Quote());
            }

            if (settings.ToolPath == null)
            {
                Run(settings, builder);
            }
            else
            {
                Run(settings, builder, settings.ToolPath);
            }
        }