cedaandroid


#!/bin/bash

# Package the ceda core libraries to allow ceda based C++ applications to be developed on
# an Android platform, without providing full access to the proprietary ceda source code
#

if [ "$#" -ne 2 ]; then
    echo "Usage: cedaandroid [Debug|Release] [version]"
    exit 1
fi

PLATFORM=Android
CONFIG=$1
VERSION=$2

# It is assumed the ceda source code repository has been downloaded under ~/developer/_root_
CEDA_SOURCE_ROOT=~/developer/_root_

# build artefats folder for building the ceda core libraries before they are packaged
BUILD_CEDA_CORE=~/developer/build_ceda_core_android

# The workspace used to build the ceda core libraries (not including examples and test projects)
WORKSPACE=wsCedaCoreWithTests

# Location for where to package up the ceda core libraries and header files
CEDA_PKG=~/developer/ceda

echo "========================================================================="
echo Packaging the ceda core libraries version $VERSION on $PLATFORM...

mkdir -p $BUILD_CEDA_CORE/build
cp $CEDA_SOURCE_ROOT/Ceda/_BUILD/Init/CedaWorkspaceXcpps/$WORKSPACE.xcpp $BUILD_CEDA_CORE/build
cp $CEDA_SOURCE_ROOT/Ceda/_BUILD/Init/CedaWorkspaceXcpps/build_local.xcpp $BUILD_CEDA_CORE/build
cp $CEDA_SOURCE_ROOT/Ceda/_BUILD/Init/$PLATFORM/XcppConfig/selectcompiler.xcpp $BUILD_CEDA_CORE/build
cd $BUILD_CEDA_CORE/build

echo "----------------- Generating $WORKSPACE.xcws make files --------------------"
~/bin/Xcpp $WORKSPACE.xcpp mode=gen

echo "----------------- making the ceda core libraries --------------------"

if [ "$CONFIG" == "Release" ]; then
  make rxcppclean
  make rtranslate
  #make r
else
  make dxcppclean
  make dtranslate
  #make d
fi

if [ $? -ne 0 ]; then
  echo "make failed, exiting" >&2
  exit 1
fi