-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] Parse R.txt int styleable IDs as base-t…
…en (#3396) Fixes: #3395 For some reason, `aapt` and `aapt2` generate base-ten numbers instead of hexadecimal numbers for the `int styleable` IDs in the `R.txt` file. All the other IDs are hexadecimal. Correct the managed resource parser to read the `int styleable` IDs as base-ten numbers instead of base-sixteen numbers. Adjust the generated comment text for `int styleable` IDs accordingly too. Add a test for this scenario, and update the expected outputs for the existing tests to account for the adjusted comment text.
- Loading branch information
1 parent
1bb9b02
commit 7c5d475
Showing
6 changed files
with
223 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
134 changes: 134 additions & 0 deletions
134
...Android.Build.Tests/Expected/GenerateDesignerFileWithElevenStyleableAttributesExpected.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
#pragma warning disable 1591 | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by a tool. | ||
// Runtime Version:4.0.30319.42000 | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
[assembly: global::Android.Runtime.ResourceDesignerAttribute("Foo.Foo.Resource", IsApplication=true)] | ||
|
||
namespace Foo.Foo | ||
{ | ||
|
||
|
||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] | ||
public partial class Resource | ||
{ | ||
|
||
static Resource() | ||
{ | ||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); | ||
} | ||
|
||
public partial class Attribute | ||
{ | ||
|
||
// aapt resource value: 0x7F010000 | ||
public const int attr00 = 2130771968; | ||
|
||
// aapt resource value: 0x7F010001 | ||
public const int attr01 = 2130771969; | ||
|
||
// aapt resource value: 0x7F010002 | ||
public const int attr02 = 2130771970; | ||
|
||
// aapt resource value: 0x7F010003 | ||
public const int attr03 = 2130771971; | ||
|
||
// aapt resource value: 0x7F010004 | ||
public const int attr04 = 2130771972; | ||
|
||
// aapt resource value: 0x7F010005 | ||
public const int attr05 = 2130771973; | ||
|
||
// aapt resource value: 0x7F010006 | ||
public const int attr06 = 2130771974; | ||
|
||
// aapt resource value: 0x7F010007 | ||
public const int attr07 = 2130771975; | ||
|
||
// aapt resource value: 0x7F010008 | ||
public const int attr08 = 2130771976; | ||
|
||
// aapt resource value: 0x7F010009 | ||
public const int attr09 = 2130771977; | ||
|
||
// aapt resource value: 0x7F01000A | ||
public const int attr10 = 2130771978; | ||
|
||
static Attribute() | ||
{ | ||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); | ||
} | ||
|
||
private Attribute() | ||
{ | ||
} | ||
} | ||
|
||
public partial class Styleable | ||
{ | ||
|
||
// aapt resource value: { 0x7F010000,0x7F010001,0x7F010002,0x7F010003,0x7F010004,0x7F010005,0x7F010006,0x7F010007,0x7F010008,0x7F010009,0x7F01000A } | ||
public static int[] ElevenAttributes = new int[] { | ||
2130771968, | ||
2130771969, | ||
2130771970, | ||
2130771971, | ||
2130771972, | ||
2130771973, | ||
2130771974, | ||
2130771975, | ||
2130771976, | ||
2130771977, | ||
2130771978}; | ||
|
||
// aapt resource value: 0 | ||
public const int ElevenAttributes_attr00 = 0; | ||
|
||
// aapt resource value: 1 | ||
public const int ElevenAttributes_attr01 = 1; | ||
|
||
// aapt resource value: 2 | ||
public const int ElevenAttributes_attr02 = 2; | ||
|
||
// aapt resource value: 3 | ||
public const int ElevenAttributes_attr03 = 3; | ||
|
||
// aapt resource value: 4 | ||
public const int ElevenAttributes_attr04 = 4; | ||
|
||
// aapt resource value: 5 | ||
public const int ElevenAttributes_attr05 = 5; | ||
|
||
// aapt resource value: 6 | ||
public const int ElevenAttributes_attr06 = 6; | ||
|
||
// aapt resource value: 7 | ||
public const int ElevenAttributes_attr07 = 7; | ||
|
||
// aapt resource value: 8 | ||
public const int ElevenAttributes_attr08 = 8; | ||
|
||
// aapt resource value: 9 | ||
public const int ElevenAttributes_attr09 = 9; | ||
|
||
// aapt resource value: 10 | ||
public const int ElevenAttributes_attr10 = 10; | ||
|
||
static Styleable() | ||
{ | ||
global::Android.Runtime.ResourceIdManager.UpdateIdValues(); | ||
} | ||
|
||
private Styleable() | ||
{ | ||
} | ||
} | ||
} | ||
} | ||
#pragma warning restore 1591 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters