facebook/buck — pull request #144 by dpursehouse (2014-06-26 07:43:49+00:00)
Title: Improve error messages when build target parse preconditions fail

Summary:

When a build target pattern does not begin with '//', the build
fails with the error:

java.lang.IllegalArgumentException: buildTargetPattern must start with //

Change this error message to include the name of the target that
caused the failure, making it easier to find and fix it.

Also, add quote marks in appropriate places in the error messages.

Test Plan:

1. Build Gerrit containing a broken maven_jar definition

maven_jar(
name = 'objenesis',
id = 'org.objenesis:objenesis:1.2',
sha1 = 'bfcb0539a071a4c5a30690388903ac48c0667f2a',
license = 'DO_NOT_DISTRIBUTE',
visibility = [':easymock', '//lib/powermock:powermock-reflect'],
attach_source = False,
)

2. Observe the error message:

java.lang.IllegalArgumentException: ':easymock' must start with '//'

3. Don't spend ages tearing out hair trying to figure out where the
error is coming from.