Add top-level python directory to opensource repo

This adds a home in our opensource repo for python libraries and binaries,
under a top-level "python" directory.  Future CLs will relocate ICANN
reporting bits and pieces to new homes under this directory, and will use
the MOE configuration and python_directory_import rule defined here.

This approach is roughly modeled on the protobuf Bazel opensource project,
which also uses a top-level directory for various languages, and also uses
the "imports" parameter to exclude that directory in python module names:
  https://github.com/google/protobuf/blob/v3.0.0-beta-3/BUILD#L568
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127459882
This commit is contained in:
nickfelt 2016-07-14 12:22:51 -07:00 committed by Ben McIlwain
parent 4ccc016e5c
commit eed319990a
16 changed files with 359 additions and 43 deletions

View file

@ -347,9 +347,12 @@ public final class AppEngineRule extends ExternalResource {
ImmutableSet.Builder<String> builder = new ImmutableSet.Builder<>();
try {
// To normalize the indexes, we are going to pass them through JSON and then rewrite the xml.
for (JSONObject index : getJsonAsArray(toJSONObject(indexFile)
.getJSONObject("datastore-indexes")
.opt("datastore-index"))) {
JSONObject datastoreIndexes = new JSONObject();
Object indexes = toJSONObject(indexFile).get("datastore-indexes");
if (indexes instanceof JSONObject) {
datastoreIndexes = (JSONObject) indexes;
}
for (JSONObject index : getJsonAsArray(datastoreIndexes.opt("datastore-index"))) {
builder.add(getIndexXmlString(index));
}
} catch (JSONException e) {
@ -384,7 +387,7 @@ public final class AppEngineRule extends ExternalResource {
builder.append(String.format(
"<datastore-index kind=\"%s\" ancestor=\"%s\" source=\"manual\">\n",
source.getString("kind"),
source.getString("ancestor")));
source.get("ancestor").toString()));
for (JSONObject property : getJsonAsArray(source.get("property"))) {
builder.append(String.format(
" <property name=\"%s\" direction=\"%s\"/>\n",