2
0
mirror of synced 2025-02-23 23:08:14 +00:00

18 Commits

Author SHA1 Message Date
Elias Naur
bcd28df570 all: fix non-standard "DO NOT EDIT" comments for generated files
In the spirit of CL 99955, fix all non-standard generated code
headers and re-run the generators. Some generated files needed
git gofmt afterwards, but that problem is left for now.

Change-Id: I6b3131fb1753dc427d05af03107031120755cab0
Reviewed-on: https://go-review.googlesource.com/99975
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-03-14 14:08:28 +00:00
Elias Naur
cdc07529f8 internal/binres: skip resources tests if android.jar of api 15 is missing
Change-Id: I1cf92bb03c420e1eddaa36824cf488c5ed6f5a78
Reviewed-on: https://go-review.googlesource.com/93998
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2018-02-21 20:21:33 +00:00
Daniel Skinner
eed0461ac2 cmd/gomobile: icon support for android
Provides support for resources.arsc generation enabling
the setting of an application icon.

If an asset/icon.png is encountered during build, then
the resources.arsc is generated to identify a single
xxxhdpi resource and the manifest will be updated to
reference resource as app icon.

References golang/go#9985

Change-Id: I9ef59fff45dcd612a41c479b2c679d22c094ab36
Reviewed-on: https://go-review.googlesource.com/30019
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2017-10-17 01:04:57 +00:00
Elias Naur
94417f6861 mobile/internal/binres: skip test if ANDROID_HOME is unset
Change-Id: I68ac06ad2f56dcd15e325a039c4d5d22ee1f862f
Reviewed-on: https://go-review.googlesource.com/20256
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-03-06 14:48:51 +00:00
Daniel Skinner
4e994ac070 internal/binres: use pkg binres for manifest encode
Current output byte-for-byte of pkg binres is close,
but not exact, to output of aapt.
The current exceptions to this are as follows:
 * sort order of certain attributes
 * typed value of minSdkVersion
These differences do not appear to affect the encoded
manifest from working correctly. Further details on
the byte differences can be seen in TestEncode.

Fixes golang/go#13109

Change-Id: Ibfb7731143f0e2baeeb7dd5b04aa649566606a53
Reviewed-on: https://go-review.googlesource.com/20030
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-03-05 06:30:01 +00:00
Daniel Skinner
0ee7f82d68 internal/binres: move test-related code out of package source
Change-Id: I5989c9395ff1aa40869ccd123cb277eea992a64c
Reviewed-on: https://go-review.googlesource.com/19991
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-03-03 05:14:23 +00:00
Daniel Skinner
1fb745cd55 internal/binres: encode manifest correctly for packaging
This fixes remaining issues that prevented use of package
to encode manifest for packaging correctly.

* Chunk headers are now encoded based on content
* Fixes for namespace and value fields
* Improved sorting based on native aapt output

Change-Id: Ic63046973a7b0431533463ed4dd2de50f1d73191
Reviewed-on: https://go-review.googlesource.com/19224
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-02-16 04:56:14 +00:00
Daniel Skinner
002f07f8be internal/binres: sort element attributes
Change-Id: I3ff6b98aa1c729600f154272b8250f673ae2778f
Reviewed-on: https://go-review.googlesource.com/19040
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-02-05 00:56:26 +00:00
Daniel Skinner
789dd7a15a internal/binres: provide validation for all remaining bootstrap resource types
Change-Id: I1f9b030e4230706ea5bbf9b7d9e1f398b93abe0b
Reviewed-on: https://go-review.googlesource.com/19005
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-02-05 00:56:17 +00:00
Daniel Skinner
c24337bea7 internal/binres: unmarshal map from xml
Change-Id: Ica95827fcf192f181b73fdf65b0158b8d3e24fdc
Reviewed-on: https://go-review.googlesource.com/18589
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-01-29 00:58:43 +00:00
Daniel Skinner
b8ddff8878 internal/binres: table marshal methods with pack func
The OpenTable func now references a prepacked version of the
resources.arsc file with a number of entries removed. The current
size of this file is 62KB. This could be dropped further by
implementing utf8 in string pool during marshal, utf16 encoding exploded
the original size by approximately 20%. Another potential improvement
is to allow type entries to be packed sparsely which may provide
significant savings if not zipping.

Change-Id: Ie139c2bdb0e3c5a9212516d18cf627d75774e187
Reviewed-on: https://go-review.googlesource.com/18649
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-01-25 00:55:53 +00:00
Daniel Skinner
db7fc23f7b internal/binres: unmarshal pool from xml doc, update tests to target api-15
Change-Id: Iaa13d4352ef88b58e805d5c0d8ee8a1e107db3c3
Reviewed-on: https://go-review.googlesource.com/18583
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-01-25 00:55:03 +00:00
Hyang-Ah Hana Kim
a99e944551 internal/binres: skip some tests if ANDROID_HOME is unset
Instead of failing.

Change-Id: I157f77aca1d02bfcdcf4f06278bcf5cc786834df
Reviewed-on: https://go-review.googlesource.com/18616
Reviewed-by: Daniel Skinner <daniel@dasa.cc>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2016-01-13 21:19:35 +00:00
Daniel Skinner
a4d9ded95b binres: update pool docs, minor update to node unmarshal
Change-Id: I03579fe0ae112c7a895fc7a9677c813b3d00caf4
Reviewed-on: https://go-review.googlesource.com/18582
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-01-13 15:47:56 +00:00
Daniel Skinner
f85352c0f7 binres: method for resolving name as tableref
Change-Id: If31bab76ccb5b03540d86356c74107fe5ec99be6
Reviewed-on: https://go-review.googlesource.com/18490
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-01-10 23:57:01 +00:00
Daniel Skinner
cc29d844e9 internal/binres: provide decoding of resources.arsc in platform sdk
This decodes enough information to allow validation of resource
names but not their values, though a simple method for querying
does not yet exist.

Change-Id: I32023f3de0eda390b12d5c1df6c06202ee4d0778
Reviewed-on: https://go-review.googlesource.com/18055
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-01-07 20:31:34 +00:00
Daniel Skinner
d6f00813f9 improve readability of Pool.UnmarshalBinary
Change-Id: If0a0ac668f910a8dd5a05b87e841403b8d390de1
Reviewed-on: https://go-review.googlesource.com/18121
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-01-07 20:28:16 +00:00
Daniel Skinner
c897050410 cmd/gomobile: new binary resource implementation
Change-Id: I9708170ac2c5914bb8e978b4703f4e6f7415c737
Reviewed-on: https://go-review.googlesource.com/16553
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-12-19 16:02:19 +00:00