Esempio n. 1
0
 private Exec PrepareExec(string command)
 {
     IBuildEngine2 mockEngine = new MockEngine(true);
     Exec exec = new Exec();
     exec.BuildEngine = mockEngine;
     exec.Command = command;
     return exec;
 }
Esempio n. 2
0
        public void SetEnvironmentVariableParameter()
        {
            Exec exec = new Exec();
            exec.BuildEngine = new MockEngine();
            exec.Command = "echo [%MYENVVAR%]";
            exec.EnvironmentVariables = new string[] { "myenvvar=myvalue" };
            exec.Execute();

            ((MockEngine)exec.BuildEngine).AssertLogContains("[myvalue]");
        }
Esempio n. 3
0
        public override bool Execute()
        {
            if (this.Frameworks == null)
            {
                return true;
            }

            // TODO: I18N
            this.Log.LogMessage("Copying frameworks");

            foreach (String name in this.Frameworks.Split(';'))
            {
                String path;

                // Probe system location
                path = String.Format("/System/Library/Frameworks/{0}.framework", name);
                if (Directory.Exists(path))
                {
                    goto copy;
                }
                path = String.Format("/Library/Frameworks/{0}.framework", name);
                if (Directory.Exists(path))
                {
                    goto copy;
                }
                path = String.Format("~/Library/Frameworks/{0}.framework", name);
                if (Directory.Exists(path))
                {
                    goto copy;
                }

                // TODO: I18N
                this.Log.LogError("Framework {0} not found", name);
                return false;
            copy:
                Exec exec = new Exec();
                exec.BuildEngine = this.BuildEngine;
                exec.Command = String.Format("rsync -rpl \"{0}\" \"{1}\"", path, this.ToDirectory.GetMetadata("FullPath"));
                exec.Execute();
            }

            return true;
        }
Esempio n. 4
0
 private static void Copy(String source, String destination)
 {
     Exec exec = new Exec();
     exec.BuildEngine = new ShallowBuildEngine();
     exec.Command = String.Format("rsync -rpl \"{0}\" \"{1}\"", source, destination);
     exec.Execute();
 }