2013-10-28 19:44:20 +00:00
|
|
|
class Ant < Formula
|
2015-01-03 11:58:46 +00:00
|
|
|
homepage "http://ant.apache.org/"
|
|
|
|
url "http://www.apache.org/dyn/closer.cgi?path=ant/binaries/apache-ant-1.9.4-bin.tar.gz"
|
|
|
|
sha1 "6c41481e8201f6b3f7e216146b95bb6de70208bb"
|
|
|
|
head "https://git-wip-us.apache.org/repos/asf/ant.git"
|
2013-10-28 19:44:20 +00:00
|
|
|
|
2014-05-06 10:29:53 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha1 "56eee6f32ab55854b1ccbaa3e106129517e94f7f" => :mavericks
|
|
|
|
sha1 "f09cd5546459a6172a60ed010444dde9cc94bac1" => :mountain_lion
|
|
|
|
sha1 "5e90ad64f1bd68024f4fec659a6734629f349ea1" => :lion
|
|
|
|
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-01-26 11:06:45 +00:00
|
|
|
url "http://www.apache.org/dyn/closer.cgi?path=ant/ivy/2.4.0/apache-ivy-2.4.0-bin.tar.gz"
|
|
|
|
sha1 "97a206e3b6ec2ce9793d2ee151fa997a12647c7f"
|
2014-05-25 19:40:09 +00:00
|
|
|
end
|
|
|
|
|
2014-09-19 15:51:57 +00:00
|
|
|
resource "bcel" do
|
|
|
|
url "http://central.maven.org/maven2/org/apache/bcel/bcel/5.2/bcel-5.2.jar"
|
|
|
|
sha1 "96b2cefeb067c08c31225d48e2a689f814baae25"
|
|
|
|
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/*"]
|
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
|