Interim fix for cyclic dependency
Prevent stat-uploading errors from polluting stdout

The error/warning messages that occur during stat-uploading are currently being printed to stdout, which breaks scripts that use pants output (e.g. "./pants goal list ::" chained with "./pants goal compile"). This RB is a fix for this issue.

Testing Done:
Local testing in a REPL

Reviewed at https://rbcommons.com/s/twitter/r/650/
WIP: Adding AaptGen task to android backend

Aapt is the codegen tool for Android builds. It spiders downward from
a given directory looking for resources. It creates a R.java, which
allows apps to reference the resources from their java code.
This class is a subclass of codegen, but is installed in the Android
backend.

Current status: './pants goal gen $ANDROID_TARGET' is green.
This is done by way of a new 'imports' parameter added to the java_protobuf_library target, which accepts jar dependencies as inputs. The syntax for this is:

java_protobuf_library(name='foo',
  imports=[
    jar(org='foo.com', name='bar', rev='1.2.3'), jar(org='bar.com', name='foo', rev='3.2.1'),
    '3rdparty:some-protobuf-jar-library',
  ],
  ...,
)

An extra ivy step called 'ivy-imports' (rather than ivy-resolve) has been added to accomodate this. It occurs after bootstrap and before codegen.

Testing Done:
Added junit test which uses .proto which includes imports .proto files I jarred and stuck on the maven central nexus. ci.sh is green on my machine and on travis. Also tested internally in the square repo.

The proto files on the maven central nexus were bundled with maven and do not reside in the main pants repo.

Bugs Closed: 297 http://github.com/pantsbuild/pants/issues#issue/297

Reviewd at: https://rbcommons.com/s/twitter/r/592/
AndroidDistribution class to fetch and validate Android SDK

The Android SDK has two components that are modularly installable and used in Android BUILD files- the API level for the target,
and the version of the build-tools used to construct the target. When a user has an SDK in their path, there is no guarantee that either
the API nor the build-tools version they need have been installed into their sdk.

This class looks for an Android SDK on the machine's path (using common SDK aliases) and then checks to see if the
requested API (target_sdk) and build-tools (build_tools_version) are installed. Most lookups are cached to minimize
repeated actions.

How we verify these installations is through checking for executables/files that comprise them. The SDK already provides a command-line tool
to manage installation of these modules but the only way to check installed targets is through grepping its output.
Since that tool doesn't seem to do much more than check for the presence of files/executables it seemed better to mimic those
checks as opposed to hacking up an output parser. As the class comments say, we can add more checks if we prefer.

Testing Done:
ci.sh passes locally.

Reviewed at https://rbcommons.com/s/twitter/r/636/
Added project-info flag to depmap goal.

Prints source roots, dependencies, and paths to libraries for targets and their dependencies in json format.
It can be run with: ./pants goal depmap /path/to/target --depmap-project-info

Adding the -format flag causes the output to return a single line of json:
./pants goal depmap /path/to/target --depmap-project-info --depmap-format

This functionality will be used for project import in the IntelliJ Pants plugin.

Testing Done:
Added tests for the goal (test_depmap.py), they pass

ci.sh runs successfully

Reviewed at https://rbcommons.com/s/twitter/r/600/
Fixup clean-all, clean-all-async and invalidate dependencies.

In the wake of Goal.dependencies no longer being used for scheduling,
clean-all and invalidate no longer properly depend on ng-killall.

Testing Done:
Ad-hoc:
$ for goal in clean-all clean-all-async invalidate ng-killall; do PANTS_DEV=1 ./pants goal $goal -e 2>/dev/null | grep $goal | grep "\["; done
clean-all [ng-killall->NailgunKillall, invalidate->Invalidator, clean-all->Cleaner]
clean-all-async [ng-killall->NailgunKillall, invalidate->Invalidator, clean-all-async->AsyncCleaner]
invalidate [ng-killall->NailgunKillall, invalidate->Invalidator]
ng-killall [ng-killall->NailgunKillall]

Bugs closed: 319

Reviewed at https://rbcommons.com/s/twitter/r/638/
Fix missing java & scala product types for ScroogeGen.

CodeGen handles this, but ScroogeGen is not a subclass.

Testing Done:
None.  I noticed this missing when working through RoundEngine validation improvements.

Bugs closed: 320

Reviewed at https://rbcommons.com/s/twitter/r/639/
Kill unused antlr deps in 3rdparty/BUILD.

