2699 Commits

Author SHA1 Message Date
Adam Lesinski
18d5d1107d am 3cd840f4: Merge "AAPT: Fix an issue where a resource name was incorrectly derived on Windows" into lmp-dev
* commit '3cd840f4b5a2988700a6b366fa32f4565c319900':
  AAPT: Fix an issue where a resource name was incorrectly derived on Windows
2014-10-17 22:55:25 +00:00
Adam Lesinski
9306a474e1 AAPT: Fix an issue where a resource name was incorrectly derived on Windows
Calling String8::getLeaf() will assume the system's file path separator,
however the source string was already converted to a unix path.
getLeaf() would therefore not find any occurence of '\' and would
return the full path.

Bug:18036805
Change-Id: Ic2bfac0cc553406740204a296327e266b05c0eff
2014-10-17 21:46:52 +00:00
Jerome Dochez
fc07eb1c7f am f47f8855: Merge "Added a daemon mode to aapt to receive streams of commands from gradle." into lmp-dev
* commit 'f47f8855175213b4bf1014593f97bc81c042dfd1':
  Added a daemon mode to aapt to receive streams of commands from gradle.
2014-10-10 19:24:33 +00:00
Jerome Dochez
f47f885517 Merge "Added a daemon mode to aapt to receive streams of commands from gradle." into lmp-dev 2014-10-10 19:21:49 +00:00
Elliott Hughes
f7941dee46 am b68fe9e5: am ae1b6805: Merge "Track change to private libcore data structure."
* commit 'b68fe9e5f355a3d13ed74cb89fb3e3818b356cee':
  Track change to private libcore data structure.
2014-10-09 18:20:10 +00:00
Elliott Hughes
b68fe9e5f3 am ae1b6805: Merge "Track change to private libcore data structure."
* commit 'ae1b6805a2609759186af8d7131c4750e011019a':
  Track change to private libcore data structure.
2014-10-09 18:13:54 +00:00
Elliott Hughes
d47acaeecd Track change to private libcore data structure.
Bug: 15476051
Change-Id: I4e28ecfa3a1d03c21f9bbde7f3daf79a79d96fe6
2014-10-08 16:07:33 -07:00
Deepanshu Gupta
511925c9e1 am 908a4f9a: am 4f133894: Exclude KXmlParser from LayoutLib.
* commit '908a4f9a4372a9627e821b5800936095b0f0b5b0':
  Exclude KXmlParser from LayoutLib.
2014-10-08 17:38:40 +00:00
Deepanshu Gupta
908a4f9a43 am 4f133894: Exclude KXmlParser from LayoutLib.
* commit '4f133894a6e98d8d30557ea42cec92cfb21fa5c9':
  Exclude KXmlParser from LayoutLib.
2014-10-08 17:34:12 +00:00
Deepanshu Gupta
4f133894a6 Exclude KXmlParser from LayoutLib.
The class was incorrectly being included in the LayoutLib.

Change-Id: I3c86662efa068019fe9165f2fc49a00d0a1b7f2d
2014-10-08 10:12:11 -07:00
Deepanshu Gupta
11b14e3996 LayoutLib: Use ICU's line break algo. [DO NOT MERGE]
Change-Id: I7e5b0ab7423a72f5a4b0e1163d0a537f0b03ba07
(cherry picked from commit 760f6394d0f65fbb5365186e8e068d53c506b653)
2014-10-08 02:05:05 +00:00
Adam Lesinski
865acc7439 am a80aba70: Merge "AAPT: Gate v21 resource synthesizing logging behind -v flag" into lmp-dev
* commit 'a80aba70728c2843df94474dbd7829dadb77855f':
  AAPT: Gate v21 resource synthesizing logging behind -v flag
2014-10-03 22:12:16 +00:00
Adam Lesinski
a80aba7072 Merge "AAPT: Gate v21 resource synthesizing logging behind -v flag" into lmp-dev 2014-10-03 22:06:03 +00:00
Adam Lesinski
f15de2e215 AAPT: Gate v21 resource synthesizing logging behind -v flag
This is verbose information and should be hidden behind the -v flag.

Bug:17822471
Change-Id: I36e2c6beb54669a31cde73416427477a80ded8a6
2014-10-03 14:57:28 -07:00
Deepanshu Gupta
9a4aa49510 am c74a2b34: Merge "Minor style changes." into lmp-dev
* commit 'c74a2b343507546dd5b0a6be5afce42eb8b16a0d':
  Minor style changes.
2014-10-03 21:02:59 +00:00
Deepanshu Gupta
c74a2b3435 Merge "Minor style changes." into lmp-dev 2014-10-03 20:30:45 +00:00
Jerome Dochez
6f1280cf17 Added a daemon mode to aapt to receive streams of commands from gradle.
When crunching png, we used to spawn a separate aapt process from java
which is slow and resource intensive.
Introduced a daemon mode to appt which when invoked with -m parameter
will listen from commands on stdin and give report of command execution
on stdout.

