Files
robovm/compiler/vm/build.sh
Justin Shapcott 3d1e6eccf9 Initial commit. Here's what I did:
- Figured out which OSS RoboVM repositories are needed for libGDX
- Put them into a single repository, much easier to maintain, but
  history got destroyed in the process. Can look up history in
  original repository if necessary
- Set the groupId of all artifacts to my domain com.mobidevelop
  so I can publish to Maven Central
- Set the version to 2.0.0-SNAPSHOT so there's zero chance of
  a collision with the original RoboVM releases
- Couldn't get native bits to compile, so updated minimum iOS
  and Mac OS X versions for toolchain in vm/CMakeFileList.txt
  and OS.java until it worked.
- Apps wouldn't link due to some missing c++ symbols. Removed linking
  to libstdc++ in IOSTarget.java. Not sure if that has any detrimental
  effects but it fixed linking.
- When opening a run configuration via the IDEA plugin, it would
  crash in DeviceType.java:113. It seems that the output of some
  command line tool is being parsed, and that returns error
  messages together with the data we need. Fixed via ugly
  hack.
- Updated to the latest commit of https://github.com/robovm/bwdgc.git
  Probably fixed some GC crashes since the release in October.
- Pulled in the IDE plugins for Eclipse and IDEA, the Gradle plugin
  and the templates project. We don't need the Maven plugin and junit
  stuff for libGDX. Everything's in the plugin/ directory
- Templates: removed the templates that i couldn't get to work, namely
  the ones relying on storyboards. Seems like the OSS RoboVM couldn't
  deal with those at all.
- IDEA plugin: removed the bridge to the interface builder functionality
  otherwise the plugin would crash since we miss the artifacts for that
- IDEA plugin: removed the whole setup stuff for Android and license
  checks. The former didn't work for me at all, and the latter would crash
  because it's missing the actual code.
- IDEA plugin: removed the templates in RoboVMTemplateFactory that aren't
  working.
- IDEA plugin: The RoboVmCompileTask doesn't seem to work with that as it can't find
  the robovm.xml file needed for compilation. Fixed in RoboVmPlugin.java
  with a very ugly hack.
- IDEA plugin: there was a huge memory leak in the compiler code of the
  plugin. It retained the AppCompiler instance, which was huge. Fixed
  by nulling that out at the appropriate time
- IDEA plugin: fixed template_build.gradle to use the new groupId
- Gradle plugin: it seems the Gradle plugin was kept up-to-date with
  the latest closed source RoboVM. Had to remove a bunch of stuff, like
  TvOS functionality, as we don't have to sources for that.
- Eclipse plugin: just fixed up the poms, don't know if it works.
2016-04-20 13:15:45 -07:00

124 lines
3.1 KiB
Bash
Executable File

#!/bin/bash
SELF=$(basename $0)
BASE=$(cd $(dirname $0); pwd -P)
CLEAN=0
VERBOSE=
function usage {
cat <<EOF
Usage: $SELF [options]
Options:
--build=[release|debug] Specifies the build type. If not set both release
and debug versions of the libraries will be built.
--target=... Specifies the target(s) to build for. Supported
targets are macosx-x86_64, macosx-x86, ios-x86_64,
ios-x86, ios-thumbv7, ios-arm64, linux-x86_64,
linux-x86. Enclose multiple targets in quotes and
separate with spaces or specify --target multiple
times. If not set the current host OS determines the
targets. macosx-x86_64, macosx-x86, ios-x86_64,
ios-x86, ios-thumbv7 and ios-arm64 on MacOSX and
linux-x86_64 and linux-x86 on Linux.
--verbose Enable verbose output during the build.
--clean Cleans the build dir before starting the build.
--help Displays this information and exits.
EOF
exit $1
}
while [ "${1:0:2}" = '--' ]; do
NAME=${1%%=*}
VALUE=${1#*=}
case $NAME in
'--target') TARGETS="$TARGETS $VALUE" ;;
'--clean') CLEAN=1 ;;
'--verbose') VERBOSE=VERBOSE=1 ;;
'--build') BUILDS="$BUILDS $VALUE" ;;
'--help')
usage 0
;;
*)
echo "Unrecognized option or syntax error in option '$1'"
usage 1
;;
esac
shift
done
if [ "x$TARGETS" = 'x' ]; then
OS=$(uname)
case $OS in
Darwin)
TARGETS="macosx-x86_64 macosx-x86 ios-x86_64 ios-x86 ios-thumbv7 ios-arm64"
;;
Linux)
TARGETS="linux-x86_64 linux-x86"
;;
*)
echo "Unsupported OS: $OS"
exit 1
;;
esac
fi
if [ "x$BUILDS" = 'x' ]; then
BUILDS="debug release"
fi
# Validate targets
for T in $TARGETS; do
if ! [[ $T =~ (macosx-(x86_64|x86))|(ios-(x86_64|x86|thumbv7|arm64))|(linux-(x86_64|x86)) ]] ; then
echo "Unsupported target: $T"
exit 1
fi
done
# Validate build types
for B in $BUILDS; do
if ! [[ $B =~ (debug|release) ]] ; then
echo "Unsupported build type: $B"
exit 1
fi
done
mkdir -p "$BASE/target/build"
if [ "$CLEAN" = '1' ]; then
for T in $TARGETS; do
for B in $BUILDS; do
rm -rf "$BASE/target/build/$T-$B"
done
done
fi
if [ $(uname) = 'Darwin' ]; then
if xcrun -f clang &> /dev/null; then
CC=$(xcrun -f clang)
else
CC=$(which clang)
fi
if xcrun -f clang++ &> /dev/null; then
CXX=$(xcrun -f clang++)
else
CXX=$(which clang++)
fi
else
CC=$(which gcc)
CXX=$(which g++)
fi
for T in $TARGETS; do
OS=${T%%-*}
ARCH=${T#*-}
for B in $BUILDS; do
BUILD_TYPE=$B
mkdir -p "$BASE/target/build/$T-$B"
rm -rf "$BASE/binaries/$OS/$ARCH/$B"
bash -c "cd '$BASE/target/build/$T-$B'; cmake -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOS=$OS -DARCH=$ARCH '$BASE'; make $VERBOSE install"
R=$?
if [[ $R != 0 ]]; then
echo "$T-$B build failed"
exit $R
fi
done
done