Skip to content
This repository
Browse code

Add support for packager to build one-click installers

  • Loading branch information...
commit b90f9c5be003ffad3109ec9177d5c1d8d6910403 1 parent 95844e1
Chris Eppstein authored March 14, 2012
1  .gitignore
@@ -29,3 +29,4 @@ devbin
29 29
 vendor/ruby
30 30
 vendor
31 31
 Gemfile.lock
  32
+Compass.pkg
3  Gemfile
@@ -2,6 +2,7 @@ source :rubygems
2 2
 
3 3
 gemspec
4 4
 
  5
+unless ENV['PKG']
5 6
 gem "cucumber", "~> 1.1.4"
6 7
 gem "rspec", "~>2.0.0"
7 8
 gem "rails", "~> 3.1"
@@ -25,4 +26,6 @@ unless ENV["CI"]
25 26
   gem 'guard'
26 27
   gem 'guard-test'
27 28
   gem 'guard-cucumber'
  29
+  gem 'packager'
  30
+end
28 31
 end
37  Rakefile
... ...
@@ -1,7 +1,16 @@
1 1
 require 'rubygems'
2  
-require 'bundler'
3  
-Bundler.setup
4  
-require 'rake/dsl_definition' rescue nil
  2
+if ENV["PKG"]
  3
+  $: << File.expand_path(File.dirname(__FILE__))+"/lib"
  4
+else
  5
+  require 'bundler'
  6
+  Bundler.setup 
  7
+end
  8
+
  9
+begin
  10
+  require 'rake/dsl_definition'
  11
+rescue LoadError
  12
+  #pass
  13
+end
5 14
 require 'compass'
6 15
 
7 16
 # ----- Default: Testing ------
@@ -10,12 +19,17 @@ task :default => [:test, :features]
10 19
 
11 20
 require 'rake/testtask'
12 21
 require 'fileutils'
  22
+
  23
+begin
13 24
 require 'cucumber'
14 25
 require 'cucumber/rake/task'
15 26
 
16 27
 Cucumber::Rake::Task.new(:features) do |t|
17 28
   t.cucumber_opts = "features --format progress"
18 29
 end
  30
+rescue LoadError
  31
+  $stderr.puts "cannot load cucumber"
  32
+end
19 33
 
20 34
 Rake::TestTask.new :test do |t|
21 35
   t.libs << 'lib'
@@ -124,3 +138,20 @@ rescue LoadError => e
124 138
   puts "WARNING: #{e}"
125 139
 end
126 140
 
  141
+begin
  142
+  require 'packager/rake_task'
  143
+  require 'compass/version'
  144
+  # Building a package:
  145
+  # 1. Get packager installed and make sure your system is setup correctly according to their docs.
  146
+  # 2. Make sure you are actually using a universal binary that has been nametooled.
  147
+  # 3. PKG=1 OFFICIAL=1 rake packager:pkg
  148
+  Packager::RakeTask.new(:pkg) do |t|
  149
+    t.package_name = "Compass"
  150
+    t.version = Compass::VERSION
  151
+    t.domain = "compass-style.org"
  152
+    t.bin_files = ["compass"]
  153
+    t.resource_files = FileList["frameworks/**/*"] + ["VERSION.yml", "LICENSE.markdown"]
  154
+  end
  155
+rescue LoadError => e
  156
+  puts "WARNING: #{e}"
  157
+end

0 notes on commit b90f9c5

Please sign in to comment.
Something went wrong with that request. Please try again.