homebrew-core/Formula/ant.rb

75 lines
2.4 KiB
Ruby
Raw Normal View History

2013-10-28 19:44:20 +00:00
class Ant < Formula
desc "Java build tool"
homepage "https://ant.apache.org/"
url "https://www.apache.org/dyn/closer.cgi?path=ant/binaries/apache-ant-1.9.8-bin.tar.bz2"
sha256 "6edeaab09fc0bb1eeeb6b6be9c0e463813b073c40189f760e70c85fa288d5125"
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
2017-01-01 12:00:40 +00:00
sha256 "8f4d965e345f128f5ed9871467f37ab46495bac7590c0d51827ed7398a61c42d" => :sierra
sha256 "66ecee3d85ab96e761df300f6b6128f7e3f806ab2f3674d880107be0b886e73a" => :el_capitan
sha256 "66ecee3d85ab96e761df300f6b6128f7e3f806ab2f3674d880107be0b886e73a" => :yosemite
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
option "with-ivy", "Install ivy dependency manager"
option "with-bcel", "Install Byte Code Engineering Library"
resource "ivy" do
url "https://www.apache.org/dyn/closer.cgi?path=ant/ivy/2.4.0/apache-ivy-2.4.0-bin.tar.gz"
sha256 "7a3d13a80b69d71608191463dfc2a74fff8ef638ce0208e70d54d28ba9785ee9"
end
resource "bcel" do
url "https://search.maven.org/remotecontent?filepath=org/apache/bcel/bcel/6.0/bcel-6.0.jar"
sha256 "7eb80fdb30034dda26ba109a1b76af8dae0782c8cd27db32f1775086482d5bd0"
end
2013-10-28 19:44:20 +00:00
def install
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
if build.with? "ivy"
resource("ivy").stage do
(libexec/"lib").install Dir["ivy-*.jar"]
end
end
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
(testpath/"build.xml").write <<-EOS.undent
<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
(testpath/"src/main/java/org/homebrew/AntTest.java").write <<-EOS.undent
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