Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Android.App
{
partial class SupportsGLTextureAttribute
{
static ManifestDocumentElement<SupportsGLTextureAttribute> mapping = new ManifestDocumentElement<SupportsGLTextureAttribute> ("supports-gl-texture") {
static readonly ManifestDocumentElement<SupportsGLTextureAttribute> mapping = new ManifestDocumentElement<SupportsGLTextureAttribute> ("supports-gl-texture") {
{
"Name",
"name",
Expand Down
2 changes: 1 addition & 1 deletion src/Xamarin.Android.Build.Tasks/Tasks/Aapt2Link.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Xamarin.Android.Tasks {

//aapt2 link -o resources.apk.bk --manifest Foo.xml --java . --custom-package com.infinitespace_studios.blankforms -R foo2 -v --auto-add-overlay
public class Aapt2Link : Aapt2 {
static Regex exraArgSplitRegEx = new Regex (@"[\""].+?[\""]|[\''].+?[\'']|[^ ]+", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline);
static readonly Regex exraArgSplitRegEx = new Regex (@"[\""].+?[\""]|[\''].+?[\'']|[^ ]+", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Multiline);
public override string TaskPrefix => "A2L";

[Required]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CheckForInvalidResourceFileNames : AndroidTask {
Regex fileNameWithHyphenCheck = new Regex ("[^a-zA-Z0-9_.-]+", RegexOptions.Compiled);

// Source https://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html
static string [] javaKeywords = {
static readonly string [] javaKeywords = {
"abstract",
"assert",
"boolean",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class RemoveUnknownFiles : AndroidTask
{
public override string TaskPrefix => "RUF";

static bool IsWindows = Path.DirectorySeparatorChar == '\\';
static readonly bool IsWindows = Path.DirectorySeparatorChar == '\\';

[Required]
public ITaskItem[] Files { get; set; } = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Xamarin.Android.Tasks;

class JavaObjectsXmlFile
{
static XmlWriterSettings settings = new XmlWriterSettings {
static readonly XmlWriterSettings settings = new XmlWriterSettings {
Indent = true,
NewLineOnAttributes = false,
OmitXmlDeclaration = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public int Compare((int Key, CodeMemberField Value) x, (int Key, CodeMemberField
List<CodeTypeDeclaration> typeIds = new List<CodeTypeDeclaration> ();
Dictionary<CodeMemberField, CodeMemberField []> arrayMapping = new Dictionary<CodeMemberField, CodeMemberField []> ();
const string itemPackageId = "0x7f";
static CompareTuple compareTuple = new CompareTuple ();
static readonly CompareTuple compareTuple = new CompareTuple ();

XDocument publicXml;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ namespace Xamarin.Android.Tasks {

internal class ManifestDocument
{
public static XNamespace AndroidXmlNamespace = "http://schemas.android.com/apk/res/android";
public static XNamespace AndroidXmlToolsNamespace = "http://schemas.android.com/tools";
public static readonly XNamespace AndroidXmlNamespace = "http://schemas.android.com/apk/res/android";
public static readonly XNamespace AndroidXmlToolsNamespace = "http://schemas.android.com/tools";

const int maxVersionCode = 2100000000;

static XNamespace androidNs = AndroidXmlNamespace;
static XNamespace androidToolsNs = AndroidXmlToolsNamespace;
static readonly XNamespace androidNs = AndroidXmlNamespace;
static readonly XNamespace androidToolsNs = AndroidXmlToolsNamespace;
static readonly XName versionCodeAttributeName = androidNs + "versionCode";

XDocument doc;
Expand Down
2 changes: 1 addition & 1 deletion src/Xamarin.Android.Build.Tasks/Utilities/PathUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class PathUtil

internal const char VolumeSeparatorChar = ':';

static bool IsWindows = Path.DirectorySeparatorChar == '\\';
static readonly bool IsWindows = Path.DirectorySeparatorChar == '\\';
// Adapted from CoreFX sources
public static string GetRelativePath(string relativeTo, string path, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class ResourceIdentifier {
private const string Identifier = IdentifierStartCharacter + "(" + IdentifierPartCharacter + ")";

// We use [^ ...] to detect any character that is NOT a match.
static Regex validIdentifier = new Regex ($"[^{Identifier}]", RegexOptions.Compiled);
static readonly Regex validIdentifier = new Regex ($"[^{Identifier}]", RegexOptions.Compiled);

public static string CreateValidIdentifier (string identifier)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Xamarin.Android.Build.Tasks/Utilities/RtxtParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class RtxtParser {
TaskLoggingHelper? log;
Dictionary<string, string>? map;

public static HashSet<string> knownTypes = new HashSet<string> () {
public static readonly HashSet<string> knownTypes = new HashSet<string> () {
"anim",
"animator",
"attr",
Expand Down
Loading