7 years agoSome clean up.
Xavier Ducrohet [Thu, 13 Sep 2012 23:29:53 +0000]
Some clean up.

Create a default implementation of AndroidDependency for standard bundle
layout.

Also use guava in some places mostly around lists and maps creation,
and preconditions.

Change-Id: Ifbd7f60e2290bbc546ee29521466b6f62851c017

7 years agoMerge "Fix setting up classpath with jars from libraries."
Xavier Ducrohet [Fri, 14 Sep 2012 00:15:43 +0000]
Merge "Fix setting up classpath with jars from libraries."

7 years agoFix setting up classpath with jars from libraries.
Xavier Ducrohet [Fri, 14 Sep 2012 00:05:09 +0000]
Fix setting up classpath with jars from libraries.

Change-Id: I5dfa2ee3d21c748450b3ebaf2316fdf8d757f68e

7 years agoMerge "Started wiring up library and jar dependencies."
Xavier Ducrohet [Fri, 14 Sep 2012 00:05:43 +0000]
Merge "Started wiring up library and jar dependencies."

7 years agoStarted wiring up library and jar dependencies.
Adam Murdoch [Thu, 13 Sep 2012 02:17:05 +0000]
Started wiring up library and jar dependencies.

Changed the AndroidLibraryPlugin to publish both library variants.

Changed the AndroidPlugin to unzip incoming library bundles and
provide the appropriate AndroidDependency implementations.

Lots of things not finished yet:

* Does not work for libraries published to a Maven repository.
* Creates a flattened list of library dependencies, rather than a graph.
* Jar dependencies are not wired up.
* Only implemented for applications, not libraries or test apps.
* Does not include variant specific dependencies.
* Needs some more work to better wire up the task dependencies.

Change-Id: I20f5c298ca051c203828c4076e2693aef47ace70

7 years agoMerge "Don't use an empty main manifest when merging library manifests."
Xavier Ducrohet [Thu, 13 Sep 2012 02:16:19 +0000]
Merge "Don't use an empty main manifest when merging library manifests."

7 years agoDon't use an empty main manifest when merging library manifests.
Adam Murdoch [Thu, 13 Sep 2012 02:05:28 +0000]
Don't use an empty main manifest when merging library manifests.

Change-Id: I45733f5769a8e6d5f392030f28f117b47999c985

7 years agoMerge "Ensure manifest changes trigger new builds."
Xavier Ducrohet [Tue, 11 Sep 2012 22:33:31 +0000]
Merge "Ensure manifest changes trigger new builds."

7 years agoEnsure manifest changes trigger new builds.
Xavier Ducrohet [Tue, 11 Sep 2012 20:39:56 +0000]
Ensure manifest changes trigger new builds.

The ProcessManifest task was not using manifest files as inputs
so changes in them would not trigger new builds.

Change-Id: I86b6b9ef2b1308c0cf36ccd538f1967ae7c1cc8f

7 years agoMerge "Defer calculation of compile classpath until required."
Xavier Ducrohet [Fri, 7 Sep 2012 21:45:47 +0000]
Merge "Defer calculation of compile classpath until required."

7 years agoDefer calculation of compile classpath until required.
Adam Murdoch [Fri, 7 Sep 2012 02:28:25 +0000]
Defer calculation of compile classpath until required.

The other projects in the build may not have been configured
when the tasks for the current project are being added.

Also added a workaround for the task dependency information
going missing when the compile classpath is calculated.

Change-Id: Ica2042d70aa31ce8794e49960fb1c8fb5c9d9c0d

7 years agoMerge "Add support for building AILD files."
Xavier Ducrohet [Thu, 6 Sep 2012 23:15:30 +0000]
Merge "Add support for building AILD files."

7 years agoAdd support for building AILD files.
Xavier Ducrohet [Wed, 5 Sep 2012 01:37:00 +0000]
Add support for building AILD files.

This brings in the SourceProcessor, SourceGenerator and
DependencyGraph from the ant tasks. The dependency graph
is only needed because Gradle doesn't give us the list
of changed files just yet.

Change-Id: I4e9c8ccb032078529516af29b2287b21adac05cc

7 years agoMerge "Rename task classes to be more consistent."
Xavier Ducrohet [Fri, 31 Aug 2012 20:11:18 +0000]
Merge "Rename task classes to be more consistent."

