You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

10 years ago
TERMUX_PKG_HOMEPAGE=http://www.eclipse.org/jdt/core/
TERMUX_PKG_DESCRIPTION="Eclipse Compiler for Java"
TERMUX_PKG_VERSION=4.4.2
TERMUX_PKG_SRCURL=http://ftp.acc.umu.se/mirror/eclipse.org/eclipse/downloads/drops4/R-${TERMUX_PKG_VERSION}-201502041700/ecj-${TERMUX_PKG_VERSION}.jar
TERMUX_PKG_PLATFORM_INDEPENDENT=true
termux_step_extract_package () {
mkdir $TERMUX_PKG_SRCDIR
}
termux_step_make () {
RAW_JAR=$TERMUX_PKG_CACHEDIR/ecj-${TERMUX_PKG_VERSION}.jar
if [ ! -f $RAW_JAR ]; then
curl -L $TERMUX_PKG_SRCURL > $RAW_JAR
fi
mkdir -p $TERMUX_PREFIX/share/{dex,java}
$ANDROID_HOME/build-tools/$TERMUX_ANDROID_BUILD_TOOLS_VERSION/dx \
--dex \
--output=$TERMUX_PREFIX/share/dex/ecj.jar \
$RAW_JAR
cd $TERMUX_PKG_TMPDIR
rm -rf android-jar
mkdir android-jar
cd android-jar
# We need the android classes for JDT to compile against.
cp $ANDROID_HOME/platforms/android-21/android.jar .
unzip android.jar
rm -Rf android.jar resources.arsc res assets
zip -r android.jar .
cp $TERMUX_PKG_TMPDIR/android-jar/android.jar $TERMUX_PREFIX/share/java/android.jar
rm -Rf $TERMUX_PREFIX/bin/javac
install $TERMUX_PKG_BUILDER_DIR/ecj $TERMUX_PREFIX/bin/ecj
perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/ecj
}