Commit Graph

24 Commits

Author SHA1 Message Date
George Mount
4ec064dff1 Use layout path for the tag on bound layout roots.
Change-Id: I6bda5d5716e749251b27c112865da066ba908509
2015-04-07 11:02:11 -07:00
George Mount
a02e4c6c76 Use setTag(id, val) when minSdk is ICS and later.
setTag(id, val) leaks on versions before ICS. When the
minimum SDK is before ICS, setTag(val) must be used
for bindings. However, this prevents the developer from
using the tag for his or her own purposes. Therefore,
if the minimum SDK is ICS and greater, setTag(id, val)
is used.

Change-Id: I46327084bde4bafc05a64f82ad5ebcf710820ecc
2015-04-02 13:38:53 -07:00
George Mount
0dbcee1fb9 Merge implementation into base class for single implementations.
Bug 19933646

Change-Id: Ifc947d929b5275e32598e8d40f0122504a99d7f8
2015-03-31 08:23:39 -07:00
George Mount
75aa9bf96f Require only one pass to make BR.java file.
Bug 19985005

Because the generation of Binding files created @Bindable
annotations, the BR file generation had to wait until a
second annotation pass. This caused errors to be generated
that were later cleared, causing confusion. I moved the
BR file generation to the same annotation processing stage
that generates the Binding files to clear up the error
generation.

TODO: merge the annotation processing stages so that there
is less cross-talk between annotation processors.
2015-03-30 12:27:25 -07:00
George Mount
fc195a64c6 Move to package android.databinding. 2015-03-23 16:51:33 -07:00
Yigit Boyar
243a1e3e18 Support for multi module setups
This CL adds support for building multi module apps
with proper context.

For library modules, we only generate base classes in the initial
compilation. We also generate a temporary BR file which does
not have final methods.

When final app is being generated, all layout binders, adapters
and Bindable information gets merged and all final classes
are generated in their appropriate packages.

This CL also adds support for Test runs and any
number of build variants.

Bug: 19714904
Change-Id: I9b50b54db05f3fa206eec33709d43c2ac94a9e5e
2015-03-19 12:40:00 -07:00
Yigit Boyar
1ec5cb0729 Restructure project for test apps
This CL updates project to use a local maven repo.
(local as in near source code w/ relative path).
This is necessary to have multiple versions of the
project on the same computer also provides better
separation.

I also moved integration tests to depend on these
because we cannot build the compiler and test app at
the same project.

I've changed library plugin's jar to be a separate
upload task to avoid some build issues in TestApp
when we release a @jar and @aar with same group and
artifact ids.

This CL also adds some convenience methods to
gradle build script to run all tests, prepare maven
repo, run integration tests etc. These were needed
to do CI.

Bug: 19718690
Change-Id: I3c80e09fe7c8c2780ca00c3e9b9ba99a162531cf
2015-03-12 19:27:20 -07:00
Yigit Boyar
20af2f0c5a Downgrade to java 1.6
This CL removes java 1.7 code so that we can easily integrate
w/ Idea.

It also partially removes dependency on ModelAnalyzer for
interface generation so that we can call it from the Idea
plugin.

Change-Id: Id7616987f5660911e951ddf20dacd4f407dacbd9
2015-03-12 09:17:11 -07:00
Yigit Boyar
ac5dc9a4e1 Check API version for methods called via binding
In data binding, setting an attribute actually means calling a method, which might be
an issue if the method is added after a certain API.

This CL introduces a change which will check called methods per api and add necessary
API check code to avoid calling those methods in older platforms.

This CL also resurrects the Java Model Analyzer (in testing) and also fixes compiler tests.

Bug: 19593398
Change-Id: I0da4194625231cf43125e1b43338069e7d191eb9
2015-03-11 10:44:08 -07:00
George Mount
f9c62b6f52 Don't require IDs for most bound views. 2015-03-04 14:12:06 -08:00
George Mount
81536a4da5 Move expression parsing to Annotation Processing stage.
Change-Id: Ibf1e9c02856212c20300f10e4c63b96ec33b7a13
2015-03-02 15:21:18 -08:00
George Mount
371450b5b1 Support casting operation in binding expressions.
Bug 19272385

Change-Id: I5a992f4eaf6f456d21983481ab4ca01305582f36
2015-02-18 10:44:22 -08:00
George Mount
812d215fa6 Removed reflection-based implementations and renamed classes.
Renamed Model* classes to Annotation*
Renamed Reflection* classes to Model*
Removed Class* classes -- they are no longer needed.

The names were confusing. I think this is better.
2015-02-17 16:15:29 -08:00
George Mount
d872e1cdf7 Move expression generation to annotation processor. 2015-02-17 10:42:10 -08:00
George Mount
fbdb3c08f0 Prepare ClassAnalyzer to be replaced by other implementations.
ClassAnalyzer uses normal reflection. We intend to move
to an Annotation Processor and possibly an Android Studio
plugin version of type interaction as well. This abstracts
the type interaction to prepare.

Change-Id: I2b95ea9074bca7e3053aeadcd3692dffe93b41d6
2015-02-11 10:49:11 -08:00
George Mount
31c37ffe68 Made ProcessBindable read intermediate files from class path.
Bug 19192030
2015-01-29 16:16:31 -08:00
George Mount
e72bfcd968 Added tests for ViewBindingAdapter.
Also fixed:
Bug 19192030
2015-01-29 10:06:23 -08:00
George Mount
860a2fc4aa Project renaming 2015-01-27 10:58:49 -08:00
Yigit Boyar
04d9e78503 Cleanup previous layout generators.
Change-Id: Ib55038fa762561ad69c3936e5731f2a27998c87f
2015-01-21 18:27:52 -08:00
George Mount
cbecb900f6 Added implementations of BindingAdapters.
Added renaming attribute-to-setter and automatic Conversions.
Moved intermediate store (SetterStore) to compiler project.
Moved annotations to their own project.
2015-01-20 09:17:16 -08:00
George Mount
89ac4e022b Handle BindingAdapters 2015-01-09 16:00:44 -08:00
George Mount
1411165139 Add annotation processor. 2014-12-17 11:24:30 -08:00
George Mount
c7e4d660c9 Revert "Added Bindable annotation processor."
This reverts commit 8f98922af15026fbbcf7ad55826198c58cb2d330.

Change-Id: I3afbc70d2743a682f04ec82a45c340ebde4cb47c
2014-12-16 23:58:36 +00:00
George Mount
4e84d3dea3 Added Bindable annotation processor.
Change-Id: I17d4109f9d974d46474b9ac1fba4d303f232b097
2014-12-16 10:01:50 -08:00