7 years agoRename task classes to be more consistent.
Xavier Ducrohet [Fri, 31 Aug 2012 20:10:11 +0000]
Rename task classes to be more consistent.

Change-Id: Ied2249cfe8b5621749de7772e6574b589702bbde

7 years agoMerge "Add support for extra lines in BuildConfig."
Xavier Ducrohet [Fri, 31 Aug 2012 19:59:37 +0000]
Merge "Add support for extra lines in BuildConfig."

7 years agoAdd support for extra lines in BuildConfig.
Xavier Ducrohet [Fri, 31 Aug 2012 18:37:48 +0000]
Add support for extra lines in BuildConfig.

Created a -Dsl class for each ProductFlavor and BuildType in order to
improve the DSL.

Added some examples in basic/ and flavored/ samples.

Change-Id: I7c0613b0a81569a17737b2aa4b94d207bf464989

7 years agoMerge "Make sure the build detects changes in config classes."
Xavier Ducrohet [Fri, 31 Aug 2012 18:40:52 +0000]
Merge "Make sure the build detects changes in config classes."

7 years agoMake sure the build detects changes in config classes.
Xavier Ducrohet [Fri, 31 Aug 2012 01:04:46 +0000]
Make sure the build detects changes in config classes.

aapt and dex option classes use the @Input and the
tasks using them put @Nested on them.

The ProductFlavor and the Build Type classes are now
Serializable and they are passed as @Input args to
all classes that need them.

Any change in those objects will properly trigger
a recompilation.

Change-Id: I42fb3f6c5870505b984ff777befee255f03ebd1d

7 years agoMerge "Add guava as a dependency to AndroidBuilder."
Xavier Ducrohet [Thu, 30 Aug 2012 23:48:21 +0000]
Merge "Add guava as a dependency to AndroidBuilder."

7 years agoAdd guava as a dependency to AndroidBuilder.
Xavier Ducrohet [Thu, 30 Aug 2012 22:41:10 +0000]
Add guava as a dependency to AndroidBuilder.

Change-Id: I4b2029c52099eb449a74f048b5aae6122774e40b

7 years agoMerge "Fix support for building and testing libraries."
Xavier Ducrohet [Thu, 30 Aug 2012 22:41:00 +0000]
Merge "Fix support for building and testing libraries."

7 years agoFix support for building and testing libraries.
Xavier Ducrohet [Thu, 30 Aug 2012 02:23:33 +0000]
Fix support for building and testing libraries.

Libraries weren't properly builds due to:
--non-constant-id was not used
--extra-packages was not used.

Also this creates a fake AndroidDependency for the tested
config so that it can be added to the dependency of the test
app.

Finally, this fixes some of the issues around classpath.
The Dex task receives separately the compiled code and the
library to planned for pre-dexing the libraries. The libraries
are handled through the AndroidDependency class provided
to the VariantConfig.
The compileTask setup is more precise in what is the
compiled *and packaged* classpath vs just a compile classpath
(this is different for test apps depending on if the test target
is a library or an app).

Change-Id: I0be9da2ce03bb48f40f4577e4323edf50062f2c0

7 years agoMerge "Refactor VariantConfig to contain the tested config."
Xavier Ducrohet [Wed, 29 Aug 2012 23:41:39 +0000]
Merge "Refactor VariantConfig to contain the tested config."

7 years agoRefactor VariantConfig to contain the tested config.
Xavier Ducrohet [Wed, 29 Aug 2012 21:56:39 +0000]
Refactor VariantConfig to contain the tested config.

Change-Id: I2d1da3379189012b3780a19aaac1785554f193cb

7 years agoMerge "Start planning for checking inputs of all tasks."
Xavier Ducrohet [Wed, 29 Aug 2012 19:29:23 +0000]
Merge "Start planning for checking inputs of all tasks."

7 years agoStart planning for checking inputs of all tasks.
Xavier Ducrohet [Tue, 28 Aug 2012 17:28:20 +0000]
Start planning for checking inputs of all tasks.

Each tasks of AndroidBuilder needs to be able to gather its
inputs to be checked by the front-end to figure out if the
task actually needs to be called.

Change-Id: I494ec06c070c94fe0ebb79a11e08063d199e4621

