From 7c6d04f1c51f4c727b6910eb7c06b08fdb4109cf Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 9 Nov 2016 18:49:19 +0100 Subject: [PATCH] [mtouch] Simplify code a bit by reusing existing logic. (#1148) --- tools/mtouch/Application.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/mtouch/Application.cs b/tools/mtouch/Application.cs index 59b314780b..8d915ba2ba 100644 --- a/tools/mtouch/Application.cs +++ b/tools/mtouch/Application.cs @@ -948,13 +948,7 @@ namespace Xamarin.Bundler { sb.Append ("Xamarin built applications contain open source software. "); sb.Append ("For detailed attribution and licensing notices, please visit..."); sb.AppendLine ().AppendLine ().Append ("http://xamarin.com/mobile-licensing").AppendLine (); - var filename = Path.Combine (AppDirectory, "NOTICE"); - if (!File.Exists (filename) || File.ReadAllText (filename) != sb.ToString ()) { - File.WriteAllText (Path.Combine (AppDirectory, "NOTICE"), sb.ToString ()); - Driver.Log (3, "Wrote '{0}'.", filename); - } else { - Driver.Log (3, "Target '{0}' is up-to-date.", filename); - } + Driver.WriteIfDifferent (Path.Combine (AppDirectory, "NOTICE"), sb.ToString ()); } catch (Exception ex) { throw new MonoTouchException (1017, true, ex, "Failed to create the NOTICE file: {0}", ex.Message); }