Skip to content

Commit

Permalink
Tweak the bootstrapping and build process so that the prebuilt tools …
Browse files Browse the repository at this point in the history
…under tools/jdk are not necessary anymore.

Fixes bazelbuild#508.

--
MOS_MIGRATED_REVID=108123264
  • Loading branch information
lberki committed Nov 18, 2015
1 parent 07475c7 commit 9b1e3a2
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 20 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@
/base_workspace/src
/bazel.iml
/tools/jdk/jdk
/tools/jdk/ijar
/tools/jdk/JavaBuilder_deploy.jar
/tools/jdk/GenClass_deploy.jar
/tools/jdk/SingleJar_deploy.jar
/tools/objc/*.jar
/tools/objc/actoolwrapper.sh
/tools/objc/ibtoolwrapper.sh
Expand Down
8 changes: 0 additions & 8 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,6 @@ fi

source scripts/bootstrap/bootstrap.sh
if [ $DO_TOOLS_COMPILATION ]; then
new_step 'Building Bazel tools'
bazel_bootstrap //third_party/ijar:ijar tools/jdk/ijar 0755
bazel_bootstrap //src/java_tools/singlejar:SingleJar_deploy.jar \
tools/jdk/SingleJar_deploy.jar
bazel_bootstrap //src/java_tools/buildjar:JavaBuilder_deploy.jar \
tools/jdk/JavaBuilder_deploy.jar
bazel_bootstrap //src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass:GenClass_deploy.jar \
tools/jdk/GenClass_deploy.jar
if [[ $PLATFORM == "darwin" ]]; then
bazel_bootstrap //src/tools/xcode/actoolwrapper:actoolwrapper tools/objc/actoolwrapper.sh 0755
bazel_bootstrap //src/tools/xcode/ibtoolwrapper:ibtoolwrapper tools/objc/ibtoolwrapper.sh 0755
Expand Down
4 changes: 4 additions & 0 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ genrule(
"//src/tools/android/java/com/google/devtools/build/android/incrementaldeployment:srcs",
"//src/tools/android/java/com/google/devtools/build/android/ziputils:embedded_tools",
"//src/main/protobuf:srcs",
"//src/java_tools/buildjar:JavaBuilder_deploy.jar",
"//src/java_tools/singlejar:SingleJar_deploy.jar",
"//src/java_tools/buildjar/java/com/google/devtools/build/buildjar/genclass:GenClass_deploy.jar",
"//third_party/ijar",
],
outs = ["embedded_tools.zip"],
cmd = "$(location :create_embedded_tools.sh) $@ $(SRCS)",
Expand Down
9 changes: 8 additions & 1 deletion src/create_embedded_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ mkdir -p "${PACKAGE_DIR}"
trap "rm -fr \"${PACKAGE_DIR}\"" EXIT

for i in $*; do
OUTPUT_PATH=$(echo $i | sed 's_^.*bazel-out/[^/]*/bin/__')
case "$i" in
*JavaBuilder_deploy.jar) OUTPUT_PATH=tools/jdk/JavaBuilder_deploy.jar ;;
*SingleJar_deploy.jar) OUTPUT_PATH=tools/jdk/SingleJar_deploy.jar ;;
*GenClass_deploy.jar) OUTPUT_PATH=tools/jdk/GenClass_deploy.jar ;;
*ijar) OUTPUT_PATH=tools/jdk/ijar ;;
*) OUTPUT_PATH=$(echo $i | sed 's_^.*bazel-out/[^/]*/bin/__') ;;
esac

mkdir -p "${PACKAGE_DIR}/$(dirname "${OUTPUT_PATH}")"
cp "$i" "${PACKAGE_DIR}/${OUTPUT_PATH}"
done
Expand Down
7 changes: 0 additions & 7 deletions tools/jdk/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ java_toolchain(
target_version = "8",
)

exports_files([
"JavaBuilder_deploy.jar",
"ijar",
"SingleJar_deploy.jar",
"GenClass_deploy.jar",
])

filegroup(
name = "srcs",
srcs = [
Expand Down

0 comments on commit 9b1e3a2

Please sign in to comment.