aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Yun Peng <pcloudy@google.com>2017-02-02 11:26:15 +0000
committerGravatar Yun Peng <pcloudy@google.com>2017-02-02 17:00:07 +0000
commitd5649814525d62d787a1dbeb596ef6ac5d2c7d38 (patch)
tree970a8f419e4ccd3e1d30950c9716778c815dd101
parent1f2caa59933cdf6fe2a74f44c76f0cf89ad4d8c1 (diff)
*** Reason for rollback *** Introduced some code that doesn't work on macOS blaze-out/host/bin/tools/objc/xcodegen: line 181: mapfile: command not found blaze-out/host/bin/tools/objc/xcodegen: line 184: declare: -A: invalid option *** Original change description *** Automated [] rollback of commit 00ac342f386be8b8ce1bdb11515c7828e86903c0. *** Reason for rollback *** Roll forward commit bbfa9fa5ad1dd66ecedcb136a4ff3d0f8d397b9b with fix *** Original change description *** Automated [] rollback of commit bbfa9fa5ad1dd66ecedcb136a4ff3d0f8d397b9b. *** Reason for rollback *** Wrong submit with unresolved issues *** Original change description *** Java template windows performance Address issue #2426 Closes #2427. -- PiperOrigin-RevId: 146347067 MOS_MIGRATED_REVID=146347067
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt17
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template_windows.txt3
2 files changed, 5 insertions, 15 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
index 3659d93b01..36575d52ab 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template.txt
@@ -74,10 +74,10 @@ die() {
}
# Windows
-PLATFORM="$OSTYPE"
+PLATFORM="$(uname -s | tr 'A-Z' 'a-z')"
function is_windows() {
# On windows, the shell test actually running on msys
- if [[ "${PLATFORM}" =~ msys* ]]; then
+ if [[ "${PLATFORM}" =~ msys_nt* ]]; then
true
else
false
@@ -177,22 +177,11 @@ if [ -z "$RUNFILES_MANIFEST_ONLY" ]; then
fi
}
else
- # Read file into my_array
- mapfile -t my_array < $RUNFILES_MANIFEST_FILE
-
- # Process each runfile line into a [key,value] entry in runfiles_array
- declare -A runfiles_array
- for line in "${my_array[@]}"
- do
- line_split=($line)
- runfiles_array[${line_split[0]}]=${line_split[1]}
- done
-
function rlocation() {
if [[ "$1" = /* ]]; then
echo $1
else
- echo ${runfiles_array[$1]}
+ echo $(grep "^$1 " $RUNFILES_MANIFEST_FILE | awk '{ print $2 }')
fi
}
fi
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template_windows.txt b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template_windows.txt
index b367f86dd7..179d55cdee 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template_windows.txt
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/java_stub_template_windows.txt
@@ -20,12 +20,13 @@
@SETLOCAL ENABLEEXTENSIONS
@set bash_path=%bash_exe_path%
+@set cygpath_path=%cygpath_exe_path%
@rem launcher=${$0%.cmd}
@set launcher=%~dp0%~n0
@rem sh_path=$($cygpath_path -m $launcher)
-@set sh_path=%launcher:\=/%
+@for /f %%i in ('%cygpath_path% -m %launcher%') do @set sh_path=%%i
@rem replaces $ with \$ in $*, then puts it on the command line
@rem Cribbed from here: http://ss64.com/nt/syntax-replace.html