# --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: package/*/apache-ant/apache-ant.conf # Copyright (C) 2004 - 2021 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- # Use jikes for faster compilation if it is available. if pkginstalled jikes; then export ANT_OPTS="-Dbuild.compiler=jikes -Djavac.source=1.3" fi # Check if a java development kit was installed. if [ -z $JAVA_HOME ]; then abort "JDK required for building $pkg" fi # We want Ant to be installed in its own directory. prefix=$prefix/apache-ant set_confopt export ANT_HOME=$root/$prefix export PATH=${PATH}:${ANT_HOME}/bin # extract junit source - needed since 1.7.0, so says the ant FAQ # NOTE: junit4 is incompatible, need to use junit3 here ant_junit_extract() { local junit=`match_source_file -p junit` mkdir -p lib/optional unzip -j $junit junit*.jar -d lib/optional } hook_add premake 5 ant_junit_extract # Custom package building and installation. ant_postmake() { # Todo check return value (building and installation success?). # The next command will start the build and when finished # it will automatically install the new build in ANT_HOME ./build.sh install if [ $? -ne 0 ]; then # Something went wrong. abort "Building $pkg failed." fi # Now the ant commands need to be made available. This can # be done is two ways. Add the bin directory to PATH or have # links to the ant commands somewhere in the existing PATH. # Here we choose the last option to prevent PATH becoming to # large. We will place the links in the default java/bin # directory. bin_path=$(pkgprefix bindir java-dirtree) for ant_command in $(find $ANT_HOME/bin -perm +o=x -type f); do # Create a link for the current ant command. ln -sf $ant_command $bin_path/$(basename $ant_command) done # Prepare necessary environment variables. cat <<-EOF > $root/etc/profile.d/ant ANT_HOME=/$prefix export ANT_HOME EOF } hook_add postmake 5 ant_postmake