Commit 9659224
committed
[databinding] Fix databinding templates and resources for AndroidX
AFAICT, the AndroidX flag isn't respected anywhere; instead, it is just
hard-coded as false here. This flips it to true. Additionally, this
requires a change in the template. If this actually does need to be
customizable, I can wire up some of the flags accordingly. But, given
that data binding just didn't work on any platform (without the previous
commit), I can't imagine it is too controversial to set androidx=true.
Additionally, the shell command run to fix databinding compiled
resources was not cross-platform:
* BSD `head` won't take a negative int as its argument (GNU does).
The better way to accomplish this goal here (listing all files in
the archive) is just to use `zipinfo(1)`. `zipinfo -1` shows in its
man page to be intended for exactly this purpose.
* BSD `sed` requires passsing an argument to the `-i` flag for a file
extension to use when writing a back-up. A file without a back-up
must be explicitly signaled by using an empty argument, i.e.
`sed -i '' file`. However, a spaced argument to `-i` on GNU sed is
interpreted as the next positional argument to `sed`, which is an
error. The only cross-platform way to accomplish this appears to be
to combine it into one like `-i.bak`. This then needs to be removed.
(From [StackOverflow](https://stackoverflow.com/a/22084103/1819790))
* Using `sed` to change a string in an otherwise binary file may require
changing the localization variables. At least, it does on standard
BSD/macOS: otherwise, `sed` assumes files are encoded as text, and
the class files contain invalid bytes. `LC_ALL` overrides all
categories not set.1 parent 27150b9 commit 9659224
File tree
6 files changed
+12
-11
lines changed- rules
- src/tools/java/com/google/devtools/build/android
6 files changed
+12
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
| 981 | + | |
981 | 982 | | |
982 | 983 | | |
983 | 984 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 10 | + | |
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | | - | |
| 384 | + | |
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
| |||
390 | 390 | | |
391 | 391 | | |
392 | 392 | | |
393 | | - | |
| 393 | + | |
| 394 | + | |
394 | 395 | | |
395 | 396 | | |
396 | 397 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| |||
0 commit comments