7 years agoMerge "More refactoring to build library tests."
Xavier Ducrohet [Wed, 29 Aug 2012 18:01:32 +0000]
Merge "More refactoring to build library tests."

7 years agoMerge "Split android-builder out of android-gradle."
Xavier Ducrohet [Wed, 29 Aug 2012 17:59:50 +0000]
Merge "Split android-builder out of android-gradle."

7 years agoMerge "Add support to build and bundle library projects."
Xavier Ducrohet [Wed, 29 Aug 2012 17:59:33 +0000]
Merge "Add support to build and bundle library projects."

7 years agoMore refactoring to build library tests.
Xavier Ducrohet [Wed, 29 Aug 2012 02:32:07 +0000]
More refactoring to build library tests.

Change-Id: Ib9290f31ac9fc41bce54521ef3777079cfe6034b

7 years agoSplit android-builder out of android-gradle.
Xavier Ducrohet [Wed, 29 Aug 2012 02:09:17 +0000]
Split android-builder out of android-gradle.

Both should be separate artifacts in Maven.

Change-Id: I96a0d1fffb195a7542cffeab99fabad5ad243d08

7 years agoAdd support to build and bundle library projects.
Xavier Ducrohet [Wed, 29 Aug 2012 00:31:49 +0000]
Add support to build and bundle library projects.

The unarchived bundle is saved under build/bundle.

The generated manifest is directly saved under there
to avoid copying it.
The resources are copied there but the built-type
res folder is not properly merged in there. Need
to fix this.
The crunched resources are copied on top of it.

Also add a library test app.

Change-Id: Iab2d437b6f98ca5f842ca9720aafa206691fc1f0

7 years agoMerge "Refactoring to prepare for building libraries."
Xavier Ducrohet [Tue, 28 Aug 2012 23:47:34 +0000]
Merge "Refactoring to prepare for building libraries."

7 years agoRefactoring to prepare for building libraries.
Xavier Ducrohet [Tue, 28 Aug 2012 22:07:56 +0000]
Refactoring to prepare for building libraries.

Change-Id: Ic8f0055a5433871da26859abfda85908b09b182f

7 years agoMerge "Fix noCompress support in aapt."
Xavier Ducrohet [Tue, 28 Aug 2012 21:46:59 +0000]
Merge "Fix noCompress support in aapt."

7 years agoFix noCompress support in aapt.
Xavier Ducrohet [Tue, 28 Aug 2012 18:38:43 +0000]
Fix noCompress support in aapt.

Move the aapt/dex options to interface in the builder, with implementation
in the gradle front-end.

Change-Id: Id524b57fdad5ade22db3b2abb3defa0dd2421c94

7 years agoMerge "Add support for building test apps."
Xavier Ducrohet [Tue, 28 Aug 2012 16:51:09 +0000]
Merge "Add support for building test apps."

7 years agoAdd support for building test apps.
Xavier Ducrohet [Mon, 27 Aug 2012 21:02:11 +0000]
Add support for building test apps.

Support for test apps testing apps only. Not support
for library projects yet. Lots of bug fixes to get here.

Renamed 'basic' to 'dependencies'. This will still need
to be refactored.

'basic' and 'flavored' are two new projects with that are
very simple and meant to test the build variant mechanism
which is tested by the test apks.

This also adds uninstall tasks as well as runTests tasks,
and creates top level install tasks.

Change-Id: I11bf62b236a4df6752b4195fd1989da3f93e29bd

7 years agoMerge "Change the way AndroidBuilder is configured."
Xavier Ducrohet [Mon, 27 Aug 2012 23:13:20 +0000]
Merge "Change the way AndroidBuilder is configured."

7 years agoChange the way AndroidBuilder is configured.
Xavier Ducrohet [Fri, 24 Aug 2012 22:50:38 +0000]
Change the way AndroidBuilder is configured.

In order to build test apps and library apps we need
to seriously change the configuration of the builder.

It now receives a VariantConfiguration that contains
all that is needed. If the builder builds a test app
it also receives a VariantConfiguration for the tested
app.
This is critical for building apps that test libraries
as they will embed the library.

Also, the plugin now creates all tasks in afterEvaluate
as it is a lot simpler to loop on all build types and
product flavors. It also allow conditionally creating
some tasks based on the configuration of the project
flavors and build types.

