summaryrefslogtreecommitdiff
path: root/compilationTests
AgeCommit message (Collapse)Author
2016-05-05Fix problem where root View's style is used instead of bound View'sGeorge Mount
Bug 27808662 Change-Id: I870b0db47e3ed970a3bd67e602e873e503610028
2016-04-11Update iml files (org.antlr move)Deepanshu Gupta
Change-Id: I7efd080f4201b325e58faa52091b67220e875465
2016-04-11Move to org.antlr from tunnelvisionYigit Boyar
We were using a version of antlr that is published by tunnelvision which works fine but this becomes a problem when another gradle plugin wants to depend on antlr as well. It is best if we depend on the original one to avoid conflicts with other libs. Bug: 27175207 Change-Id: I0a87f9902361ace5dc6d03d838e2ad431c844de8
2016-03-17Added simple inverted String conversion.George Mount
When binding a primitive to an EditText, a common pattern is to use '@{"" + value}'. This, however, doesn't allow for a two-way data binding expressions. To mitigate the need for conversion functions, a simple inversion for this expression wsa implemented that just converts value from a String when possible. This CL also fixes a bug in which a method matching the first parameter was always chosen, reguardless of the second and further parameters. Change-Id: I36828d9f54d2073965358fceb140b2d5e6328919
2016-03-08Support for java 8 method reference syntax.George Mount
Bug 26937350 Our event handling syntax is obj.method, where java 8 uses the syntax obj::method. This adds support for the java 8 syntax and adds a deprecation warning for the old syntax. Change-Id: Ideb0570c2646f674da031f642ed3369e8c5fcd3b
2016-03-08Have two-way binding use localized variables to prevent NPE.George Mount
Bug 26962999 Two-way binding was using the inverted expressions directly without localizing variables. That meant that if there was a variable set to null during evaluation, it may get a NullPointerException even though it checked for null on the value previously. This CL localizes the variables so that cannot happen. Change-Id: Ia55955ce0f1cb750e6a678e72e0cda03f0e3c9b6
2016-02-23Two-way binding testsGeorge Mount
Bug 1474349 Bug 22460238 Tests for two-way data binding can't be checked in until the SDK becomes public. Also updates the sample application because it has the same restrictions. Change-Id: I7e2b2f84943844401d2b8edbac4e60ea9f5704a6
2016-02-16Lambda In da houseYigit Boyar
This CL adds support for assigning callbacks to listeners using lambda expressions. These expressions can receive either 0 or N arguments where N is equal to the number of parameters in the callback function. These expressions are evaluated when the callback is invoked. In other words, they are independent from the rest of the ExprModel except the Identifier expressions. Since these are limited to 1 full expression and they don't have any invalidation flags; we use a verbose branching code generation mode where we calculate all possible execution paths, eliminate trivial ones and generate the code. This allows callbacks to be thread safe as well. See ExecutionPath class for details. It is not efficient but since these are rere occasions, should be OK. Callback expressions are still forced to be expressions that return value. To handle `void` case, I've added `void` and `Void` as acceptable symbols. Also, if the callback method returns void, the expression is free to return `void` or any other value. ¯\\_(ツ)_/¯ I've also moved kotlin to rc0. Although rc0 is unrelated to this task, it made more sense to upgrade here because most changes it will ask for were already done in this branch. Bug: 26849440 Change-Id: I805b3d470f85df9c2ce3f3ed5ca74925a08bb7a5
2016-01-26Fix incremental compilation when dependency layout is removedYigit Boyar
This CL fixes a bug where if gradle dependency of a module is removed, we would not delete its layout files properly. Change-Id: Ifa5529768ed959acd8b6a903ad33d8f1e42159f7 Bug: 25755539
2015-12-22Add iml files for intellij projectDeepanshu Gupta
Helps keeping settings like codeStyleSettings in sync. Change-Id: I3919d9f8c11a1ef5bdc628f9456efa094ed4111d
2015-10-28Data binding as studio dep + java6Yigit Boyar
This CL gets rid of the gradle plugin and instead provides DataBindingBuilder for the gradle plugin to directly use. Now, everything that is deployed via SDK Manager (lib and adapters) are included as prebuilts so that we avoid accidently changing them w/o an SDK manager release. There is still work to do: > re-enable proguard for externel dependencies > release a batch to ensure everything works Bug: 22516688 Change-Id: I83ace15bd6d3d23bf5b4ad850f36453dd23ebd43
2015-10-07Create tag from original fileYigit Boyar
XMLEditor was creating root view tag from the file in build folder which becomes a problem if android gradle plugin decides to create more variations of the source file. This CL fixes that issue and always uses the folder name from the original file if exists. Bug: 24745000 Change-Id: I169db02ffa4985328e408cc347d83c984bd2f5ad
2015-10-07Report syntax errors even though Antlr can recoverYigit Boyar
This CL makes Antlr parser more strict by not allowing errors. Antlr usually tries to recover from these errors but thats not what we really want for this use case. This CL also updates version codes to rc4 since rc3 is already out. Change-Id: I0d305e06a6cdcbae2f37573c3c6ae4233cdd7958
2015-09-29Pass command line args to compilatin testsYigit Boyar
Change-Id: Iad479df825207c3a37a9bc94b658d1133b31850c
2015-09-14Move tool versions into configYigit Boyar
Change-Id: Ia75eb20a50571aa6f8ebb80596962694d2d535fa
2015-08-06Support binding expressions in android:tag attribute.George Mount
Bug 22972105 Also added error reporting for tags on root elements and tests. ICS+ supports tags on root elements. Change-Id: I1f3fe5e59b68a04fd80e3e2638a7b7743fac027d
2015-07-14Localize MavenYigit Boyar
This CL introduces a new development plugin that downloads all dependencies into the given repository. This will allow us to build data binding in build servers w/o internet connection. By default, it is setup to disable public repositories to avoid adding a new dependency w/o running the script. Public repositories can be added by running -PaddRemoteRepos=true. There is also a convenience script to fetch dependencies. localize.sh Bug: 19626302 Change-Id: I9d200550b76c3b60119cdbbdb4e1e7772d0da1d7
2015-07-07Merge "Print encoded errors only if data binding is invoked from the IDE" ↵Yigit Boyar
into mnc-dev
2015-07-06Add errors for layout files in different configsYigit Boyar
This CL adds ScopedExceptions to multi-config layout parsing. Bug: 21953001 Change-Id: I5d62b711120e890733e7f5c08108041109e4eefd
2015-07-06Print encoded errors only if data binding is invoked from the IDEYigit Boyar
This CL makes Scope aware of execution environment. Now when invoked from tests or via IDE, we'll print exceptions as encoded so that we can parse them back. When user invokes from command line or any other tool, we will print human readable errors. The encoded error format may still change depending on conversations w/ Studio team. Bug: 21953001 Change-Id: I5bd3ea0cb6728e011225ee84d3e38817a2993a43
2015-06-30Introduce Scopes to track logical stack tracesYigit Boyar
This CL introduces a static class called Scope, which is used the logical processing stack for data binding. These scopes are used to generate meaningful error messages when an error is detected. Bug: 21953001 Change-Id: I5470a8c4ad94401d34a140762baae9d53c5a0402
2015-06-23Give an error when includes are in the root of data bound layouts.George Mount
Bug 22032146 Change-Id: Ia20264a843edf70358ea37cdf31ab8b5686052b8
2015-06-22Don't generate inflators for librariesYigit Boyar
If a library project (A) depends on anohter library project (B), we would generate code that accesses R file of project B while compiling project A. Unfortunately, gradle does not generate that R file when compiling A, it only exists when compiling the app and B. This CL changes the base class generation to not to generate real code for base classes unless we are building the final app. Bug: 22001270 Change-Id: Ic107001ab58c94016f37f7f6fc0470a822db3aa7
2015-06-11Compilation tests moduleYigit Boyar
This CL adds a new module which is a java project that can be used to create one-off project setups. This module will be used to test error cases and to make sure we detect errors and dispatch proper error messages. I've also updated antlr to 4.5 which gets rid of the annoying annotation processor source compatibility error: https://github.com/antlr/antlr4/issues/487 Bug: 21735564 Change-Id: I16c04923c7d69ca40fe13139acaf87c08166ad95