Add a TODO in PythonAntlrBuilder to merge with
the AntlrGen task - right now PythonAntlrBuilder
does ~out of band ivy resolution of antlr tools.

Testing Done:
$ PANTS_DEV=1 ./pants goal clean-all
$ PANTS_DEV=1 ./pants goal test {src,tests}/{java,scala,python}::

Bugs closed: 322

Reviewed at https://rbcommons.com/s/twitter/r/642/
Add a note that build_lint.py is broken

Testing Done:
None

Bugs closed: 323

Reviewed at https://rbcommons.com/s/twitter/r/643/
Fixup a hidden jar <-> publish dependency cycle.

This simplifies JarCreate letting it just create classfile jars and
moves the responsibility of creating source and doc jars to the
only user - JarPublish.

Testing Done:
./build-support/bin/ci.sh

travis-ci went green here: https://travis-ci.org/pantsbuild/pants/builds/29627541

Bugs closed: 335

Reviewed at https://rbcommons.com/s/twitter/r/660/
Fixup RoundManager scheduling for phases that depend on themselves.

Handle this case explicitly and add test coverage for the
RoundEngine.

This also adds proper cli phase de-duping and validation
that requested data products actually have a producer.

Testing Done:
$ PANTS_DEV=1 ./pants goal clean-all
$ PANTS_DEV=1 ./pants goal test {src,tests}/{java,scala,python}::

Bugs closed: 324

Reviewed at https://rbcommons.com/s/twitter/r/644/
Add manifest parser to AndroidTarget

This removes the need to enter target_sdk and package variables
for every BUILD file in the package. It was always on the TODO,
but as I am prepping the codegen tasks, it seemd time. This removes
several params from the targets, docstrings are updated accordingly.
Clean 'resources' from BUILD file

Missed this in the cherry-pick due to merge-conflict. Ergh.
Fix the '--bundle-dup-excludes' flag and add '--bundle-dup-max-dups'

Now the default output prints out how many more you get:

   Duplicate classes and/or resources detected in artifacts: (u'commons-beanutils-commons-beanutils-1.7.0.jar', u'commons-beanutils-commons-beanutils-core-1.8.0.jar')
                        org/apache/commons/beanutils/BeanAccessLanguageException.class
                        org/apache/commons/beanutils/converters/URLConverter.class
                        org/apache/commons/beanutils/locale/converters/IntegerLocaleConverter.class
                        org/apache/commons/beanutils/converters/CharacterArrayConverter.class
                        org/apache/commons/beanutils/MethodUtils.class
                        org/apache/commons/beanutils/converters/BooleanConverter.class
                        org/apache/commons/beanutils/converters/ClassConverter.class
                        org/apache/commons/beanutils/DynaBean.class
                        org/apache/commons/beanutils/converters/BooleanArrayConverter.class
                        org/apache/commons/beanutils/Converter.class
                        ... 123 more ...

Testing Done:
I've got a lot of duplicate classes on the classpath to sort out...

devpants goal bundle <target> --bundle-dup-max-dups=50 --bundle-dup-excludes=dependencies,license,notice,.DS_Store,notice.txt,cmdline.arg.info.txt.1,license.txt,org.apache.hadoop.fs.FileSystem,BCKEY.DSA,BCKEY.SF,ASL2.0,javax.servlet.ServletContainerInitializer,about.html

Bugs closed: 332

Reviewed at https://rbcommons.com/s/twitter/r/656/
Fix depmap to be able to see past a Dependencies target.  We use dependencies() liberally to create short aliases users can use to build common targets.

Testing Done:
Added some unit tests to test_depmap.py

Bugs closed: 242, 336

Reviewed at https://rbcommons.com/s/twitter/r/661/
Merge remote-tracking branch 'pants/master' into manifest_parser
Add manifest parser to AndroidTarget

This removes the need to enter target_sdk and package variables
for every BUILD file in the package. It was always on the TODO,
but as I am prepping the codegen tasks, it seemd time. This removes
several params from the targets, docstrings are updated accordingly.
Clean 'resources' from BUILD file

Missed this in the cherry-pick due to merge-conflict. Ergh.
Add BadManifestError to catch malformed or incomplete manifests

This error would eventually cause problem sin the compilation
process, but since we are parsing the manifest here, uncaught
exceptions would appear to be pants-related problems, as opposed
to an issue with their Android project.