Improve inheritance and kwargs passing between android_binary and target.

Remove unused params from AndroidBinary __init__, as referencing them
would prevent those kwargs from being passed in the super() call.

Referenced from lahosken @ https://rbcommons.com/s/twitter/r/610

This patch is dependent on that CR, review #610

Testing Done:
ci.sh passed.
Travis passed: https://travis-ci.org/pantsbuild/pants/builds/28694692

Reviewed at https://rbcommons.com/s/twitter/r/614/
start doc'ing py goals. set up python_old for old UI, start refactoring python-readme.

Python supports 'goal test' and 'goal binary' now. python-readme should reflect that.
This change doesn't 100% fix that; but it's a step in the right direction.

Twitter's biggest python-Pants codebase is on an old Pants.
(also, a couple of open-source Pants-built repos)
This makes me hesitate to blow away the old doc just yet.

This change...

  copies python-readme to python_old.

  adds paragraph at top of python-readme "Are your Pants old? Then see python_old"

  rm'd some historical python-readme parts now less-obsoletely doc'd on other pages

  mv'd some PEX-design-background material onto a new page pex_design.
  (It might make more sense for me to mv this to twitter/commons?
   I dunno. If you tell me to move it to twitter/commons, I will.)

  mv'd some python-readme parts to other pages

  Added a couple of TODO github issue links for biggish problems noticed
  along the way.

I'm not trying to get python-readme perfect in this pass.
This is mostly moving material around.

That said, a couple of examples now use 'goal'. YAY

Testing Done:
./build-support/bin/publish_docs.sh # stuff looks OK

./build-support/bin/ci.sh # docstring changes apparently nonfatal

Bugs closed: 258

Reviewed at https://rbcommons.com/s/twitter/r/594/
Install android_binary and android_resource target. Add example android app

Added pants.backend.codegen.targets.android_resources. Installed it into pants.
Added a BUILD file to src/android/example/res to make it a target  and added it to the source_root.
Updated any tests that required it.

Addresses (and hopefully fixes) issue opened last review. Testing Done section updated with this change.

Testing Done:
ci.sh success: http://pastebin.com/fWF7Uu7W

travis success: https://travis-ci.org/pantsbuild/pants/builds/28652096

Reviewed at https://rbcommons.com/s/twitter/r/591/
doc: upgrade our google analytics invocation, plagiarizing
https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs

Testing Done:
published to subdir http://pantsbuild.github.io/larrys-world/
opened chrome dev tools JS console, entered ga('send', 'ihavenoideawhatimdoing')
in chrome dev tools network tab, saw I fetched a gif from google, part of whose url was ihavenoideawhatimdoing

Bugs closed: 235

Reviewed at https://rbcommons.com/s/twitter/r/574/
Refactor the engine to build the phase graph recursively via requesting
products: RoundEngine
Related issue: https://github.com/pantsbuild/pants/issues/247

Was driven by:
https://github.com/pantsbuild/pants/issues/152

The "idea" goal is special since it requires a compile of a sub-graph of
the overall Target graph followed by a gen on the entire graph.
Currently, there is no non-hacky way of specifying a specific section of
the Target graph to be passed to a specific task.

This refactor, aims to extract out the scheduling of Tasks and their
dependencies from register.py (where its been traditionally stored) and
be able to pass through a Target graph if/when required. No matter what
order goals are specified in the register.py, their order is overwritten
by the prepare()/product_type() pairing.

This change is for building the phase graph recursively via requesting
products in prepare(..) and advertising products via a Task classmethod
product_type().
Upgrade commons deps and use public releases.

This is in preparation for the 1st pypi release of
pantsbuild.pants.

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

Bugs closed: 304

Reviewed at https://rbcommons.com/s/twitter/r/616/
docs: update first_tutorial: output of ./pants goal help test

reviewed at https://rbcommons.com/s/twitter/r/413/

and further updated since now -h is a thing
Resolve phase should run before Resources.
Issue - https://github.com/pantsbuild/pants/issues/307

Modified resources phase to depend on the products of resolve to fix the order.
Removed resources deps from compile and added to other phases like repl.
Explicitly initialize the logger

