Esempio n. 1
0
        // returns false if the assembly was not copied (because it was already up-to-date).
        public bool CopyAssembly(string source, string target, bool copy_debug_symbols = true, StripAssembly strip = null)
        {
            var copied = false;

            try {
                var strip_assembly = strip != null && strip(source);
                if (!Application.IsUptodate(source, target) && (strip_assembly || !Cache.CompareAssemblies(source, target)))
                {
                    copied = true;
                    if (strip_assembly)
                    {
                        Driver.FileDelete(target);
                        Directory.CreateDirectory(Path.GetDirectoryName(target));
                        MonoTouch.Tuner.Stripper.Process(source, target);
                    }
                    else
                    {
                        Application.CopyFile(source, target);
                    }
                }
                else
                {
                    Driver.Log(3, "Target '{0}' is up-to-date.", target);
                }

                // Update the debug symbols file even if the assembly didn't change.
                if (copy_debug_symbols)
                {
                    if (File.Exists(source + ".mdb"))
                    {
                        Application.UpdateFile(source + ".mdb", target + ".mdb", true);
                    }

                    var spdb = Path.ChangeExtension(source, "pdb");
                    if (File.Exists(spdb))
                    {
                        Application.UpdateFile(spdb, Path.ChangeExtension(target, "pdb"), true);
                    }
                }

                CopyConfigToDirectory(Path.GetDirectoryName(target));
            } catch (Exception e) {
                throw new MonoTouchException(1009, true, e, Errors.MX1009, source, target, e.Message);
            }

            return(copied);
        }
Esempio n. 2
0
        // returns false if the assembly was not copied (because it was already up-to-date).
        bool CopyAssembly(string source, string target)
        {
            // TODO - We should move to mtouch's code, shared in common
            var copied = false;

            try {
                if (!Application.IsUptodate(source, target))
                {
                    copied = true;
                    Application.CopyFile(source, target);
                }
            } catch (Exception e) {
                throw new ProductException(1009, true, e, Errors.MX1009, source, target, e.Message);
            }

            return(copied);
        }
Esempio n. 3
0
        // returns false if the assembly was not copied (because it was already up-to-date).
        bool CopyAssembly(string source, string target)
        {
            // TODO - We should move to mtouch's code, shared in common
            var copied = false;

            try {
                if (!Application.IsUptodate(source, target))
                {
                    copied = true;
                    Application.CopyFile(source, target);
                }
            } catch (Exception e) {
                throw new MonoMacException(1009, true, e, "Could not copy the assembly '{0}' to '{1}': {2}", source, target, e.Message);
            }

            return(copied);
        }
Esempio n. 4
0
		// returns false if the assembly was not copied (because it was already up-to-date).
		public bool CopyAssembly (string source, string target, bool copy_mdb = true)
		{
			var copied = false;

			try {
				if (!Application.IsUptodate (source, target) && !Cache.CompareAssemblies (source, target)) {
					copied = true;
					Application.CopyFile (source, target);
				}

				// Update the mdb even if the assembly didn't change.
				if (copy_mdb && File.Exists (source + ".mdb"))
					Application.UpdateFile (source + ".mdb", target + ".mdb", true);

				CopyConfigToDirectory (Path.GetDirectoryName (target));
			} catch (Exception e) {
				throw new MonoTouchException (1009, true, e, "Could not copy the assembly '{0}' to '{1}': {2}", source, target, e.Message);
			}

			return copied;
		}