#!/bin/bash
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Stop if something fails.
set -e

function fail() {
  echo "$*" >&2
  exit 1
}

if [[ $# -le 0 ]]; then
  echo 'Error:' '$0 should have the parameters from the "build" script forwarded to it' >&2
  fail 'Error: An example of how do it correctly is ./default-build "$@"'
  exit 1
fi

# Set default values for directories.
if [ -d smali ]; then
  HAS_SMALI=true
else
  HAS_SMALI=false
fi

# .j files in jasmin get compiled into classes.jar
if [ -d jasmin ]; then
  HAS_JASMIN=true
else
  HAS_JASMIN=false
fi

if [ -d src ]; then
  HAS_SRC=true
else
  HAS_SRC=false
fi

# .java files in src-art get compiled with libcore on the bootclasspath
if [ -d src-art ]; then
  HAS_SRC_ART=true
else
  HAS_SRC_ART=false
fi

if [ -d src2 ]; then
  HAS_SRC2=true
else
  HAS_SRC2=false
fi

if [ -d src-multidex ]; then
  HAS_SRC_MULTIDEX=true
else
  HAS_SRC_MULTIDEX=false
fi

if [ -d smali-multidex ]; then
  HAS_SMALI_MULTIDEX=true
else
  HAS_SMALI_MULTIDEX=false
fi

# .j files in jasmin-multidex get compiled into classes2.jar
if [ -d jasmin-multidex ]; then
  HAS_JASMIN_MULTIDEX=true
else
  HAS_JASMIN_MULTIDEX=false
fi

if [ -d smali-ex ]; then
  HAS_SMALI_EX=true
else
  HAS_SMALI_EX=false
fi

if [ -d src-ex ]; then
  HAS_SRC_EX=true
else
  HAS_SRC_EX=false
fi

if [ -d src-ex2 ]; then
  HAS_SRC_EX2=true
else
  HAS_SRC_EX2=false
fi

if [ -d src-dex2oat-unresolved ]; then
  HAS_SRC_DEX2OAT_UNRESOLVED=true
else
  HAS_SRC_DEX2OAT_UNRESOLVED=false
fi

if [ -f hiddenapi-flags.csv ]; then
  HAS_HIDDENAPI_SPEC=true
else
  HAS_HIDDENAPI_SPEC=false
fi

# USE_HIDDENAPI=false run-test... will disable hiddenapi.
if [ -z "${USE_HIDDENAPI}" ]; then
  USE_HIDDENAPI=true
fi

# DESUGAR=false run-test... will disable desugaring.
if [[ "$DESUGAR" == false ]]; then
  USE_DESUGAR=false
fi

# Allow overriding ZIP_COMPRESSION_METHOD with e.g. 'store'
ZIP_COMPRESSION_METHOD="deflate"
# Align every ZIP file made by calling $ZIPALIGN command?
WITH_ZIP_ALIGN=false
ZIP_ALIGN_BYTES="-1"

BUILD_MODE="target"
DEV_MODE="no"

DEFAULT_EXPERIMENT="no-experiment"

# The key for default arguments if no experimental things are enabled.
EXPERIMENTAL=$DEFAULT_EXPERIMENT

# Setup experimental API level mappings in a bash associative array.
declare -A EXPERIMENTAL_API_LEVEL
EXPERIMENTAL_API_LEVEL[${DEFAULT_EXPERIMENT}]="26"
EXPERIMENTAL_API_LEVEL["default-methods"]="24"
EXPERIMENTAL_API_LEVEL["parameter-annotations"]="25"
EXPERIMENTAL_API_LEVEL["agents"]="26"
EXPERIMENTAL_API_LEVEL["method-handles"]="26"
EXPERIMENTAL_API_LEVEL["var-handles"]="28"

while true; do
  if [ "x$1" = "x--no-src" ]; then
    HAS_SRC=false
    shift
  elif [ "x$1" = "x--no-src2" ]; then
    HAS_SRC2=false
    shift
  elif [ "x$1" = "x--no-src-multidex" ]; then
    HAS_SRC_MULTIDEX=false
    shift
  elif [ "x$1" = "x--no-smali-multidex" ]; then
    HAS_SMALI_MULTIDEX=false
    shift
  elif [ "x$1" = "x--no-src-ex" ]; then
    HAS_SRC_EX=false
    shift
  elif [ "x$1" = "x--no-src-ex2" ]; then
    HAS_SRC_EX2=false
    shift
  elif [ "x$1" = "x--no-smali" ]; then
    HAS_SMALI=false
    shift
  elif [ "x$1" = "x--no-jasmin" ]; then
    HAS_JASMIN=false
    shift
  elif [ "x$1" = "x--api-level" ]; then
    shift
    EXPERIMENTAL_API_LEVEL[${EXPERIMENTAL}]=$1
    shift
  elif [ "x$1" = "x--experimental" ]; then
    shift
    # We have a specific experimental configuration so don't use the default.
    EXPERIMENTAL="$1"
    shift
  elif [ "x$1" = "x--zip-compression-method" ]; then
    # Allow using different zip compression method, e.g. 'store'
    shift
    ZIP_COMPRESSION_METHOD="$1"
    shift
  elif [ "x$1" = "x--zip-align" ]; then
    # Align ZIP entries to some # of bytes.
    shift
    WITH_ZIP_ALIGN=true
    ZIP_ALIGN_BYTES="$1"
    shift
  elif [ "x$1" = "x--host" ]; then
    BUILD_MODE="host"
    shift
  elif [ "x$1" = "x--target" ]; then
    BUILD_MODE="target"
    shift
  elif [ "x$1" = "x--jvm" ]; then
    BUILD_MODE="jvm"
    shift
  elif [ "x$1" = "x--dev" ]; then
    DEV_MODE="yes"
    shift
  elif expr "x$1" : "x--" >/dev/null 2>&1; then
    fail "unknown $0 option: $1"
  else
    break
  fi
done

if [[ $BUILD_MODE == jvm ]]; then
  # Does not need desugaring on jvm because it supports the latest functionality.
  USE_DESUGAR=false
  # Do not attempt to build src-art directories on jvm, it would fail without libcore.
  HAS_SRC_ART=false
fi

# Set API level for smali and d8.
API_LEVEL="${EXPERIMENTAL_API_LEVEL[${EXPERIMENTAL}]}"

# Add API level arguments to smali and dx
SMALI_ARGS="${SMALI_ARGS} --api $API_LEVEL"
D8_FLAGS="${D8_FLAGS} --min-api $API_LEVEL"

#########################################

# Catch all commands to 'ZIP' and prepend extra flags.
# Optionally, zipalign results to some alignment.
function zip() {
  local zip_target="$1"
  local entry_src="$2"
  shift 2

  command zip --compression-method "$ZIP_COMPRESSION_METHOD" "$zip_target" "$entry_src" "$@"

  if "$WITH_ZIP_ALIGN"; then
    # zipalign does not operate in-place, so write results to a temp file.
    local tmp_file="$(mktemp)"
    "$ZIPALIGN" -f "$ZIP_ALIGN_BYTES" "$zip_target" "$tmp_file"
    # replace original zip target with our temp file.
    mv "$tmp_file" "$zip_target"
  fi
}

function make_jasmin() {
  local out_directory="$1"
  shift
  local jasmin_sources=("$@")

  mkdir -p "$out_directory"

  if [[ $DEV_MODE == yes ]]; then
    echo ${JASMIN} -d "$out_directory" "${jasmin_sources[@]}"
    ${JASMIN} -d "$out_directory" "${jasmin_sources[@]}"
  else
    ${JASMIN} -d "$out_directory" "${jasmin_sources[@]}" >/dev/null
  fi
}

# Like regular javac but may include libcore on the bootclasspath.
function javac_with_bootclasspath {
  local helper_args="--mode=$BUILD_MODE"

  if [[ $DEV_MODE == yes ]]; then
    helper_args="$helper_args --show-commands"
  fi

  # build with libcore for host and target, or openjdk for jvm
  "$ANDROID_BUILD_TOP/art/tools/javac-helper.sh" --core-only $helper_args ${JAVAC_ARGS} "$@"
}

# Make a "dex" file given a directory of classes in $1. This will be
# packaged in a jar file.
function make_dex() {
  local name="$1"
  local d8_inputs=$(find $name -name '*.class' -type f)
  local d8_output=${name}.jar
  local dex_output=${name}.dex
  local d8_local_flags=""
  if [[ "$USE_DESUGAR" = "true" ]]; then
    local boot_class_path_list=$($ANDROID_BUILD_TOP/art/tools/bootjars.sh --$BUILD_MODE --core --path)
    for boot_class_path_element in $boot_class_path_list; do
      d8_local_flags="$d8_local_flags --lib $boot_class_path_element"
    done
  else
    d8_local_flags="$d8_local_flags --no-desugaring"
  fi
  if [ "$DEV_MODE" = "yes" ]; then
    echo ${D8} ${D8_FLAGS} $d8_local_flags --output $d8_output $d8_inputs
  fi
  ${D8} ${D8_FLAGS} $d8_local_flags --output $d8_output $d8_inputs

  # D8 outputs to JAR files today rather than DEX files as DX used
  # to. To compensate, we extract the DEX from d8's output to meet the
  # expectations of make_dex callers.
  if [ "$DEV_MODE" = "yes" ]; then
    echo unzip -p $d8_output classes.dex \> $dex_output
  fi
  unzip -p $d8_output classes.dex > $dex_output
}

# Merge all the dex files in $1..$N into $1. Skip non-existing files, but at least 1 file must exist.
function make_dexmerge() {
  # Dex file that acts as the destination.
  local dst_file="$1"

  # Dex files that act as the source.
  local dex_files_to_merge=()

  # Skip any non-existing files.
  while [[ $# -gt 0 ]]; do
    if [[ -e "$1" ]]; then
      dex_files_to_merge+=("$1")
    fi
    shift
  done

  # Skip merge if we are not merging anything. IE: input = output.
  if [[ "${#dex_files_to_merge[@]}" -eq "1" ]]; then
    local single_input=${dex_files_to_merge[0]}
    if [[ "$dst_file" != "$single_input" ]]; then
     mv "$single_input" "$dst_file";
     return
    fi
  fi

  # We assume the dexer did all the API level checks and just merge away.
  mkdir d8_merge_out
  ${DEXMERGER} --min-api 1000 --output ./d8_merge_out "${dex_files_to_merge[@]}"

  if [[ -e "./d8_merge_out/classes2.dex" ]]; then
    fail "Cannot merge all dex files into a single dex"
  fi

  mv ./d8_merge_out/classes.dex "$dst_file";
  rmdir d8_merge_out
}

function make_hiddenapi() {
  local args=( "encode" )
  while [[ $# -gt 0 ]]; do
    args+=("--input-dex=$1")
    args+=("--output-dex=$1")
    shift
  done
  args+=("--api-flags=hiddenapi-flags.csv")
  args+=("--no-force-assign-all")
  ${HIDDENAPI} "${args[@]}"
}

# Print the directory name only if it exists.
function maybe_dir() {
  local dirname="$1"
  if [[ -d "$dirname" ]]; then
    echo "$dirname"
  fi
}

if [ -e classes.dex ]; then
  zip $TEST_NAME.jar classes.dex
  exit 0
fi

# Helper function for a common test. Evaluate with $(has_mutlidex).
function has_multidex() {
  echo [ ${HAS_SRC_MULTIDEX} = "true" \
         -o ${HAS_JASMIN_MULTIDEX} = "true" \
         -o ${HAS_SMALI_MULTIDEX} = "true" ]
}

if [ ${HAS_SRC_DEX2OAT_UNRESOLVED} = "true" ]; then
  mkdir -p classes
  mkdir classes-ex
  javac_with_bootclasspath -implicit:none -sourcepath src-dex2oat-unresolved -d classes `find src -name '*.java'`
  javac_with_bootclasspath -implicit:none -sourcepath src -d classes-ex `find src-dex2oat-unresolved -name '*.java'`
  if [ ${NEED_DEX} = "true" ]; then
    make_dex classes-ex
    mv classes-ex.dex classes.dex   # rename it so it shows up as "classes.dex" in the zip file.
    zip ${TEST_NAME}-ex.jar classes.dex
    make_dex classes
  fi
else
  if [ "${HAS_SRC}" = "true" -a "${HAS_SRC_MULTIDEX}" = "true" ]; then
    # To allow circular references, compile src/ and src-multidex/ together
    # and pass the output as class path argument. Replacement sources
    # in src-art/ can replace symbols used by src-multidex but everything
    # needed to compile src-multidex should be present in src/.
    mkdir classes-tmp-all
    javac_with_bootclasspath -implicit:none -d classes-tmp-all \
        `find src -name '*.java'` \
        `find src-multidex -name '*.java'`
    src_tmp_all="-cp classes-tmp-all"
  fi

  if [ "${HAS_SRC}" = "true" ]; then
    mkdir -p classes
    javac_with_bootclasspath -implicit:none $src_tmp_all -d classes `find src -name '*.java'`
  fi

  if [ "${HAS_SRC_ART}" = "true" ]; then
    mkdir -p classes
    javac_with_bootclasspath -implicit:none $src_tmp_all -d classes `find src-art -name '*.java'`
  fi

  if [ "${HAS_SRC_MULTIDEX}" = "true" ]; then
    mkdir classes2
    javac_with_bootclasspath -implicit:none $src_tmp_all -d classes2 `find src-multidex -name '*.java'`
    if [ ${NEED_DEX} = "true" ]; then
      make_dex classes2
    fi
  fi

  if [ "${HAS_SRC2}" = "true" ]; then
    mkdir -p classes
    javac_with_bootclasspath -classpath classes -d classes `find src2 -name '*.java'`
  fi

  # If the classes directory is not-empty, package classes in a DEX file. NB some
  # tests provide classes rather than java files.
  if [ "$(ls -A classes)" ]; then
    if [ ${NEED_DEX} = "true" ]; then
      make_dex classes
    fi
  fi
fi

if [[ "${HAS_JASMIN}" == true ]]; then
  # Compile Jasmin classes as if they were part of the classes.dex file.
  make_jasmin jasmin_classes $(find 'jasmin' -name '*.j')
  if [[ "${NEED_DEX}" == "true" ]]; then
    make_dex jasmin_classes
    make_dexmerge classes.dex jasmin_classes.dex
  else
    # Move jasmin classes into classes directory so that they are picked up with -cp classes.
    mkdir -p classes
    cp -r jasmin_classes/* classes/
  fi
fi

if [ "${HAS_SMALI}" = "true" -a ${NEED_DEX} = "true" ]; then
  # Compile Smali classes
  ${SMALI} -JXmx512m assemble ${SMALI_ARGS} --output smali_classes.dex `find smali -name '*.smali'`
  if [[ ! -s smali_classes.dex ]] ; then
    fail "${SMALI} produced no output."
  fi
  # Merge smali files into classes.dex, this takes priority over any jasmin files.
  make_dexmerge classes.dex smali_classes.dex
fi

# Compile Jasmin classes in jasmin-multidex as if they were part of the classes2.jar
if [[ "$HAS_JASMIN_MULTIDEX" == true ]]; then
  make_jasmin jasmin_classes2 $(find 'jasmin-multidex' -name '*.j')

  if [[ "${NEED_DEX}" == "true" ]]; then
    make_dex jasmin_classes2
    make_dexmerge classes2.dex jasmin_classes2.dex
  else
    # Move jasmin classes into classes2 directory so that they are picked up with -cp classes2.
    mkdir -p classes2
    mv jasmin_classes2/* classes2
  fi
fi

if [ "${HAS_SMALI_MULTIDEX}" = "true" -a ${NEED_DEX} = "true" ]; then
  # Compile Smali classes
  ${SMALI} -JXmx512m assemble ${SMALI_ARGS} --output smali_classes2.dex `find smali-multidex -name '*.smali'`

  # Merge smali_classes2.dex into classes2.dex
  make_dexmerge classes2.dex smali_classes2.dex
fi

if [ ${HAS_SRC_EX} = "true" -o ${HAS_SRC_EX2} = "true" ]; then
  # Build src-ex into classes-ex.
  # Includes 'src', 'src-art' and 'jasmin' source when compiling classes-ex,
  # but exclude their .class files.
  if [ "${HAS_SRC}" = "true" -o "${HAS_SRC_ART}" = "true" -o "${HAS_JASMIN}" = "true" ]; then
    mkdir -p classes-tmp-for-ex
    src_tmp_for_ex="-cp classes-tmp-for-ex"
  fi
  if [ "${HAS_SRC}" = "true" -a "${HAS_SRC_MULTIDEX}" = "true" ]; then
    javac_with_bootclasspath -d classes-tmp-for-ex \
        `find src -name '*.java'` \
        `find src-multidex -name '*.java'`
  elif [[ "${HAS_SRC}" == "true" ]]; then
    javac_with_bootclasspath -d classes-tmp-for-ex `find src -name '*.java'`
  elif [[ "${HAS_SRC_MULTIDEX}" == "true" ]]; then
    javac_with_bootclasspath -d classes-tmp-for-ex `find src-multidex -name '*.java'`
  fi
  if [[ "${HAS_SRC_ART}" == "true" ]]; then
    javac_with_bootclasspath -d classes-tmp-for-ex `find src-art -name '*.java'`
  fi
  if [[ "${HAS_JASMIN}" == "true" ]]; then
    make_jasmin classes-tmp-for-ex $(find 'jasmin' -name '*.j')
  fi
  mkdir -p classes-ex
  if [ ${HAS_SRC_EX} = "true" ]; then
    javac_with_bootclasspath -d classes-ex $src_tmp_for_ex `find src-ex -name '*.java'`
    if [[ "x$src_tmp_for_ex" = "x" ]]; then
      src_tmp_for_ex="-cp classes-ex"
    else
      src_tmp_for_ex="$src_tmp_for_ex:classes-ex"
    fi
  fi
  if [ ${HAS_SRC_EX2} = "true" ]; then
    javac_with_bootclasspath -d classes-ex $src_tmp_for_ex `find src-ex2 -name '*.java'`
  fi
fi

if [[ -d classes-ex ]] && [ ${NEED_DEX} = "true" ]; then
  make_dex classes-ex
fi

if [ "${HAS_SMALI_EX}" = "true" -a ${NEED_DEX} = "true" ]; then
  # Compile Smali classes
  ${SMALI} -JXmx512m assemble ${SMALI_ARGS} --output smali_classes-ex.dex `find smali-ex -name '*.smali'`
  if [[ ! -s smali_classes-ex.dex ]] ; then
    fail "${SMALI} produced no output."
  fi
  # Merge smali files into classes-ex.dex.
  make_dexmerge classes-ex.dex smali_classes-ex.dex
fi

if [[ -f classes-ex.dex ]]; then
  # Apply hiddenapi on the dex files if the test has API list file(s).
  if [ ${USE_HIDDENAPI} = "true" -a ${HAS_HIDDENAPI_SPEC} = "true" ]; then
    make_hiddenapi classes-ex.dex
  fi

  # quick shuffle so that the stored name is "classes.dex"
  mv classes.dex classes-1.dex
  mv classes-ex.dex classes.dex
  zip $TEST_NAME-ex.jar classes.dex
  mv classes.dex classes-ex.dex
  mv classes-1.dex classes.dex
fi

# Apply hiddenapi on the dex files if the test has API list file(s).
if [ ${NEED_DEX} = "true" -a ${USE_HIDDENAPI} = "true" -a ${HAS_HIDDENAPI_SPEC} = "true" ]; then
  if $(has_multidex); then
    make_hiddenapi classes.dex classes2.dex
  else
    make_hiddenapi classes.dex
  fi
fi

# Create a single dex jar with two dex files for multidex.
if [ ${NEED_DEX} = "true" ]; then
  if [ -f classes2.dex ] ; then
    zip $TEST_NAME.jar classes.dex classes2.dex
  else
    zip $TEST_NAME.jar classes.dex
  fi
fi
