From 84cd8971587f3484471b2df5f7a8082bd1309498 Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Fri, 20 Jun 2014 11:07:44 -0400 Subject: [PATCH 1/3] Add example workspace --- README.md | 1 - google3/tools/genrule/BUILD | 3 +++ google3/tools/genrule/genrule-setup.sh | 0 3 files changed, 3 insertions(+), 1 deletion(-) delete mode 100644 README.md create mode 100644 google3/tools/genrule/BUILD create mode 100644 google3/tools/genrule/genrule-setup.sh diff --git a/README.md b/README.md deleted file mode 100644 index 147c3961fee8ff..00000000000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -Bazel. diff --git a/google3/tools/genrule/BUILD b/google3/tools/genrule/BUILD new file mode 100644 index 00000000000000..5ad2a6ab464512 --- /dev/null +++ b/google3/tools/genrule/BUILD @@ -0,0 +1,3 @@ +exports_files([ + "genrule-setup.sh", +]) diff --git a/google3/tools/genrule/genrule-setup.sh b/google3/tools/genrule/genrule-setup.sh new file mode 100644 index 00000000000000..e69de29bb2d1d6 From 2f6407f8d57e750d2f6c0bbcbec426bab36b3849 Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Fri, 20 Jun 2014 12:32:14 -0400 Subject: [PATCH 2/3] Put workspace under example-workspace --- {google3 => example-workspace/google3}/tools/genrule/BUILD | 0 .../google3}/tools/genrule/genrule-setup.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {google3 => example-workspace/google3}/tools/genrule/BUILD (100%) rename {google3 => example-workspace/google3}/tools/genrule/genrule-setup.sh (100%) diff --git a/google3/tools/genrule/BUILD b/example-workspace/google3/tools/genrule/BUILD similarity index 100% rename from google3/tools/genrule/BUILD rename to example-workspace/google3/tools/genrule/BUILD diff --git a/google3/tools/genrule/genrule-setup.sh b/example-workspace/google3/tools/genrule/genrule-setup.sh similarity index 100% rename from google3/tools/genrule/genrule-setup.sh rename to example-workspace/google3/tools/genrule/genrule-setup.sh From f6b9440a751b8d70ae58acc1aeb42a47e36e524c Mon Sep 17 00:00:00 2001 From: Kristina Chodorow Date: Fri, 20 Jun 2014 12:46:46 -0400 Subject: [PATCH 3/3] Update README --- README.md | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 750bba62fcdb00..74ce6a339c0484 100644 --- a/README.md +++ b/README.md @@ -4,36 +4,30 @@ Building Bazel We currently only support building on Ubuntu, and the binaries only run on Ubuntu. You will need packages for the protobuf-compiler, and for libarchive: -apt-get install protobuf-compiler libarchive-dev + apt-get install protobuf-compiler libarchive-dev Then run: -./compile.sh + + ./compile.sh We are working on bootstrapping bazel with itself. Running Bazel ============= -Create a google3 directory. This is your package root where all of your builds -will happen (we're working on removing the google3 naming requirement). Add the -following directory structure: - - $ cd google3 - $ mkdir -p tools/genrule my_output my_install - $ touch tools/genrule/genrule-setup.sh - -Create tools/genrule/BUILD and add the following to it: +Bazel has some workspace setup requirements (which we're working on removing). +All builds need to happen from within a google3 directory (or subdirectory) and +have certain files exist in certain places. To get your workspace set up +correctly, copy example-workspace/google3 to wherever you want to do your +builds. - exports_files([ - "genrule-setup.sh", - ]) - -Create your own project with a BUILD file, for example: +Create your own project with a BUILD file within this google3 directory, for +example: + $ cd google3 $ mkdir -p hello $ echo 'genrule(name = "world", outs = ["hi"], cmd = "touch $(@D)/hi")' > hello/BUILD - Now run Bazel using --output_base and --install_base options, e.g., $ bazel --output_base=my_output --install_base=my_install build //hello:world