From 78dcb51fe39ccfaa42832174ea11920616f1764e Mon Sep 17 00:00:00 2001 From: Chris Hamons Date: Mon, 15 Jun 2020 15:52:08 -0500 Subject: [PATCH] Remove notice from generated iOS Apps (#8857) - The notice points to an out of date page, currently dead (will be redirected soon) - https://github.com/xamarin/xamarin-macios/issues/8849 is the new home --- docs/website/mtouch-errors.md | 4 +++ tests/mtouch/MTouch.cs | 43 ----------------------------- tools/mtouch/Application.mtouch.cs | 32 --------------------- tools/mtouch/Errors.resx | 10 ------- tools/mtouch/xlf/Errors.cs.xlf | 18 +----------- tools/mtouch/xlf/Errors.de.xlf | 18 +----------- tools/mtouch/xlf/Errors.es.xlf | 18 +----------- tools/mtouch/xlf/Errors.fr.xlf | 18 +----------- tools/mtouch/xlf/Errors.it.xlf | 18 +----------- tools/mtouch/xlf/Errors.ja.xlf | 18 +----------- tools/mtouch/xlf/Errors.ko.xlf | 18 +----------- tools/mtouch/xlf/Errors.pl.xlf | 18 +----------- tools/mtouch/xlf/Errors.pt-BR.xlf | 18 +----------- tools/mtouch/xlf/Errors.ru.xlf | 18 +----------- tools/mtouch/xlf/Errors.tr.xlf | 18 +----------- tools/mtouch/xlf/Errors.zh-Hans.xlf | 18 +----------- tools/mtouch/xlf/Errors.zh-Hant.xlf | 18 +----------- 17 files changed, 17 insertions(+), 306 deletions(-) diff --git a/docs/website/mtouch-errors.md b/docs/website/mtouch-errors.md index 6459a38a02..cdb93afc58 100644 --- a/docs/website/mtouch-errors.md +++ b/docs/website/mtouch-errors.md @@ -1100,10 +1100,14 @@ This indicates a bug in Xamarin.iOS. Please file a new issue on [github](https:/ Remove the directory `NOTICE` from the project. +Earlier versions of our tools generated a NOTICE file. + ### MT1017: Failed to create the NOTICE file: *. +Earlier versions of our tools generated a NOTICE file. + ### MT1018: Your application failed code-signing checks and could not be installed on the device '*'. Check your certificates, provisioning profiles, and bundle ids. Probably your device is not part of the selected provisioning profile (error: 0xe8008015). diff --git a/tests/mtouch/MTouch.cs b/tests/mtouch/MTouch.cs index c040fa6ade..12a2ebb817 100644 --- a/tests/mtouch/MTouch.cs +++ b/tests/mtouch/MTouch.cs @@ -190,7 +190,6 @@ public class B : A {} var expectedFiles = new string [] { - "NOTICE", "testApp", "testApp.aotdata.armv7", "testApp.aotdata.arm64", @@ -319,7 +318,6 @@ public class B : A {} mtouch.GccFlags = "-v"; mtouch.AssertExecute (MTouchAction.BuildDev, "fourth build"); Console.WriteLine ("fourth build done"); - mtouch.AssertAllModified (dt, name + " - fourth build", "NOTICE"); } } @@ -2859,47 +2857,6 @@ public class TestApp { } } - [Test] - public void MT1016 () - { - AssertDeviceAvailable (); - - // #20607 - - using (var tool = new MTouchTool ()) { - tool.CreateTemporaryCacheDirectory (); - tool.CreateTemporaryApp (); - - // Create a NOTICE directory - var notice = Path.Combine (tool.AppPath, "NOTICE"); - Directory.CreateDirectory (notice); - - tool.AssertExecuteFailure (MTouchAction.BuildDev); - tool.AssertError (1016, "Failed to create the NOTICE file because a directory already exists with the same name."); - } - } - - [Test] - public void MT1017 () - { - AssertDeviceAvailable (); - - // #20607 - - using (var tool = new MTouchTool ()) { - tool.CreateTemporaryCacheDirectory (); - tool.CreateTemporaryApp (); - - // Create a readonly NOTICE file - var notice = Path.Combine (tool.AppPath, "NOTICE"); - File.WriteAllText (notice, "contents"); - new FileInfo (notice).IsReadOnly = true; - - tool.AssertExecute (MTouchAction.BuildDev); - Assert.AreNotEqual ("contents", File.ReadAllText (notice), "NOTICE file written successfully"); - } - } - [Test] public void MT1202 () { diff --git a/tools/mtouch/Application.mtouch.cs b/tools/mtouch/Application.mtouch.cs index aecafbf262..2975bf5ead 100644 --- a/tools/mtouch/Application.mtouch.cs +++ b/tools/mtouch/Application.mtouch.cs @@ -662,7 +662,6 @@ namespace Xamarin.Bundler { StripNativeCode (); BundleAssemblies (); - WriteNotice (); GenerateRuntimeOptions (); if (Cache.IsCacheTemporary) { @@ -1283,35 +1282,6 @@ namespace Xamarin.Bundler { } } - void WriteNotice () - { - if (!IsDeviceBuild || IsExtension) - return; - - if (Embeddinator) - return; - - WriteNotice (AppDirectory); - } - - void WriteNotice (string directory) - { - var path = Path.Combine (directory, "NOTICE"); - if (Directory.Exists (path)) - throw new ProductException (1016, true, Errors.MT1016); - - try { - // write license information inside the .app - StringBuilder sb = new StringBuilder (); - 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 (); - Driver.WriteIfDifferent (path, sb.ToString ()); - } catch (Exception ex) { - throw new ProductException (1017, true, ex, Errors.MT1017, ex.Message); - } - } - public static void CopyMSymData (string src, string dest) { if (string.IsNullOrEmpty (src) || string.IsNullOrEmpty (dest)) @@ -2024,8 +1994,6 @@ namespace Xamarin.Bundler { { if (!Embeddinator) return; - - WriteNotice (output_path); } public void CreateFrameworkInfoPList (string output_path, string framework_name, string bundle_identifier, string bundle_name) diff --git a/tools/mtouch/Errors.resx b/tools/mtouch/Errors.resx index 6781d83b02..514228f4b9 100644 --- a/tools/mtouch/Errors.resx +++ b/tools/mtouch/Errors.resx @@ -927,16 +927,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - Failed to create the NOTICE file: {0} - - - Could not copy the directory '{0}' to '{1}': {2} diff --git a/tools/mtouch/xlf/Errors.cs.xlf b/tools/mtouch/xlf/Errors.cs.xlf index 917fcae2dc..dc92711fce 100644 --- a/tools/mtouch/xlf/Errors.cs.xlf +++ b/tools/mtouch/xlf/Errors.cs.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.de.xlf b/tools/mtouch/xlf/Errors.de.xlf index 6024072327..b96e8f2e39 100644 --- a/tools/mtouch/xlf/Errors.de.xlf +++ b/tools/mtouch/xlf/Errors.de.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.es.xlf b/tools/mtouch/xlf/Errors.es.xlf index 542ce5726f..18828d3abe 100644 --- a/tools/mtouch/xlf/Errors.es.xlf +++ b/tools/mtouch/xlf/Errors.es.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.fr.xlf b/tools/mtouch/xlf/Errors.fr.xlf index 560a5e5523..6e2ebd6c74 100644 --- a/tools/mtouch/xlf/Errors.fr.xlf +++ b/tools/mtouch/xlf/Errors.fr.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.it.xlf b/tools/mtouch/xlf/Errors.it.xlf index e5b1061454..8d786e01c6 100644 --- a/tools/mtouch/xlf/Errors.it.xlf +++ b/tools/mtouch/xlf/Errors.it.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.ja.xlf b/tools/mtouch/xlf/Errors.ja.xlf index d99384890f..5874ebc3a0 100644 --- a/tools/mtouch/xlf/Errors.ja.xlf +++ b/tools/mtouch/xlf/Errors.ja.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.ko.xlf b/tools/mtouch/xlf/Errors.ko.xlf index bf75277199..8dcdc942c9 100644 --- a/tools/mtouch/xlf/Errors.ko.xlf +++ b/tools/mtouch/xlf/Errors.ko.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.pl.xlf b/tools/mtouch/xlf/Errors.pl.xlf index f47376cc2f..e644e83a8a 100644 --- a/tools/mtouch/xlf/Errors.pl.xlf +++ b/tools/mtouch/xlf/Errors.pl.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.pt-BR.xlf b/tools/mtouch/xlf/Errors.pt-BR.xlf index 1f6fa40a1c..9331ea31e7 100644 --- a/tools/mtouch/xlf/Errors.pt-BR.xlf +++ b/tools/mtouch/xlf/Errors.pt-BR.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.ru.xlf b/tools/mtouch/xlf/Errors.ru.xlf index 617e7a6129..289ca50412 100644 --- a/tools/mtouch/xlf/Errors.ru.xlf +++ b/tools/mtouch/xlf/Errors.ru.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.tr.xlf b/tools/mtouch/xlf/Errors.tr.xlf index 73f06ff98c..c1d4cd707c 100644 --- a/tools/mtouch/xlf/Errors.tr.xlf +++ b/tools/mtouch/xlf/Errors.tr.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.zh-Hans.xlf b/tools/mtouch/xlf/Errors.zh-Hans.xlf index 0f58ee093a..b5220b2a96 100644 --- a/tools/mtouch/xlf/Errors.zh-Hans.xlf +++ b/tools/mtouch/xlf/Errors.zh-Hans.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file + diff --git a/tools/mtouch/xlf/Errors.zh-Hant.xlf b/tools/mtouch/xlf/Errors.zh-Hant.xlf index 9b74034c62..4e2624f44b 100644 --- a/tools/mtouch/xlf/Errors.zh-Hant.xlf +++ b/tools/mtouch/xlf/Errors.zh-Hant.xlf @@ -1433,22 +1433,6 @@ - - Failed to create the NOTICE file because a directory already exists with the same name. - - Failed to create the NOTICE file because a directory already exists with the same name. - - - - - - Failed to create the NOTICE file: {0} - - Failed to create the NOTICE file: {0} - - - - Could not copy the directory '{0}' to '{1}': {2} @@ -3143,4 +3127,4 @@ - \ No newline at end of file +