Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ package-lock.json
/.v8-prebuilt/
test-app/runtime/src/main/libs/*/libv8_monolith.a
test-app/runtime/src/main/libs/.v8-release-stamp
test-app/runtime/src/main/libs/*/.v8-release-stamp
test-app/runtime/src/main/cpp/include/**
!test-app/runtime/src/main/cpp/include/zip.h
!test-app/runtime/src/main/cpp/include/zipconf.h
Expand Down
2 changes: 1 addition & 1 deletion V8_RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8-14.9.207.39-7
v8-14.9.207.39-11
27 changes: 23 additions & 4 deletions download_v8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,20 @@ if [ -z "$RELEASE" ]; then
fi
[ ${#ABIS[@]} -gt 0 ] || ABIS=(arm64-v8a armeabi-v7a x86_64 x86)

# The stamp records which release was installed, not which ABIs were asked for,
# so a previous --abi run must not satisfy a later request for the full set.
# The installed files are the source of truth.
# $STAMP records the release the shared headers came from; each ABI's library
# has its own stamp, since an --abi run installs only some of them.
ABI_STAMP_NAME=".v8-release-stamp"

abi_release() {
local stamp="$LIBS_DIR/$1/$ABI_STAMP_NAME"
[ -f "$LIBS_DIR/$1/libv8_monolith.a" ] && [ -f "$stamp" ] && cat "$stamp"
}

installed() {
[ -f "$STAMP" ] && [ "$(cat "$STAMP")" = "$RELEASE" ] || return 1
[ -f "$CPP_DIR/include/v8.h" ] && [ -d "$CPP_DIR/v8_inspector/src" ] || return 1
for abi in "${ABIS[@]}"; do
[ -f "$LIBS_DIR/$abi/libv8_monolith.a" ] || return 1
[ "$(abi_release "$abi")" = "$RELEASE" ] || return 1
done
}

Expand Down Expand Up @@ -132,6 +138,19 @@ for ABI in "${ABIS[@]}"; do
[ -f "$src" ] || { echo "Archive for $ABI has no libv8_monolith.a" >&2; exit 1; }
mkdir -p "$LIBS_DIR/$ABI"
cp "$src" "$LIBS_DIR/$ABI/libv8_monolith.a"
echo "$RELEASE" > "$LIBS_DIR/$ABI/$ABI_STAMP_NAME"
done

# An ABI this run did not install keeps another release's library, which must
# not be linked against the headers installed below: remove it, so a build of
# that ABI fails until it is installed for this release too.
for dir in "$LIBS_DIR"/*/; do
abi="$(basename "$dir")"
[ -f "$dir/libv8_monolith.a" ] || continue
if [ "$(abi_release "$abi")" != "$RELEASE" ]; then
echo " removing $abi's library from another release; run with --abi $abi to install it"
rm -f "$dir/libv8_monolith.a" "$dir/$ABI_STAMP_NAME"
fi
done

echo "Installing public headers"
Expand Down