Explicitly initialize the logging library.  See issue https://github.com/pantsbuild/pants/pull/305

Also added printing absolute path for BuildFile string to help clarify when the BUILD file in question is actually in the root.

Testing Done:
Added a typo in the root BUILD file.  Before the patch, an error message is printed when the name of the file should be output.  After the patch, the logging message is printed.

Bugs closed: 305

Reviewed at https://rbcommons.com/s/twitter/r/618/
Adding os.path.realpath to help macos build pass tests.

Testing Done:
pants goal test tests/python/pants::

I get 3 errors when I do this locally due to the fact that scala no longer works on my box.

Bugs closed: 312

Reviewed at https://rbcommons.com/s/twitter/r/624/
docstrings (and more) update post-target-refactor

target docs were obsolete and/or just plain wrong:
  claimed sources= param was a list of strings
  claimed targets= param was a list of targets

target method Page.register_wiki
was tagged (with @manual.builddict) for inclusion in
the BUILD dictionary; this is now a troll, you can't call
target methods in BUILD files.

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

./build-support/bin/publish_docs.sh -o
searched BUILD dictionary for old phrases "list of targets", "(list of files)", "base.Target"; confirmed they're gone

Bugs closed: 138, 140

Reviewed at https://rbcommons.com/s/twitter/r/391/
Kill Context.state - its no longer used nor should it be used again.

Testing Done:
CI ran green: https://travis-ci.org/pantsbuild/pants/builds/28965745

Bugs closed: 313

Reviewed at https://rbcommons.com/s/twitter/r/625/
Fixup RoundEngine scheduling.

Do a recursive walk to construct and prepare Tasks as before
but then do a tsort after the full walk when all the dependency
edges are known.

This also takes a pass over all jvm Tasks to ensure proper deps
are requested in prepare and in the cases where the deps are
improper TODOs are added calling out whats needed.

Testing Done:
CI passes locally and travis is away here: https://travis-ci.org/pantsbuild/pants/builds/28997865

I did these sanity checks for jvm goals:
$ function sanity() { for goal in "$@"; do echo "$goal:" && PANTS_DEV=1 ./pants goal --explain $goal 2>/dev/null | head -3 | tail -1 && echo; done; }
$ sanity gen resolve compile test run repl doc jar binary bundle
gen:
bootstrap -> gen

resolve:
bootstrap -> gen -> check-exclusives -> resolve

compile:
bootstrap -> gen -> check-exclusives -> resolve -> compile

test:
bootstrap -> gen -> check-exclusives -> resolve -> compile -> resources -> test

run:
bootstrap -> gen -> check-exclusives -> resolve -> compile -> resources -> run

repl:
bootstrap -> gen -> check-exclusives -> resolve -> compile -> resources -> repl

doc:
bootstrap -> gen -> check-exclusives -> resolve -> compile -> doc

jar:
bootstrap -> gen -> check-exclusives -> resolve -> compile -> resources -> jar

binary:
bootstrap -> gen -> check-exclusives -> resolve -> compile -> resources -> binary

bundle:
bootstrap -> gen -> check-exclusives -> resolve -> compile -> resources -> bundle

Also checking the un-constrained cli handling - note clean-all killserver server order is maintained and compile is de-duped:
$ PANTS_DEV=1 ./pants goal --explain clean-all killserver server test depmap compile
*** Running pants in dev mode from /home/jsirois/dev-jsirois-pants/src/python/pants/bin/pants_exe.py ***
(using pantsrc expansion: pants goal --explain clean-all killserver server test depmap compile --server-open)
Phase Execution Order:

clean-all -> killserver -> server -> bootstrap -> gen -> check-exclusives -> resources -> resolve -> compile -> test -> depmap

Bugs closed: 314, 316

Reviewed at https://rbcommons.com/s/twitter/r/627/
Added support for including .proto files in remote .jars on the --proto_path when compiling with protoc.

This is done by way of a new 'imports' parameter added to the java_protobuf_library target, which accepts jar dependencies and jar library targets 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-jar-library-containing-protos',
  ],
  ...,
)

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