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