One one command is supported so far :
s f1 f2

This command perform a single png crunch, f1 pointing to the input
png file to crunch, and f2 pointing to the path for the resulting
crunced file.

Expected output from the command is "Done" or "Error".

Change-Id: Iaf1d865e8d5ee5d36abe39dea6443715865a98d3
2014-10-02 15:43:55 -07:00
Deepanshu Gupta
3c8140ab4b Minor style changes.
Addressing code review comments on previous change: 171804201dd

Change-Id: I2c9e0ce35e755c23d8292749828d15a87109d6dc
2014-10-02 11:45:07 -07:00
Neil Fuller
f7cf5d43aa resolved conflicts for merge of ee665151 to lmp-dev-plus-aosp
Change-Id: I97671e62de26919e391dbb2686511584c59ab990
2014-10-02 11:48:08 +01:00
Neil Fuller
ee665151a4 am 0c1faf43: Merge "Switch from FloatMath -> Math and Math.hypot where possible"
* commit '0c1faf43aecadc37b78c4ad6cb669eb351d21385':
  Switch from FloatMath -> Math and Math.hypot where possible
2014-10-02 10:18:29 +00:00
Neil Fuller
0c1faf43ae Merge "Switch from FloatMath -> Math and Math.hypot where possible" 2014-10-02 10:14:19 +00:00
Andreas Gampe
e1b180e21e am 152d9aae: am 31629651: Merge "Frameworks/base: Fix more aapt issues"
* commit '152d9aae631381ea28f5701168d372a1486a7502':
  Frameworks/base: Fix more aapt issues
2014-10-02 07:07:13 +00:00
Andreas Gampe
152d9aae63 am 31629651: Merge "Frameworks/base: Fix more aapt issues"
* commit '316296511bf12c4e14dfb6f54731d1a515114abf':
  Frameworks/base: Fix more aapt issues
2014-10-02 07:01:55 +00:00
Andreas Gampe
8daabceb2e resolved conflicts for merge of 1dcc75b2 to lmp-dev-plus-aosp
Change-Id: I8e1c6ee2025b6acd90803545fb95ab1b98560d92
2014-10-01 23:35:41 -07:00
Andreas Gampe
b8dc7bc582 Frameworks/base: Fix more aapt issues
Change-Id: I6da7dc674e9f9e3b0886a3cfd1e3194d6b5ac948
2014-10-01 20:42:00 -07:00
Deepanshu Gupta
9f905f37b2 am 7b13c4d8: Merge "Always resolve enum when resolving resources." into lmp-dev
* commit '7b13c4d8ecc517ae64cc5bd14c40eaef29e8281c':
  Always resolve enum when resolving resources.
2014-10-02 03:30:45 +00:00
Deepanshu Gupta
7b13c4d8ec Merge "Always resolve enum when resolving resources." into lmp-dev 2014-10-02 03:27:42 +00:00
Andreas Gampe
1dcc75b2db am 0ce259c2: Merge "Frameworks/base: Fix AAPT warnings"
* commit '0ce259c2f69cefd09342a95fbbd4c1a63a0af484':
  Frameworks/base: Fix AAPT warnings
2014-10-01 23:38:25 +00:00
Andreas Gampe
2412f84064 Frameworks/base: Fix AAPT warnings
Turn on -Wall -Werror. Fix warnings.

Change-Id: I287fb3c1e851c654479bcf9ea8c73bd354a6b2a1
2014-10-01 16:18:06 -07:00
Stephen Hines
95fc18f38b am 70de9c0d: Merge "include direct.h for _mkdir" into lmp-dev
* commit '70de9c0d585dcfe71e2cfd921438071e69ff5c45':
  include direct.h for _mkdir
2014-10-01 23:01:40 +00:00
Dan Albert
864272f3eb resolved conflicts for merge of fe50cfd5 to lmp-dev-plus-aosp
Change-Id: Iea93ad20b44f0183f1868f078dd7982b2798fcd3
2014-10-01 13:47:12 -07:00
Dan Albert
fe50cfd533 am c46dbe8a: Merge "Use std::sort instead of qsort_r wrapper."
* commit 'c46dbe8ac4748a0084b026524ad9e5ac44fb9fde':
  Use std::sort instead of qsort_r wrapper.
2014-10-01 20:34:15 +00:00
Deepanshu Gupta
409bd3d774 Resource resolution bug fix. [DO NOT MERGE]
Fix a bug where "?attr/foo" in framework resources wasn't resolved
properly.

