sample: java hello world. use resource. change bundled-file example.

We want to demonstrate resources. We want to demonstrate file-bundles. The 'hello world' example was using a bundled file for something you'd more-properly use a resource for. So don't do that.

Instead, load two "greetees". Load one from a bundled file, one from resource.

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

$ ./pants goal bundle src/java/com/pants/examples/hello/main
$ cd dist/main-bundle/
$ java -jar main-bin.jar

$ ./pants goal run src/scala/com/pants/example/hello/exe

Bugs closed: https://github.com/pantsbuild/pants/issues/110

Reviewed at https://rbcommons.com/s/twitter/r/350/
docs: internals += def'n for "backend", links to couple of mail threads

We keep saying "backend" on the pants-devel mailing list. Maybe we should define it somewhere.

Reviewed at https://rbcommons.com/s/twitter/r/449/
Cleanup of cache manager and jvm compile task.

- Make fingerprint_strategy a ctor arg instead of passing it around everywhere.

- Get rid of a stale recomputation of sources-by-target.
Don't use # in cache keys; http throws away the suffix

Testing Done:
CI passes.

Bugs closed: https://github.com/pantsbuild/pants/issues/184

Reviewed at https://rbcommons.com/s/twitter/r/453/
docs: update howto_contribute: pants-reviews exists

Let us not be mired in nostalgia for the time when pants-devel could handle the traffic of our many, many code reviews.

Reviewed at https://rbcommons.com/s/twitter/r/424/
git_version wasn't expecting a version number that contained letters, LOL

My whacked-out installed git from DTurner's mad science lab has version "number" 1.9.1.598.g9119e8b .
git_version's regexp wasn't expecting letters mixed in there.
So this test was crashing, trying to call None.group(2)

I changed the behavior: get the part of the version that looks like
dotted numbers. Get the 1.9.1.598, drop the letter-y part.

Testing Done:
Now the test doesn't crash.

