Skip to content

Commit

Permalink
Use openjdk7 as dependency for debian package of jdk7 flavor
Browse files Browse the repository at this point in the history
Fixes #752.

--
MOS_MIGRATED_REVID=111614541
  • Loading branch information
damienmg committed Jan 7, 2016
1 parent 006ab49 commit b95995b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
18 changes: 12 additions & 6 deletions scripts/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,13 @@ function setup_jdk7() {
export BAZEL_SKIP_TOOL_COMPILATION=tools/jdk/JavaBuilder_deploy.jar
# Ignore JDK8 tests
export BAZEL_TEST_FILTERS="-jdk8"
# And more ugly hack. Overwrite the BUILD file of JavaBuilder
# so we use the pre-built version in integration tests.
sed -i.bak 's/name = \"JavaBuilder\"/name = \"RealJavaBuilder\"/' \
src/java_tools/buildjar/BUILD
rm -f src/java_tools/buildjar/BUILD.bak
cat >>src/java_tools/buildjar/BUILD <<'EOF'
if ! grep -Fq 'RealJavaBuilder' src/java_tools/buildjar/BUILD; then
# And more ugly hack. Overwrite the BUILD file of JavaBuilder
# so we use the pre-built version in integration tests.
sed -i.bak 's/name = \"JavaBuilder\"/name = \"RealJavaBuilder\"/' \
src/java_tools/buildjar/BUILD
rm -f src/java_tools/buildjar/BUILD.bak
cat >>src/java_tools/buildjar/BUILD <<'EOF'
genrule(
name = "JavaBuilder",
outs = ["JavaBuilder_deploy.jar"],
Expand All @@ -133,6 +134,7 @@ genrule(
visibility = ["//visibility:public"],
)
EOF
fi
}

# Main entry point for building bazel.
Expand All @@ -148,8 +150,11 @@ function bazel_build() {
fi

if [[ "${JAVA_VERSION-}" =~ ^(1\.)?7$ ]]; then
JAVA_VERSION=1.7
setup_jdk7
release_label="${release_label}-jdk7"
else
JAVA_VERSION=1.8
fi

setup_android_repositories
Expand All @@ -165,6 +170,7 @@ function bazel_build() {
./output/bazel --bazelrc=${BAZELRC:-/dev/null} --nomaster_bazelrc build \
--embed_label=${release_label} --stamp \
--workspace_status_command=scripts/ci/build_status_command.sh \
--define JAVA_VERSION=${JAVA_VERSION} \
//scripts/packages/... || exit $?

if [ -n "${1-}" ]; then
Expand Down
18 changes: 15 additions & 3 deletions scripts/packages/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,26 @@ genrule(
stamp = 1,
)

config_setting(
name = "jdk7",
values = {"define": "JAVA_VERSION=1.7"},
)

pkg_deb(
name = "bazel-debian",
architecture = "amd64",
built_using = "bazel (HEAD)",
data = ":debian-data",
depends = [
"openjdk-8-jdk",
"openjdk-8-source",
depends = select({
":jdk7": [
"openjdk-7-jdk",
"openjdk-7-source",
],
"//conditions:default": [
"openjdk-8-jdk",
"openjdk-8-source",
],
}) + [
"pkg-config",
"zip",
"g++",
Expand Down

0 comments on commit b95995b

Please sign in to comment.