Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Gocke <angocke@microsoft.com>2021-06-17 23:26:10 +0300
committerGitHub <noreply@github.com>2021-06-17 23:26:10 +0300
commitc739a81ba553b00df1cb2f5b9974deae996b757a (patch)
tree0c75003cf42e28b2febc249218c27cb96616d359
parent078ffd5af9d29e21b37945897eec738ae74d3939 (diff)
Start sharing message strings between the analyzer and the linker (#2098)
Adds a shared file and shared resource files which get compiled into both the linker and the analyzer, to allow the two projects to share code.
-rw-r--r--src/ILLink.RoslynAnalyzer/ILLink.RoslynAnalyzer.csproj8
-rw-r--r--src/ILLink.RoslynAnalyzer/RequiresAnalyzerBase.cs9
-rw-r--r--src/ILLink.RoslynAnalyzer/RequiresAssemblyFilesAnalyzer.cs25
-rw-r--r--src/ILLink.RoslynAnalyzer/RequiresUnreferencedCodeAnalyzer.cs14
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.cs.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.de.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.es.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.fr.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.it.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.ja.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.ko.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.pl.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.pt-BR.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.ru.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.tr.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.zh-Hans.xlf47
-rw-r--r--src/ILLink.RoslynAnalyzer/xlf/Resources.zh-Hant.xlf47
-rw-r--r--src/ILLink.Shared/MessageFormat.cs24
-rw-r--r--src/ILLink.Shared/SharedStrings.resx (renamed from src/ILLink.RoslynAnalyzer/Resources.resx)0
-rw-r--r--src/linker/Linker.Steps/MarkStep.cs18
-rw-r--r--src/linker/Mono.Linker.csproj8
21 files changed, 71 insertions, 646 deletions
diff --git a/src/ILLink.RoslynAnalyzer/ILLink.RoslynAnalyzer.csproj b/src/ILLink.RoslynAnalyzer/ILLink.RoslynAnalyzer.csproj
index ee17e708f..3eb77b9cd 100644
--- a/src/ILLink.RoslynAnalyzer/ILLink.RoslynAnalyzer.csproj
+++ b/src/ILLink.RoslynAnalyzer/ILLink.RoslynAnalyzer.csproj
@@ -8,13 +8,19 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<!-- There are currently no translations, so the satellite assemblies are a waste of space. -->
<EnableXlfLocalization>false</EnableXlfLocalization>
+ <EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
</PropertyGroup>
<ItemGroup>
- <EmbeddedResource Include="Resources.resx" GenerateSource="true" />
<None Include="Microsoft.NET.ILLink.Analyzers.props" CopyToOutputDirectory="PreserveNewest" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" PrivateAssets="all" />
</ItemGroup>
+ <!-- Shared files with the linker -->
+ <ItemGroup>
+ <EmbeddedResource Include="../ILLink.Shared/SharedStrings.resx" GenerateSource="true" />
+ <Compile Include="../ILLink.Shared/**/*.cs" />
+ </ItemGroup>
+
</Project>
diff --git a/src/ILLink.RoslynAnalyzer/RequiresAnalyzerBase.cs b/src/ILLink.RoslynAnalyzer/RequiresAnalyzerBase.cs
index 73cf574e9..8fbeb7cab 100644
--- a/src/ILLink.RoslynAnalyzer/RequiresAnalyzerBase.cs
+++ b/src/ILLink.RoslynAnalyzer/RequiresAnalyzerBase.cs
@@ -5,6 +5,7 @@
using System;
using System.Collections.Immutable;
using System.Linq;
+using ILLink.Shared;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Operations;
@@ -186,12 +187,12 @@ namespace ILLink.RoslynAnalyzer
url));
}
- protected abstract string GetMessageFromAttribute (AttributeData? requiresAssemblyFilesAttribute);
+ protected abstract string GetMessageFromAttribute (AttributeData? requiresAttribute);
- private string GetUrlFromAttribute (AttributeData? requiresAssemblyFilesAttribute)
+ private string GetUrlFromAttribute (AttributeData? requiresAttribute)
{
- var url = requiresAssemblyFilesAttribute?.NamedArguments.FirstOrDefault (na => na.Key == "Url").Value.Value?.ToString ();
- return string.IsNullOrEmpty (url) ? "" : " " + url;
+ var url = requiresAttribute?.NamedArguments.FirstOrDefault (na => na.Key == "Url").Value.Value?.ToString ();
+ return MessageFormat.FormatRequiresAttributeUrlArg (url);
}
/// <summary>
diff --git a/src/ILLink.RoslynAnalyzer/RequiresAssemblyFilesAnalyzer.cs b/src/ILLink.RoslynAnalyzer/RequiresAssemblyFilesAnalyzer.cs
index 5d67b1099..3c6c136db 100644
--- a/src/ILLink.RoslynAnalyzer/RequiresAssemblyFilesAnalyzer.cs
+++ b/src/ILLink.RoslynAnalyzer/RequiresAssemblyFilesAnalyzer.cs
@@ -5,6 +5,7 @@
using System;
using System.Collections.Immutable;
using System.Linq;
+using ILLink.Shared;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
@@ -22,10 +23,10 @@ namespace ILLink.RoslynAnalyzer
static readonly DiagnosticDescriptor s_locationRule = new DiagnosticDescriptor (
IL3000,
- new LocalizableResourceString (nameof (Resources.AvoidAssemblyLocationInSingleFileTitle),
- Resources.ResourceManager, typeof (Resources)),
- new LocalizableResourceString (nameof (Resources.AvoidAssemblyLocationInSingleFileMessage),
- Resources.ResourceManager, typeof (Resources)),
+ new LocalizableResourceString (nameof (SharedStrings.AvoidAssemblyLocationInSingleFileTitle),
+ SharedStrings.ResourceManager, typeof (SharedStrings)),
+ new LocalizableResourceString (nameof (SharedStrings.AvoidAssemblyLocationInSingleFileMessage),
+ SharedStrings.ResourceManager, typeof (SharedStrings)),
DiagnosticCategory.SingleFile,
DiagnosticSeverity.Warning,
isEnabledByDefault: true,
@@ -33,10 +34,10 @@ namespace ILLink.RoslynAnalyzer
static readonly DiagnosticDescriptor s_getFilesRule = new DiagnosticDescriptor (
IL3001,
- new LocalizableResourceString (nameof (Resources.AvoidAssemblyGetFilesInSingleFileTitle),
- Resources.ResourceManager, typeof (Resources)),
- new LocalizableResourceString (nameof (Resources.AvoidAssemblyGetFilesInSingleFileMessage),
- Resources.ResourceManager, typeof (Resources)),
+ new LocalizableResourceString (nameof (SharedStrings.AvoidAssemblyGetFilesInSingleFileTitle),
+ SharedStrings.ResourceManager, typeof (SharedStrings)),
+ new LocalizableResourceString (nameof (SharedStrings.AvoidAssemblyGetFilesInSingleFileMessage),
+ SharedStrings.ResourceManager, typeof (SharedStrings)),
DiagnosticCategory.SingleFile,
DiagnosticSeverity.Warning,
isEnabledByDefault: true,
@@ -44,10 +45,10 @@ namespace ILLink.RoslynAnalyzer
static readonly DiagnosticDescriptor s_requiresAssemblyFilesRule = new DiagnosticDescriptor (
IL3002,
- new LocalizableResourceString (nameof (Resources.RequiresAssemblyFilesTitle),
- Resources.ResourceManager, typeof (Resources)),
- new LocalizableResourceString (nameof (Resources.RequiresAssemblyFilesMessage),
- Resources.ResourceManager, typeof (Resources)),
+ new LocalizableResourceString (nameof (SharedStrings.RequiresAssemblyFilesTitle),
+ SharedStrings.ResourceManager, typeof (SharedStrings)),
+ new LocalizableResourceString (nameof (SharedStrings.RequiresAssemblyFilesMessage),
+ SharedStrings.ResourceManager, typeof (SharedStrings)),
DiagnosticCategory.SingleFile,
DiagnosticSeverity.Warning,
isEnabledByDefault: true,
diff --git a/src/ILLink.RoslynAnalyzer/RequiresUnreferencedCodeAnalyzer.cs b/src/ILLink.RoslynAnalyzer/RequiresUnreferencedCodeAnalyzer.cs
index 60efd9693..b4a4123ea 100644
--- a/src/ILLink.RoslynAnalyzer/RequiresUnreferencedCodeAnalyzer.cs
+++ b/src/ILLink.RoslynAnalyzer/RequiresUnreferencedCodeAnalyzer.cs
@@ -4,6 +4,7 @@
using System;
using System.Collections.Immutable;
+using ILLink.Shared;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
@@ -18,10 +19,10 @@ namespace ILLink.RoslynAnalyzer
static readonly DiagnosticDescriptor s_requiresUnreferencedCodeRule = new DiagnosticDescriptor (
IL2026,
- new LocalizableResourceString (nameof (Resources.RequiresUnreferencedCodeTitle),
- Resources.ResourceManager, typeof (Resources)),
- new LocalizableResourceString (nameof (Resources.RequiresUnreferencedCodeMessage),
- Resources.ResourceManager, typeof (Resources)),
+ new LocalizableResourceString (nameof (SharedStrings.RequiresUnreferencedCodeTitle),
+ SharedStrings.ResourceManager, typeof (SharedStrings)),
+ new LocalizableResourceString (nameof (SharedStrings.RequiresUnreferencedCodeMessage),
+ SharedStrings.ResourceManager, typeof (SharedStrings)),
DiagnosticCategory.Trimming,
DiagnosticSeverity.Warning,
isEnabledByDefault: true);
@@ -50,10 +51,7 @@ namespace ILLink.RoslynAnalyzer
protected override string GetMessageFromAttribute (AttributeData? requiresAttribute)
{
var message = (string) requiresAttribute!.ConstructorArguments[0].Value!;
- if (!string.IsNullOrEmpty (message))
- message = $" {message}{(message.TrimEnd ().EndsWith (".") ? "" : ".")}";
-
- return message;
+ return MessageFormat.FormatRequiresAttributeMessageArg (message);
}
}
}
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.cs.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.cs.xlf
deleted file mode 100644
index 69bf11288..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.cs.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="cs" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.de.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.de.xlf
deleted file mode 100644
index 42535a8cc..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.de.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="de" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.es.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.es.xlf
deleted file mode 100644
index c1cda7fa6..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.es.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="es" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.fr.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.fr.xlf
deleted file mode 100644
index dc47d04b7..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.fr.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="fr" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.it.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.it.xlf
deleted file mode 100644
index 8b061e08c..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.it.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="it" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.ja.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.ja.xlf
deleted file mode 100644
index e0e7ee6be..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.ja.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="ja" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.ko.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.ko.xlf
deleted file mode 100644
index b2f7a110b..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.ko.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="ko" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.pl.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.pl.xlf
deleted file mode 100644
index 8051ec8b3..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.pl.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="pl" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.pt-BR.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.pt-BR.xlf
deleted file mode 100644
index 28266cf42..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.pt-BR.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="pt-BR" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.ru.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.ru.xlf
deleted file mode 100644
index 4f6444e94..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.ru.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="ru" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.tr.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.tr.xlf
deleted file mode 100644
index 992ae663d..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.tr.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="tr" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.zh-Hans.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.zh-Hans.xlf
deleted file mode 100644
index 3d87d8cc0..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.zh-Hans.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="zh-Hans" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/xlf/Resources.zh-Hant.xlf b/src/ILLink.RoslynAnalyzer/xlf/Resources.zh-Hant.xlf
deleted file mode 100644
index 9d1a3072d..000000000
--- a/src/ILLink.RoslynAnalyzer/xlf/Resources.zh-Hant.xlf
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
- <file datatype="xml" source-language="en" target-language="zh-Hant" original="../Resources.resx">
- <body>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileMessage">
- <source>'{0}' will throw for assemblies embedded in a single-file app</source>
- <target state="new">'{0}' will throw for assemblies embedded in a single-file app</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyGetFilesInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileMessage">
- <source>'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</source>
- <target state="new">'{0}' always returns an empty string for assemblies embedded in a single-file app. If the path to the app directory is needed, consider calling 'System.AppContext.BaseDirectory'.</target>
- <note />
- </trans-unit>
- <trans-unit id="AvoidAssemblyLocationInSingleFileTitle">
- <source>Avoid accessing Assembly file path when publishing as a single file</source>
- <target state="new">Avoid accessing Assembly file path when publishing as a single file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesMessage">
- <source>Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</source>
- <target state="new">Using member '{0}' which has 'RequiresAssemblyFilesAttribute' can break functionality when embedded in a single-file app.{1}{2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresAssemblyFilesTitle">
- <source>Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</source>
- <target state="new">Avoid calling members marked with 'RequiresAssemblyFilesAttribute' when publishing as a single-file</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeMessage">
- <source>Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</source>
- <target state="new">Using method '{0}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. {1}. {2}</target>
- <note />
- </trans-unit>
- <trans-unit id="RequiresUnreferencedCodeTitle">
- <source>Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</source>
- <target state="new">Methods annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code</target>
- <note />
- </trans-unit>
- </body>
- </file>
-</xliff> \ No newline at end of file
diff --git a/src/ILLink.Shared/MessageFormat.cs b/src/ILLink.Shared/MessageFormat.cs
new file mode 100644
index 000000000..32fa28302
--- /dev/null
+++ b/src/ILLink.Shared/MessageFormat.cs
@@ -0,0 +1,24 @@
+
+#nullable enable
+
+namespace ILLink.Shared
+{
+ internal static class MessageFormat
+ {
+ public static string FormatRequiresAttributeMessageArg (string? message)
+ {
+ string arg1 = "";
+ if (!string.IsNullOrEmpty (message))
+ arg1 = $" {message}{(message!.TrimEnd ().EndsWith (".") ? "" : ".")}";
+ return arg1;
+ }
+
+ public static string FormatRequiresAttributeUrlArg (string? url)
+ {
+ string arg2 = "";
+ if (!string.IsNullOrEmpty (url))
+ arg2 = " " + url;
+ return arg2;
+ }
+ }
+} \ No newline at end of file
diff --git a/src/ILLink.RoslynAnalyzer/Resources.resx b/src/ILLink.Shared/SharedStrings.resx
index 57a48e941..57a48e941 100644
--- a/src/ILLink.RoslynAnalyzer/Resources.resx
+++ b/src/ILLink.Shared/SharedStrings.resx
diff --git a/src/linker/Linker.Steps/MarkStep.cs b/src/linker/Linker.Steps/MarkStep.cs
index 23b44c37b..3e741f240 100644
--- a/src/linker/Linker.Steps/MarkStep.cs
+++ b/src/linker/Linker.Steps/MarkStep.cs
@@ -34,6 +34,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection.Runtime.TypeParsing;
using System.Text.RegularExpressions;
+using ILLink.Shared;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Collections.Generic;
@@ -1725,7 +1726,7 @@ namespace Mono.Linker.Steps
if (_context.Annotations.HasLinkerAttribute<RemoveAttributeInstancesAttribute> (type)) {
// Don't warn about references from the removed attribute itself (for example the .ctor on the attribute
- // will call MarkType on the attribute type itself).
+ // will call MarkType on the attribute type itself).
// If for some reason we do keep the attribute type (could be because of previous reference which would cause IL2045
// or because of a copy assembly with a reference and so on) then we should not spam the warnings due to the type itself.
if (!(reason.Source is IMemberDefinition sourceMemberDefinition && sourceMemberDefinition.DeclaringType == type))
@@ -2009,7 +2010,7 @@ namespace Mono.Linker.Steps
string methodName = realMatch.Substring (0, realMatch.Length - 2);
// It's a call to a method on some member. Handling this scenario robustly would be complicated and a decent bit of work.
- //
+ //
// We could implement support for this at some point, but for now it's important to make sure at least we don't crash trying to find some
// method on the current type when it exists on some other type
if (methodName.Contains ("."))
@@ -2751,13 +2752,10 @@ namespace Mono.Linker.Steps
return;
if (Annotations.TryGetLinkerAttribute (method, out RequiresUnreferencedCodeAttribute requiresUnreferencedCode)) {
- string message = $"Using method '{method.GetDisplayName ()}' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code.";
- if (!string.IsNullOrEmpty (requiresUnreferencedCode.Message))
- message += $" {requiresUnreferencedCode.Message}{(requiresUnreferencedCode.Message.TrimEnd ().EndsWith ('.') ? "" : ".")}";
-
- if (!string.IsNullOrEmpty (requiresUnreferencedCode.Url))
- message += " " + requiresUnreferencedCode.Url;
-
+ string formatString = SharedStrings.RequiresUnreferencedCodeMessage;
+ string arg1 = MessageFormat.FormatRequiresAttributeMessageArg (requiresUnreferencedCode.Message);
+ string arg2 = MessageFormat.FormatRequiresAttributeUrlArg (requiresUnreferencedCode.Url);
+ string message = string.Format (formatString, method.GetDisplayName (), arg1, arg2);
_context.LogWarning (message, 2026, currentOrigin, MessageSubCategory.TrimAnalysis);
}
}
@@ -2930,7 +2928,7 @@ namespace Mono.Linker.Steps
/// <summary>
/// Collect methods that must be marked once a type is determined to be instantiated.
///
- /// This method is virtual in order to give derived mark steps an opportunity to modify the collection of methods that are needed
+ /// This method is virtual in order to give derived mark steps an opportunity to modify the collection of methods that are needed
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
diff --git a/src/linker/Mono.Linker.csproj b/src/linker/Mono.Linker.csproj
index 4817c8751..4eda0c1fe 100644
--- a/src/linker/Mono.Linker.csproj
+++ b/src/linker/Mono.Linker.csproj
@@ -15,6 +15,8 @@
used for packages.config which we do not support. -->
<NoWarn>$(NoWarn);NU5131</NoWarn>
<RootNamespace>Mono.Linker</RootNamespace>
+ <!-- There are currently no translations, so the satellite assemblies are a waste of space. -->
+ <EnableXlfLocalization>false</EnableXlfLocalization>
</PropertyGroup>
<ItemGroup>
@@ -22,6 +24,12 @@
<Compile Include="..\..\external\corert\**\*.cs" />
</ItemGroup>
+ <!-- Shared files with analyzer -->
+ <ItemGroup>
+ <EmbeddedResource Include="../ILLink.Shared/SharedStrings.resx" GenerateSource="true" />
+ <Compile Include="../ILLink.Shared/**/*.cs" />
+ </ItemGroup>
+
<ItemGroup>
<PackageReference Condition="'$(UseCecilPackage)' == 'true'" Include="Mono.Cecil" Version="$(MonoCecilVersion)" />
<ProjectReference Condition="'$(UseCecilPackage)' != 'true'" Include="..\..\external\cecil\Mono.Cecil.csproj" />