Skip to content

Commit

Permalink
Always vendor JDK
Browse files Browse the repository at this point in the history
  • Loading branch information
Naaman Newbold committed Apr 3, 2013
1 parent 625fc9d commit e924076
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,26 @@ CACHE_DIR=$2
curl --silent --location http://heroku-jvm-common.s3.amazonaws.com/jvm-buildpack-common.tar.gz | tar xz
. bin/java

if [ -f ${CACHE_DIR}/system.properties ] && [ ! -f ${BUILD_DIR}/system.properties ]; then
cp ${CACHE_DIR}/system.properties ${BUILD_DIR}/system.properties
fi

if [ ! -d $CACHE_DIR ]; then
LOGGER_FLAGS="$LOGGER_FLAGS new_java_app"
logger -p user.notice -t "slugc[$$]" "language_pack_java new_java_app"
if [ ! -f ${BUILD_DIR}/system.properties ]; then
echo "java.runtime.version=1.6" > ${BUILD_DIR}/system.properties;
fi
fi

#create the cache dir if it doesn't exist
mkdir -p $CACHE_DIR

# install JDK
if [ -f ${BUILD_DIR}/system.properties ]; then
logger -p user.notice -t "slugc[$$]" "language_pack_java download_jdk"
LOGGER_FLAGS="$LOGGER_FLAGS download_jdk"
javaVersion=$(detect_java_version ${BUILD_DIR})
echo -n "-----> Installing OpenJDK ${javaVersion}..."
install_java ${BUILD_DIR} ${javaVersion}
jdk_overlay ${BUILD_DIR}
echo "done"
cp ${BUILD_DIR}/system.properties ${CACHE_DIR}/
# create default system.properties
if [ ! -f ${BUILD_DIR}/system.properties ]; then
echo "java.runtime.version=1.6" > ${BUILD_DIR}/system.properties
fi

# install JDK
javaVersion=$(detect_java_version ${BUILD_DIR})
echo -n "-----> Installing OpenJDK ${javaVersion}..."
install_java ${BUILD_DIR} ${javaVersion}
jdk_overlay ${BUILD_DIR}
echo "done"

# home directory from perspective of SBT; we rename
# it because otherwise the project root and $HOME
# are the same, and by default .sbt has a (different)
Expand Down Expand Up @@ -135,6 +128,10 @@ if [ "${PIPESTATUS[*]}" != "0 0" ]; then
exit 1
fi

PROFILE_PATH="$BUILD_DIR/.profile.d/scala.sh"
mkdir -p $(dirname $PROFILE_PATH)
echo 'export PATH="/app/.jdk/bin:$PATH"' >> $PROFILE_PATH

# repack cache
mkdir -p $CACHE_DIR
for DIR in $CACHED_DIRS ; do
Expand Down

0 comments on commit e924076

Please sign in to comment.