Commit Graph

23 Commits

Author SHA1 Message Date
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
Hyang-Ah Hana Kim 0951da6cb2 bind/java, internal/mobileinit: add dummy import "C"
not harmful, but this consistency may simplify cgo handling
in some custom build systems

Change-Id: Id4692986725b3737c23cdeb9ce1a1fa2bc9f7dad
Reviewed-on: https://go-review.googlesource.com/18615
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-01-13 19:14:56 +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
David Crawshaw d95efb4572 internal/loader: delete
Change-Id: I1ffaf6139d43ef4b13665abc975f4482c327eb34
Reviewed-on: https://go-review.googlesource.com/16914
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-11-17 19:26:15 +00:00
Hyang-Ah Hana Kim a54776c08a bind, internal/loader: fix errors reported by vet
Change-Id: Ia1c2e13cd093fec1c4d6c38828b057d1a38274e4
Reviewed-on: https://go-review.googlesource.com/16841
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-11-11 22:33:35 +00:00
David Crawshaw eadadb8667 internal/mobileinit: standardize JNIEnv* access
Replace the direct access to JavaVM* and the global android Context
instance with a function responsible for running attached correctly
to the JVM. This saves having to replicate the logic for attaching an
OS thread to the JVM. While here, check for any unhandled Java
exceptions.

This supersedes cl/11812.

Change-Id: Ic9291fe64083d2bd983c4f8e309941b9c47d60c2
Reviewed-on: https://go-review.googlesource.com/14162
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-09-14 17:30:52 +00:00
David Crawshaw 905c19f8c0 internal/mobileinit: remove format string warning
Change-Id: I9b0e9680395dcfdf0e6c03a5847ea619e570a2ed
Reviewed-on: https://go-review.googlesource.com/13918
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-08-25 16:39:13 +00:00
David Crawshaw ab223cffc9 internal/mobileinit: send iOS logs to ASL
Fixes golang/go#12194

Change-Id: I9ff771336996c19ca43da56e3f8944e79c980a2b
Reviewed-on: https://go-review.googlesource.com/13703
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-08-20 14:33:19 +00:00
David Crawshaw b780379135 bind: vendor x/tools/go/loader
This breaks our dependency on the x/tools repository, which has a
tendency to change in unexpected ways. It also means we can use the
version of go/types that ships with Go 1.5.

Along the way, it appears that cgo processing has changed slightly.
The old check for cgo files apparently wasn't working, so I removed
it.

Change-Id: I14378e9df9cd65c5ab61b47728ba0d56f31cdf76
Reviewed-on: https://go-review.googlesource.com/12680
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-07-28 18:02:47 +00:00
Hyang-Ah (Hana) Kim 136fa9bbbb bind/java: reenable asset access.
This is done by moving app.Context to internal/mobileinit,
introducing mobileinit.SetCurrentContext and,
making bind/java depend on it.

TODO: check gomobile bind's proguard rule - context lookup
was implemented through reflection on android.app.AppGlobals class.

Change-Id: Ieb6ad503eeef8c2c1c5836a21c667938c5a701a2
Reviewed-on: https://go-review.googlesource.com/12279
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-16 21:15:37 +00:00
Elias Naur ca1abe50ca x/mobile/internal/mobileinit: revert Android log prefix
CL 11981 changed the Android logcat prefix from "GoLog" to "GoStdio".
Revert the prefix to "GoLog".

Also remove a global variable left unused by CL 11981.

Change-Id: I500313652cd618d8573640d5165e5069a0ba0ba7
Reviewed-on: https://go-review.googlesource.com/11991
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-11 11:50:45 +00:00
David Crawshaw 960fedd178 internal/mobileinit: new package for shared logic
Package app contains some logic that we want to share with
gobind-based libraries. So move it to a new internal package
that both can import.

Long term the log changes should be in the standard library,
but the Go tree is currently frozen.

Fixes golang/go#11630.

Change-Id: I9ff622fc499bf255bce18df23cb68b03f667947f
Reviewed-on: https://go-review.googlesource.com/11981
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-07-08 21:29:11 +00:00