aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/sbt.rb
blob: ea18fe1e88f34398de1ef8443c552b7981207e2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'formula'

# even though "file -b" reports this as a zip archive, it's just a binary
class SbtHttpDownloadStrategy <CurlDownloadStrategy
  def stage
    FileUtils.mv @dl, File.basename(@url)
  end
end

class Sbt <Formula
  JAR = 'sbt-launcher-0.5.5.jar'
  url "http://simple-build-tool.googlecode.com/files/#{JAR}"
  homepage 'http://code.google.com/p/simple-build-tool'
  md5 'e3593448b3be17ce1666c6241b8d2f90'

  def download_strategy
    SbtHttpDownloadStrategy
  end

  def install
    (bin+'sbt').write <<-EOS
#!/bin/sh

java -Xmx512M -jar #{prefix}/#{JAR} "$@"
EOS

    prefix.install Dir['*']
  end
end