Change-Id: I9a56974f526774fde79685f668f01021136d68f1
(cherry picked from commit 19c7842082d831ad432abe906f4c37c6ed08e414)
2014-10-01 12:45:26 -07:00
Deepanshu Gupta
fea51feb5c Fix Tests after cherry picks. [DO NOT MERGE]
1. Updated the intelliJ run configuration for the layoutlib_create tool.
2. Updated the code to search for the platform.dir.
3. Update tests to use AppTheme and Target SDK 19

Change-Id: I6f1cc6ff2a53e4474c746537029c7f89c6dd6dc1
(cherry picked from commit 8592eeafd01370d1a17e34602290becf7f611c75)
2014-10-01 12:44:24 -07:00
Deepanshu Gupta
98a03e771e Update intelliJ copyright profile [DO NOT MERGE]
Change-Id: Ib9386b686cb24e1f187d0b636b59b4b13d59bbcd
(cherry picked from commit 91fa62ac67a5e294124b5bfb70b35addc7687c34)
2014-10-01 12:44:14 -07:00
Deepanshu Gupta
039d5849ea Build layoutlib create tests as part of sdk build. [DO NOT MERGE]
LayoutLib Create tests are now built whenever LayoutLib create is built.

Change-Id: Id215e8690e435019579dba1734090a0d585f37e1
(cherry picked from commit 4efe6264f1251fa200427f54ea6f5dd4c4d03665)
2014-10-01 12:44:05 -07:00
Deepanshu Gupta
6fb5fdc233 Add layoutlib tests to DIST_DIR [DO NOT MERGE]
Add the layoutlib and layoutlib-create tests to DIST_DIR for sdk
targets. These can be used for continuous testing on the build server.

Change-Id: I747dddcddfd8009937668bec4d75cb99bf63235f
(cherry picked from commit f9c749c9901c459f77ffc6f4fbbc15f4142c6e0a)
2014-10-01 12:43:52 -07:00
Deepanshu Gupta
bd4133133a Build layoutlib_create tests. [DO NOT MERGE]
Change-Id: Ia13a090f8ec29b2b2a107825b6a13d7db77e6d61
(cherry picked from commit 2294f939bc79ce902a40db37def64cc28394d56b)
2014-10-01 12:43:43 -07:00
Deepanshu Gupta
3f0e467a06 Remove ANDROID_BUILD_TOP from intelliJ path variables. [DO NOT MERGE]
The variable is not actually needed and it makes working with different
API levels a lot easier since everything now depends on $PROJECT_DIR$.

This change also makes the tests more robust by improving the way it
tries to find the SDK.

Change-Id: I3502ad4a0ba85fd88b497e47964fddb2a89e520c
(cherry picked from commit 5377695d4ecf3cc6dc1abe59bbfca63f6137b722)
2014-10-01 12:43:32 -07:00
Deepanshu Gupta
2f3715aaaa Get filename from File faster [DO NOT MERGE]
Use the direct call from a File object to get the filename instead of
going through Path which depends on Java 7 making the LayoutLib tests
incompatible with Java 6.

Change-Id: I815895eedbc10245ee09bdb53b11e5548b076aad
(cherry picked from commit 7dbf91fee96790fbeb9858740be1bb375f29ecb5)
2014-10-01 12:43:19 -07:00
Deepanshu Gupta
b6a37d897a Add testing framework to LayoutLib. [DO NOT MERGE]
This change adds an end to end test which loads the framework resources
and a test app and ensures that no exceptions or warnings are thrown.

The change also adds project configuration for intelliJ.

Change-Id: I7b67c0f1a2af2dac95df7f3231cab537b9826d7d
(cherry picked from commit a8e9517470869fa29946ae1fa1ceeb24c7970391)
2014-10-01 12:43:11 -07:00
Deepanshu Gupta
23f09423cb Add tests to the layoutlib eclipse project. [DO NOT MERGE]
Specify the test folder in the layoutlib/bridge eclipse project.

Also add the sourcepath for layoutlib-api-prebuilt.jar

Change-Id: I194ed182618e564388d6df645e2de7f59897fa1e
(cherry picked from commit 36acf8baebc9ab72b3b5fe75d865399ddf7b0132)
2014-10-01 12:42:49 -07:00
Dan Albert
0de19adc80 Use std::sort instead of qsort_r wrapper.
The HAVE_(BSD|GNU)_QSORT_R in AndroidConfig.h has never worked, and we
should just be using something standard anyway.

Change-Id: I784d6212f6c890a11c4af2f83d1ce2d279708652
2014-10-01 11:34:17 -07:00
Neil Fuller
33253a4baa Switch from FloatMath -> Math and Math.hypot where possible
The motivation is an API change: FloatMath is going to be
deprecated and/or removed. Performance is not the goal of
this change.