Made a copy of the basic testapps where the build
is configured for multi-flavors.

Change-Id: Ib9a70b6fa79dec6cf939e1d4bd2e75559529e820

7 years agoMerge "Refactoring to prepare libary work"
Xavier Ducrohet [Thu, 23 Aug 2012 23:54:11 +0000]
Merge "Refactoring to prepare libary work"

7 years agoRefactoring to prepare libary work
Xavier Ducrohet [Thu, 23 Aug 2012 21:41:05 +0000]
Refactoring to prepare libary work

Change-Id: Ic319eaef33be775c707ea4983d6691addc2eee61

7 years agoMerge "Change the way the AndroidBuilder is created and used."
Xavier Ducrohet [Thu, 23 Aug 2012 23:21:09 +0000]
Merge "Change the way the AndroidBuilder is created and used."

7 years agoMerge "Use AndroidBuilder to build basic APK."
Xavier Ducrohet [Thu, 23 Aug 2012 23:20:53 +0000]
Merge "Use AndroidBuilder to build basic APK."

7 years agoChange the way the AndroidBuilder is created and used.
Xavier Ducrohet [Thu, 23 Aug 2012 00:34:00 +0000]
Change the way the AndroidBuilder is created and used.

The previous way relied on all tasks of a given
assemble<variant> to happen with no other task
(from another assemble<variant>) to happen in the
middle due to the single AndroidBuilder stored in the
plugin.

This changes this in the following way:
- There is now a map of (variant, builder).
- The configureVariant task is gone and the builder is done
  on demand
- The ApplcationVariant classes are reponsible for creating
  the builder since they own the data needed to initialize it.
- Each task receives both the AndroidBasePlugin and the variant
  in order to ask the variant to create the builder if the base
  plugin doesn't already have one.

Additionally this does the following:
- Removes the default value of the compilation target
- Fixes the runtimeJar given to the compiler. This
  queries the AndroidBuilder which replies with a list of jars
  which is then joined in a colon separated string. This
  is done in the doFirst of the compile task so that this is
  only done when the compile task runs.
- Fixes an issue exporting non signed apks.

Finally this refactors the plugin a bit moving stuff into
the AndroidBasePlugin (now a class) so that the library plugin
can use it later when I get to it.

Change-Id: I5ad05395b8cc7ad9a2aa7242ae635dca5579f8d4

7 years agoUse AndroidBuilder to build basic APK.
Xavier Ducrohet [Wed, 22 Aug 2012 02:00:28 +0000]
Use AndroidBuilder to build basic APK.

Notable changes:
- AndroidBuilder now receives ProjectFlavorHolder and
  BuildTypeHolder. This both contains the flavor/type
  themselves but also implements PathProvider to
  provide the needed path.
- The [ProductFlavor/BuildType]Dimension implements
  the Holder classes to provide those paths
- Moved to using the AndroidBuilder. It is created
  by the ConfigureVariant task and set in the plugin
  through the AndroidBasePlugin (will be used by
  both plugins) and queried by the tasks with a simple
  AndroidBuilderProvider
- Updated the mergeManifest, crunchRes, processRes,
  dex and packageApp tasks to use the AndroidBuilder.

The tasks to create test apps haven't been touched yet.

Known issues:
- AndroidBuilderProvider will not work for builds that
  create more than one APK.
