2013-10-28 19:44:20 +00:00
|
|
|
class Ant < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Java build tool"
|
2015-05-05 23:20:44 +00:00
|
|
|
homepage "https://ant.apache.org/"
|
2016-04-13 11:32:18 +00:00
|
|
|
url "https://www.apache.org/dyn/closer.cgi?path=ant/binaries/apache-ant-1.9.7-bin.tar.bz2"
|
|
|
|
sha256 "be2ff3026cc655dc002bbcce100bd6724d448c63f702aa82b6d9899b22db7808"
|
2015-01-03 11:58:46 +00:00
|
|
|
head "https://git-wip-us.apache.org/repos/asf/ant.git"
|
2013-10-28 19:44:20 +00:00
|
|
|
|
2015-07-17 07:30:02 +00:00
|
|
|
bottle do
|
2015-09-13 10:03:54 +00:00
|
|
|
cellar :any_skip_relocation
|
2016-09-11 02:36:26 +00:00
|
|
|
sha256 "db8eac6041dae8543e34aa367cbff6da3f0556a77202a44d90a527fcbcc68ac4" => :sierra
|
2016-04-13 11:49:39 +00:00
|
|
|
sha256 "5d6d2bf3ea95ef2191ff303e4d130cc5127e6842a3edda6a838c1cf58ddfdbbf" => :el_capitan
|
|
|
|
sha256 "aa07fd6364c81b62289816e14ec4543c3414c2dc0824d7f732f41e9240fa2137" => :yosemite
|
|
|
|
sha256 "493ef77af3a5130f705d7040cc1e4abf40ca7661d0a699c7087ff0e1cc49edca" => :mavericks
|
2015-07-17 07:30:02 +00:00
|
|
|
end
|
|
|
|
|
2013-10-28 19:44:20 +00:00
|
|
|
keg_only :provided_by_osx if MacOS.version < :mavericks
|
|
|
|
|
2014-05-25 19:40:09 +00:00
|
|
|
option "with-ivy", "Install ivy dependency manager"
|
2014-09-19 15:51:57 +00:00
|
|
|
option "with-bcel", "Install Byte Code Engineering Library"
|
2014-05-25 19:40:09 +00:00
|
|
|
|
|
|
|
resource "ivy" do
|
2015-05-05 23:20:44 +00:00
|
|
|
url "https://www.apache.org/dyn/closer.cgi?path=ant/ivy/2.4.0/apache-ivy-2.4.0-bin.tar.gz"
|
|
|
|
sha256 "7a3d13a80b69d71608191463dfc2a74fff8ef638ce0208e70d54d28ba9785ee9"
|
2014-05-25 19:40:09 +00:00
|
|
|
end
|
|
|
|
|
2014-09-19 15:51:57 +00:00
|
|
|
resource "bcel" do
|
2015-11-11 22:00:10 +00:00
|
|
|
url "https://search.maven.org/remotecontent?filepath=org/apache/bcel/bcel/5.2/bcel-5.2.jar"
|
2015-05-05 23:20:44 +00:00
|
|
|
sha256 "7b87e2fd9ac3205a6e5ba9ef5e58a8f0ab8d1a0e0d00cb2a761951fa298cc733"
|
2014-09-19 15:51:57 +00:00
|
|
|
end
|
|
|
|
|
2013-10-28 19:44:20 +00:00
|
|
|
def install
|
2015-01-03 11:58:46 +00:00
|
|
|
rm Dir["bin/*.{bat,cmd,dll,exe}"]
|
|
|
|
libexec.install Dir["*"]
|
2013-10-28 19:44:20 +00:00
|
|
|
bin.install_symlink Dir["#{libexec}/bin/*"]
|
2015-07-09 10:20:16 +00:00
|
|
|
rm bin/"ant"
|
|
|
|
(bin/"ant").write <<-EOS.undent
|
|
|
|
#!/bin/sh
|
|
|
|
#{libexec}/bin/ant -lib #{HOMEBREW_PREFIX}/share/ant "$@"
|
|
|
|
EOS
|
2014-05-25 19:40:09 +00:00
|
|
|
if build.with? "ivy"
|
|
|
|
resource("ivy").stage do
|
|
|
|
(libexec/"lib").install Dir["ivy-*.jar"]
|
|
|
|
end
|
|
|
|
end
|
2014-09-19 15:51:57 +00:00
|
|
|
if build.with? "bcel"
|
|
|
|
resource("bcel").stage do
|
|
|
|
(libexec/"lib").install Dir["bcel-*.jar"]
|
|
|
|
end
|
|
|
|
end
|
2013-10-28 19:44:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2015-01-03 11:58:46 +00:00
|
|
|
(testpath/"build.xml").write <<-EOS.undent
|
2014-01-17 04:29:18 +00:00
|
|
|
<project name="HomebrewTest" basedir=".">
|
|
|
|
<property name="src" location="src"/>
|
|
|
|
<property name="build" location="build"/>
|
|
|
|
<target name="init">
|
|
|
|
<mkdir dir="${build}"/>
|
|
|
|
</target>
|
|
|
|
<target name="compile" depends="init">
|
|
|
|
<javac srcdir="${src}" destdir="${build}"/>
|
|
|
|
</target>
|
|
|
|
</project>
|
|
|
|
EOS
|
2015-01-03 11:58:46 +00:00
|
|
|
(testpath/"src/main/java/org/homebrew/AntTest.java").write <<-EOS.undent
|
2014-01-17 04:29:18 +00:00
|
|
|
package org.homebrew;
|
|
|
|
public class AntTest {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
System.out.println("Testing Ant with Homebrew!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system "#{bin}/ant", "compile"
|
2013-10-28 19:44:20 +00:00
|
|
|
end
|
|
|
|
end
|