074b3e648a
Closes #7583. Signed-off-by: ilovezfs <ilovezfs@icloud.com>
36 lines
1 KiB
Ruby
36 lines
1 KiB
Ruby
class Jsonschema2pojo < Formula
|
|
desc "Generates Java types from JSON Schema (or example JSON)"
|
|
homepage "http://www.jsonschema2pojo.org/"
|
|
url "https://github.com/joelittlejohn/jsonschema2pojo/releases/download/jsonschema2pojo-0.4.28/jsonschema2pojo-0.4.28.tar.gz"
|
|
sha256 "1bf2dc584d4005d13481336ac0676d9f9c4b7cb319fc282b2e5ab92b7d368018"
|
|
|
|
bottle :unneeded
|
|
|
|
depends_on :java => "1.6+"
|
|
|
|
def install
|
|
libexec.install "jsonschema2pojo-#{version}-javadoc.jar", "lib"
|
|
bin.write_jar_script libexec/"lib/jsonschema2pojo-cli-#{version}.jar", "jsonschema2pojo"
|
|
end
|
|
|
|
test do
|
|
(testpath/"src/jsonschema.json").write <<-EOS.undent
|
|
{
|
|
"type":"object",
|
|
"properties": {
|
|
"foo": {
|
|
"type": "string"
|
|
},
|
|
"bar": {
|
|
"type": "integer"
|
|
},
|
|
"baz": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
}
|
|
EOS
|
|
system bin/"jsonschema2pojo", "-s", "src", "-t", testpath
|
|
assert File.exist?("Jsonschema.java"), "Failed to generate Jsonschema.java"
|
|
end
|
|
end
|