- Because some inputs are not explicit in some tasks
  (they are figured out automatically on the
  AndroidBuilder side, touching some files will not
  trigger new builds. The task's TaskInputs object
  needs to be manipulated to help with this. This
  will be needed for the inputs coming from library
  dependencies as well anyway.

Change-Id: I7f9ca428ce2048ce92ed780367db0aaf01f6350b

7 years agoMerge "Create a Configure<Variant> task."
Xavier Ducrohet [Wed, 22 Aug 2012 21:12:37 +0000]
Merge "Create a Configure<Variant> task."

7 years agoMerge "Create a fat jar that contains the classes of the plugin and all dependencies."
Xavier Ducrohet [Wed, 22 Aug 2012 02:48:04 +0000]
Merge "Create a fat jar that contains the classes of the plugin and all dependencies."

7 years agoCreate a fat jar that contains the classes of the plugin and all dependencies.
Adam Murdoch [Wed, 22 Aug 2012 02:37:56 +0000]
Create a fat jar that contains the classes of the plugin and all dependencies.

Change-Id: I72c2c6a8942135cf1da809f56373e58bb3864062

7 years agoCreate a Configure<Variant> task.
Xavier Ducrohet [Wed, 22 Aug 2012 01:05:22 +0000]
Create a Configure<Variant> task.

This task creates and configure the AndroidBuilder that will be
used in the other tasks.

Change-Id: Iedbfcd709287256394c736eacbd7a9597ce2fee0

7 years agoMerge "Start integration of the builder lib in the gradle plug-in"
Xavier Ducrohet [Wed, 22 Aug 2012 00:47:21 +0000]
Merge "Start integration of the builder lib in the gradle plug-in"

7 years agoStart integration of the builder lib in the gradle plug-in
Xavier Ducrohet [Tue, 21 Aug 2012 19:18:01 +0000]
Start integration of the builder lib in the gradle plug-in

First step: move to the BuildType and ProductFlavor classes
from the builder library.

Change-Id: Ib83c590ff7dbf38774022d7539634835de9f31c0

7 years agoMerge "Changed plugin group and package names."
Xavier Ducrohet [Tue, 21 Aug 2012 18:49:22 +0000]
Merge "Changed plugin group and package names."

7 years agoMerge "Separated the prototype into plugin and test apps."
Xavier Ducrohet [Tue, 21 Aug 2012 18:46:11 +0000]
Merge "Separated the prototype into plugin and test apps."

7 years agoMerge "Android build library."
Xavier Ducrohet [Tue, 21 Aug 2012 18:41:11 +0000]
Merge "Android build library."

7 years agoMerge "Initial prototype of Gradle plugin to build Android applications"
Xavier Ducrohet [Tue, 21 Aug 2012 18:32:21 +0000]
Merge "Initial prototype of Gradle plugin to build Android applications"

7 years agoChanged plugin group and package names.
Adam Murdoch [Tue, 21 Aug 2012 06:17:18 +0000]
Changed plugin group and package names.

Now uses package 'com.android.build.gradle' for source,
and group 'com.android.build'.

The packages for the test applications have not been changed, yet.

Change-Id: Id55eb9ea91295c72d989844b1f1cdee1ca9b58c3

7 years agoSeparated the prototype into plugin and test apps.
Adam Murdoch [Tue, 21 Aug 2012 05:36:01 +0000]
Separated the prototype into plugin and test apps.

The plugin implementation has moved to the gradle/ directory,
and the test applications have moved under the testapps/
directory. This change means that you now have to run
./gradlew uploadArchives in the root directory to make the
plugin available to the test application builds via a
local repository (in repo/).

See the readme.md for more details about building and using
the test applications.

Change-Id: Id9b268aa1d6d1a5621513fb788b2dc90ca2793e8

7 years agoInitial prototype of Gradle plugin to build Android applications
Adam Murdoch [Sun, 19 Aug 2012 23:44:51 +0000]
Initial prototype of Gradle plugin to build Android applications

This is an initial prototype Gradle plugin that can build Android applications.
This is intended to demonstrate how such a plugin would be wired together. Most
of the tasks are placeholders for a real implementation. See the readme for
details.

Change-Id: I8f25493b9656c3919c0635c0e5363cdd9c8c171d

7 years agoAndroid build library.
Xavier Ducrohet [Tue, 21 Aug 2012 01:07:58 +0000]
Android build library.

This library allows building Android libraries and
applications in the context of the Android SDK.

It is meant to be usable by various build systems and only
deals with the logic of building Android applications.
While it exposes some configurations and expect from
specific inputs, they are meant to be provided by the
build system itself.

It purposely doesn't include Eclipse or IDEA project
files due to dependencies that are downloaded from Maven
(and due to IDEA's tendency to put local path in its
project paths).
Instead those can be created using
    gradle eclipse
and
    gradle idea

The prebuilts are temporary till we move those libraries
to gradle or figure something else.

Change-Id: Ia95fa9ae3a619c2d9fe68b4cfa3ce72acfb4df3c

7 years agoInitial empty repository
Chad Jones [Tue, 31 Jul 2012 23:07:02 +0000]
Initial empty repository