Last active
September 30, 2018 10:11
-
-
Save technoir42/acd1cf96d7a59e562489b5611b2aa252 to your computer and use it in GitHub Desktop.
Homebrew formulas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Classyshark < Formula | |
desc "Executables browser for Android, Java and Kotlin" | |
homepage "https://github.com/google/android-classyshark" | |
url "https://github.com/google/android-classyshark/releases/download/8.1/ClassyShark.jar" | |
sha256 "73f0f8854a564d0eec4550fd69ebc239a38ae82f57e95cffb45890ba1b2e8098" | |
head do | |
url "https://github.com/google/android-classyshark.git" | |
depends_on "gradle" => :build | |
end | |
bottle :unneeded | |
depends_on :java => "1.7+" | |
def install | |
if build.head? | |
chdir "ClassySharkWS" do | |
system "gradle", "clean", "fatJar" | |
libexec.install "build/libs/ClassySharkWS-all-1.0-SNAPSHOT.jar" => "ClassyShark.jar" | |
bin.write_jar_script libexec/"ClassyShark.jar", "classyshark" | |
end | |
else | |
libexec.install "ClassyShark.jar" | |
bin.write_jar_script libexec/"ClassyShark.jar", "classyshark" | |
end | |
end | |
test do | |
(testpath/"Test.java").write <<~EOS | |
public class Test { | |
} | |
EOS | |
system "javac", "Test.java" | |
system "jar", "cvf", "Test.jar", "Test.class" | |
expect = <<~EOS | |
Test.jar - 1 | |
??Test - 1 | |
EOS | |
assert_equal expect, shell_output("#{bin}/classyshark -methodcounts Test.jar") | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Fernflower < Formula | |
homepage "https://github.com/fesh0r/fernflower" | |
head do | |
url "https://github.com/fesh0r/fernflower.git" | |
depends_on "gradle" => :build | |
end | |
depends_on :java => "1.7+" | |
def install | |
system "gradle", "build" | |
libexec.install Dir["build/libs/fernflower.jar"] | |
bin.write_jar_script libexec/"fernflower.jar", "fernflower" | |
end | |
test do | |
system "#{bin}/fernflower" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment