Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
ant: a more stringent test that compiles code
Browse files Browse the repository at this point in the history
Closes #25977.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
  • Loading branch information
tedpennings authored and MikeMcQuaid committed Jan 17, 2014
1 parent 2855ed1 commit 79b2536
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Library/Formula/ant.rb
Expand Up @@ -14,6 +14,26 @@ def install
end

test do
system "#{bin}/ant", "-version"
(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"
end
end

0 comments on commit 79b2536

Please sign in to comment.