(The test fails for me running DTurner's mad science git.
DTurner knows and is saying things that make me think he
knows what's going on, yay)

Reviewed at https://rbcommons.com/s/twitter/r/456/
Run python tests under goal.

This introduces a new task to run python tests.

It leaves the old-pants test running intact, so
there's no change for existing users.
Fix a mismatch in the expected and actual module names in ivy resolution.
Implement new plugin to implement callables that need to create targets

Testing Done:
https://travis-ci.org/pantsbuild/pants/builds/26734850

Local testing done too:

[tw-172-25-20-142 pants]$ head examples/BUILD
make_lib(org='com.twitter', name="test", rev="1.0")
[tw-172-25-20-142 pants]$

[tw-172-25-20-142 pants]$ git diff
diff --git a/src/python/pants/backend/core/register.py b/src/python/pants/backend/core/register.py
index 1539ca1..468d35c 100644
--- a/src/python/pants/backend/core/register.py
+++ b/src/python/pants/backend/core/register.py
@@ -61,8 +61,9 @@ def partial_path_relative_util_aliases():

 def callable_build_file_functions():
-  return {}
-
+  return {
+    'make_lib': make_lib,
+  }

 # aliases
 def target_aliases():
@@ -175,3 +176,29 @@ def register_goals():

   goal(name='roots', action=ListRoots
   ).install('roots').with_description("Print the workspace's source roots and associated target types.")
+
+
+def make_lib(alias_map, org, name, rev, alias=None, sources=True, excludes=None):
+  """A helper method to create jar libraries.
+  """
+
+  dep = alias_map['jar'](org=org, name=name, rev=rev)
+  if sources:
+    dep.with_sources()
+  if excludes:
+    for exclude in maybe_list(excludes, Exclude):
+      dep.exclude(org=exclude.org, name=exclude.name)
+  lib = alias_map['jar_library'](name=name, jars=[dep])
+  if alias:
+    alias_map['jar_library'](name=alias, jars=[lib])
+  return lib

[tw-172-25-20-142 pants]$ PANTS_DEV=1 ./pants goal list examples/BUILD::
*** Running pants in dev mode from /Users/tdesai/projects/pants/src/python/pants/bin/pants_exe.py ***
Loading pants backends from source
examples/BUILD:test
[tw-172-25-20-142 pants]$

Bugs closed: 185

Reviewed at https://rbcommons.com/s/twitter/r/452/
Upgrade to com.twitter.common#jar-tool;0.1.6

This picks up a fix for moving the temporary jar file created
to it final target location when the two reside on different
filesystems.

Testing Done:
$ PANTS_DEV=1 ./pants goal binary bundle src/java/com/pants/::

Bugs closed: 193

Reviewed at https://rbcommons.com/s/twitter/r/465/
Updated build file parser error message when the same target is redefined

Testing Done:
Added a new test in test_build_file_parser.py and updated an existing one.

I tested with

PANTS_DEV=1 ./pants tests/python/pants_test/base:build_file_parser --verbose

but am currently unable to retest or run ci because of the ... untranslatable ... errors.

Bugs closed: 192

Reviewed at https://rbcommons.com/s/twitter/r/464/
Upgrade jmake to 1.3.8-3, fixes issues where builds would fail when package-info.java is present.
Add package-info.java to test that it does not fail the build.

Reviewed at https://rbcommons.com/s/twitter/r/457/
Use temporary directory for publish local

Testing Done:
Locally.

CI.
https://travis-ci.org/pantsbuild/pants/builds/27161708

Bugs closed: 195

Reviewed at https://rbcommons.com/s/twitter/r/469/
remove unused parameter

Testing Done:
 ./pants goal test tests/python/pants_test:all

Bugs closed: 173

Reviewed at https://rbcommons.com/s/twitter/r/468/
fix a couple of missing deps

Testing Done:
./pants tests/python/pants_test:all

It passes. With this change, it passes even if I recently cleaned.

Reviewed at https://rbcommons.com/s/twitter/r/471/
Fix some nits.
Upgrade jar-tool to 0.1.7

This picks up a fix that prevented clean cross-fs
jar copies due to unclosed temprorary files.

Testing Done:
# observed jar-tool 0.1.7 ivy download and subsequent jarring (not cross-fs) work:
$ PANTS_DEV=1 ./pants goal clean-all killserver server
$ PANTS_DEV=1 ./pants goal binary bundle src/{java,scala}/::

Bugs closed: 198

Reviewed at https://rbcommons.com/s/twitter/r/475/
get doc gen working post-backend-refactor

'goal builddict' runs instead of crashing, yay.
re-enabled builddict tests; took out the "len(usual_symbols)>20" test; couldn't figure out an easy way to get the "usual symbols". No big loss; I don't think that test ever found an error.

Added a hardwired entry for the now-gone "egg" in BUILD dictionary: "If your pants is old, there might be `egg` in there." Sounds like instructions for someone wearing an outfit from the Owl Thrift Shop, but there you go.

gen.py grabbed code from "tasks" and "targets" dir. But now there's more than one of those dirs, so check 'em all.

Testing Done:
./pants tests/python/pants_test:all

./build-support/bin/publish_docs.sh -o
  compare list of entries in an old and new BUILD Dictionary (and thus notice "egg" went bye-bye)

Reviewed at https://rbcommons.com/s/twitter/r/463/
Fixup python integration tests under ci.

Release the lock for the pytest task as is done for the junit task
and other code-run tasks (run, repl).

Convert ci to use the pytest task (test goal) and eliminate dup
runs of python tests by restricting the jvm tests to just the
jvm targets.

This change also adds pass-through args for pytest to aid debugging
tests and otherwise running them.  When using this to un-suppress
pytest output, a second form of test blocking was uncovered with
the stdin 'yes' plumbing not working properly.  As a result this
change tweaks the IT in question to use a more robust method of stdin
piping to the pants subprocess.

Testing Done:
1st reproed IT test lock under the test goal (worked find under old build command test runner).

Python tests run once (normal and IT), and they no longer block.
$ ./build-support/bin/ci.sh

Also confirmed the it works with output un-suppressed:
$ PANTS_DEV=1 ./pants goal test tests/python/pants_test:integration --test-pytest-options="-v -s"
...
12:56:36 00:01   [test]
12:56:36 00:01     [pytest]
12:56:36 00:01       [run]
                     *** Running pants in dev mode from /home/jsirois/dev/3rdparty/jsirois-pantsbuild-pants2/src/python/pants/bin/pants_exe.py ***
                     ============== test session starts ===============
                     platform linux3 -- Python 2.6.8 -- py-1.4.20 -- pytest-2.5.2 -- /home/jsirois/dev/3rdparty/pyenv/versions/2.6.8/bin/python
                     plugins: cov, timeout
                     collected 2 items

                     tests/python/pants_test/tasks/test_jar_publish_integration.py:25: JarPublishIntegrationTest.test_java_publish Loading pants backends from source

                     12:56:38 00:00 [main]
                                    See a report at: http://localhost:37586/run/pants_run_2014_06_10_12_56_38_23
...
                     12:56:44 00:06     [jar_create_publish]
                     12:56:44 00:06       [jar-create]....
                     12:56:46 00:08     [publish]Skipping check for a clean jsirois/travis/it_unblock in test mode.

                     Changes for com.pants.examples#hello-greet since 0.0.0 @ None:

                     commit 7c56621a9c4e8a3aca2bee567d77e5a13b6f8a3b
                     Author: Benjy <benjy@foursquare.com>
                     Date:   Tue Apr 1 02:34:30 2014 +0000

                         Introduce java examples.

                      .../hello/greet/Greeting.java    | 13 ++++++++++
                      1 file changed, 13 insertions(+)

                     12:56:46 00:08       [jar-publish]
                                    Waiting for background workers to finish.
                                    SUCCESS*** Running pants in dev mode from /home/jsirois/dev/3rdparty/jsirois-pantsbuild-pants2/src/python/pants/bin/pants_exe.py ***

                     PASSED

...

Bugs closed: 201

Reviewed at https://rbcommons.com/s/twitter/r/478/