That said...

Math is faster than FloatMath with AOT compilation.

While making the change, occurances of:

{Float}Math.sqrt(x * x + y * y) and
{Float}Math.sqrt({Float}Math.pow(x, 2) + {Float}Math.pow(y, 2))

have been replaced with:

{(float)} Math.hypot(x, y)

Right now there is no runtime intrinsic for hypot so is not faster
in all cases for AOT compilation:

Math.sqrt(x * x + y * y) is faster than Math.hypot(x, y) with
AOT, but all other combinations of FloatMath, use of pow() etc.
are slower than hypot().

hypot() has the advantage of being self documenting and
could be optimized in future. None of the behavior differences
around NaN and rounding appear to be important for the cases
looked at: they all assume results and arguments are in range
and usually the results are cast to float.

Different implementations measured on hammerhead / L:

AOT compiled:

[FloatMath.hypot(x, y)]
benchmark=Hypot_FloatMathHypot} 633.85 ns; σ=0.32 ns @ 3 trials

[FloatMath.sqrt(x*x + y*y)]
benchmark=Hypot_FloatMathSqrtMult} 684.17 ns; σ=4.83 ns @ 3 trials

[FloatMath.sqrt(FloatMath.pow(x, 2) + FloatMath.pow(y, 2))]
benchmark=Hypot_FloatMathSqrtPow} 1270.65 ns; σ=12.20 ns @ 6 trials

[(float) Math.hypot(x, y)]
benchmark=Hypot_MathHypot} 96.80 ns; σ=0.05 ns @ 3 trials

[(float) Math.sqrt(x*x + y*y)]
benchmark=Hypot_MathSqrtMult} 23.97 ns; σ=0.01 ns @ 3 trials

[(float) Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2))]
benchmark=Hypot_MathSqrtPow} 156.19 ns; σ=0.12 ns @ 3 trials

Interpreter:

benchmark=Hypot_FloatMathHypot} 1180.54 ns; σ=5.13 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtMult} 1121.05 ns; σ=3.80 ns @ 3 trials
benchmark=Hypot_FloatMathSqrtPow} 3327.14 ns; σ=7.33 ns @ 3 trials
benchmark=Hypot_MathHypot} 856.57 ns; σ=1.41 ns @ 3 trials
benchmark=Hypot_MathSqrtMult} 1028.92 ns; σ=9.11 ns @ 3 trials
benchmark=Hypot_MathSqrtPow} 2539.47 ns; σ=24.44 ns @ 3 trials

Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I06c91f682095e627cb547d60d936ef87941be692
2014-10-01 14:04:15 +01:00
Deepanshu Gupta
aece3c05d0 am 052c4c4b: Merge "Update time in layout preview" into lmp-dev
* commit '052c4c4b7a18c6c5e7bf688a647ed142167deddb':
  Update time in layout preview
2014-09-30 14:55:23 +00:00
Andrew Hsieh
c9d32390e5 include direct.h for _mkdir
Bug: 14416410

The new mingw-w64 toolchain x86_64-w64-mingw32-4.8 no longer
declares _mkdir in io.h.

Change-Id: I624b52d2f35db54a7f28df09f997fc883b0f0557
2014-09-30 02:28:05 -07:00
Deepanshu Gupta
171804201d Always resolve enum when resolving resources.
Enums were resolved only for integers and dimensions. This change
resolves enums for all resource types. Well, almost all. For color and
colorStateList, enums are still not referenced.

Bug: http://b.android.com/76091
Change-Id: Ie43bd1b54fb9877655d31773bdf71d9a6a65c473
2014-09-29 12:01:37 -07:00
Deepanshu Gupta
8d5a15b691 Update time in layout preview
Change-Id: Ic32a9cb1f20b472c6898a5f370d8578c011a09bf
2014-09-29 09:38:59 -07:00
Adam Lesinski
86641af81d am 0a6c5ea4: Merge "AAPT: Fix issue with synthesized resource not actually showing up" into lmp-dev
* commit '0a6c5ea412bc1e49aa1e98a6a3fe268081883d4a':
  AAPT: Fix issue with synthesized resource not actually showing up
2014-09-26 01:04:51 +00:00
Deepanshu Gupta
803a59cae7 Fix error when using list as actionBarNavMode. [DO NOT MERGE]
A bug in the framework leads to the wrong argument being passed to
defStyleRes when obtaining styled attributes. The framework however just
ignores the attribute in such a case. LayoutLib logs an error to help
developers find bugs in their code.

The bug was seen when using list as the actionBarNavMode.

This change ignores the attribute if it detects that it's the framework
bug. Also, we change the error to a warning.

Change-Id: I58e1fe4469de0329a27b577d75c0a59c48d0381b
2014-09-25 23:01:38 +00:00