Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Commit

Permalink
put stable version directly in bin/cake
Browse files Browse the repository at this point in the history
  • Loading branch information
ninjudd committed Jun 28, 2011
1 parent f78f395 commit 3ca8604
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 23 deletions.
33 changes: 12 additions & 21 deletions bin/cake
Expand Up @@ -8,6 +8,7 @@ require 'io/wait'
require 'pp'

CLOJURE = "1.2.0"
STABLE = "0.6.3"

if RUBY_PLATFORM =~ /(mingw|mswin)(32|64)$/
begin
Expand Down Expand Up @@ -267,15 +268,6 @@ def get(repo, source_jar, dest_jar = source_jar)
download("#{repo}/#{source_jar}", "#{$m2}/#{dest_jar}")
end

def stable_version
if File.exists?($version_file)
IO.read($version_file)
else
version = open("#{$releases}/stable").gets.chomp
File.open(version_file, "w") {|f| f.write(version)}
end
end

def newer?(file1, file2)
return false unless File.exists?(file1)
not File.exists?(file2) or test(?>, file1, file2)
Expand Down Expand Up @@ -564,17 +556,16 @@ end
#==================================

parse_opts!
$script = File.expand_path($opts[:run].first) if $opts[:run]
$pwd = Dir.getwd
$project = project_dir($pwd)
$file = File.expand_path(__FILE__)
$cakedir = File.dirname(File.dirname(File.expand_path(readlink($file), File.dirname($file))))
$releases = "http://releases.clojure-cake.org"
$m2 = "#{$home}/.m2/repository"
$version_file = "#{$home}/.cake/stable_version"
$config = Configuration.new("#{$home}/.cake/config", "cake.config", ".cake/config")
$vars = {:env => ENV.to_hash, :pwd => $pwd, :args => ARGV, :opts => $opts, :script => $0}.to_clj
$timeout = ($config['connect.timeout'] || 20).to_i
$script = File.expand_path($opts[:run].first) if $opts[:run]
$pwd = Dir.getwd
$project = project_dir($pwd)
$file = File.expand_path(__FILE__)
$cakedir = File.dirname(File.dirname(File.expand_path(readlink($file), File.dirname($file))))
$releases = "http://releases.clojure-cake.org"
$m2 = "#{$home}/.m2/repository"
$config = Configuration.new("#{$home}/.cake/config", "cake.config", ".cake/config")
$vars = {:env => ENV.to_hash, :pwd => $pwd, :args => ARGV, :opts => $opts, :script => $0}.to_clj
$timeout = ($config['connect.timeout'] || 20).to_i

initialize_cake_dirs
Dir.chdir($project)
Expand Down Expand Up @@ -602,7 +593,7 @@ else
log(:cake, "running from ~/.m2") if verbose?
download("#{$releases}/cake", __FILE__) if $command == :upgrade

$version = stable_version
$version = STABLE
clojure = get("http://build.clojure.org/releases", "org/clojure/clojure/#{CLOJURE}/clojure-#{CLOJURE}.jar")
cakejar = get($releases, "jars/cake-#{$version}.jar", "cake/cake/#{$version}/cake-#{$version}.jar")
bakejar = get($releases, "jars/bake-#{$version}.jar", "bake/bake/#{$version}/bake-#{$version}.jar")
Expand Down
3 changes: 1 addition & 2 deletions tasks.clj
Expand Up @@ -37,8 +37,7 @@
(ant Copy {:file (jarfile) :todir (file "releases" "jars")})
(ant Copy {:file (bakejar) :todir (file "releases" "jars")})
(ant Copy {:file (file "bin" "cake") :tofile (file "releases" "cake")})
(spit (file "releases/stable") (:version *project*))
(with-root (file "releases")
(git "add" "jars" "cake" "stable")
(git "add" "jars" "cake")
(git "commit" "--allow-empty" "-m" (format "'release cake %s'" (:version *project*)))
(git "push"))))

0 comments on commit 3ca8604

Please sign in to comment.