Skip to content

Instantly share code, notes, and snippets.

@iamdanfox
Last active November 16, 2018 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamdanfox/decf85e1332e8922b1fe7c1d5c3df5fd to your computer and use it in GitHub Desktop.
Save iamdanfox/decf85e1332e8922b1fe7c1d5c3df5fd to your computer and use it in GitHub Desktop.
Homebrew formula to install palantir/conjure 4.3.0
class Conjure < Formula
desc "Magically generate multi-language HTTP/JSON clients and servers"
homepage "https://github.com/palantir/conjure"
url "https://palantir.bintray.com/releases/com/palantir/conjure/conjure/4.3.0/conjure-4.3.0.tgz"
sha256 "f6bc13a4d7ac2b61cbd3b1d80880366ab2f8ebce149720493b37fe126f3a86a7"
head "https://github.com/palantir/conjure.git", :branch => "develop"
bottle :unneeded
depends_on :java => "1.8+"
def install
if build.head?
system "./gradlew", "distTar", "--stacktrace", "--console=plain", "-Dorg.gradle.internal.launcher.welcomeMessageEnabled=false"
system "tar", "-xvf", Dir.glob("conjure/build/distributions/*.tgz")[0], "--strip", "1"
end
libexec.install %w[bin lib]
(bin/"conjure").write_env_script libexec/"bin/conjure", Language::Java.overridable_java_home_env
end
test do
(testpath/"input.yml").write("types: { definitions: { default-package: test.api , objects: { Foo: { alias: string } } } }")
ohai "Compiling trivial Conjure Definition"
system "#{bin}/conjure", "compile", (testpath/"input.yml"), (testpath/"output.conjure.json")
output = File.read(testpath/"output.conjure.json")
assert_includes output, "\"Foo\""
assert_includes output, "\"test.api\""
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment