buildr 1.4.7-x86-mswin32 → 1.4.8-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/CHANGELOG +41 -0
  2. data/Rakefile +0 -6
  3. data/addon/buildr/bnd.rb +13 -3
  4. data/addon/buildr/checkstyle.rb +1 -1
  5. data/addon/buildr/git_auto_version.rb +33 -0
  6. data/addon/buildr/{gwt.rake → gwt.rb} +0 -0
  7. data/addon/buildr/jacoco.rb +194 -0
  8. data/buildr.buildfile +1 -1
  9. data/buildr.gemspec +23 -16
  10. data/doc/_layouts/default.html +0 -2
  11. data/doc/contributing.textile +47 -0
  12. data/doc/download.textile +24 -0
  13. data/doc/index.textile +43 -23
  14. data/doc/languages.textile +65 -6
  15. data/doc/more_stuff.textile +12 -0
  16. data/doc/packaging.textile +2 -0
  17. data/doc/settings_profiles.textile +1 -1
  18. data/lib/buildr.rb +0 -4
  19. data/lib/buildr/core/application.rb +41 -8
  20. data/lib/buildr/core/build.rb +102 -1
  21. data/lib/buildr/core/cc.rb +14 -8
  22. data/lib/buildr/core/generate.rb +148 -7
  23. data/lib/buildr/core/util.rb +3 -3
  24. data/lib/buildr/ide/eclipse.rb +114 -0
  25. data/lib/buildr/ide/idea.rb +95 -1
  26. data/lib/buildr/java/commands.rb +1 -1
  27. data/lib/buildr/java/rjb.rb +5 -4
  28. data/lib/buildr/packaging/artifact.rb +1 -1
  29. data/lib/buildr/packaging/ziptask.rb +2 -2
  30. data/lib/buildr/scala.rb +1 -1
  31. data/lib/buildr/scala/bdd.rb +9 -2
  32. data/lib/buildr/scala/compiler.rb +94 -4
  33. data/lib/buildr/scala/doc.rb +17 -5
  34. data/lib/buildr/scala/tests.rb +15 -4
  35. data/lib/buildr/version.rb +1 -1
  36. data/rakelib/all-in-one.rake +50 -47
  37. data/rakelib/checks.rake +4 -4
  38. data/rakelib/doc.rake +85 -88
  39. data/rakelib/metrics.rake +9 -9
  40. data/rakelib/package.rake +13 -34
  41. data/rakelib/release.rake +11 -12
  42. data/rakelib/rspec.rake +71 -76
  43. data/rakelib/stage.rake +25 -51
  44. data/spec/addon/bnd_spec.rb +61 -7
  45. data/spec/core/build_spec.rb +117 -0
  46. data/spec/core/cc_spec.rb +36 -22
  47. data/spec/core/common_spec.rb +3 -2
  48. data/spec/core/compile_spec.rb +3 -3
  49. data/spec/core/generate_from_eclipse_spec.rb +280 -0
  50. data/spec/java/bdd_spec.rb +2 -2
  51. data/spec/java/packaging_spec.rb +2 -1
  52. data/spec/packaging/archive_spec.rb +25 -2
  53. data/spec/packaging/artifact_spec.rb +2 -2
  54. data/spec/sandbox.rb +3 -2
  55. data/spec/scala/compiler_spec.rb +41 -0
  56. data/spec/scala/doc_spec.rb +22 -3
  57. data/spec/scala/scala.rb +2 -2
  58. data/spec/scala/tests_spec.rb +2 -2
  59. metadata +223 -194
  60. data/addon/buildr/jdepend.rb.orig +0 -178
  61. data/doc/installing.textile.orig +0 -282
  62. data/doc/more_stuff.textile.orig +0 -1004
  63. data/lib/buildr/ide/eclipse/java.rb +0 -49
  64. data/lib/buildr/ide/eclipse/plugin.rb +0 -67
  65. data/lib/buildr/ide/eclipse/scala.rb +0 -64
@@ -62,7 +62,7 @@ module Java
62
62
  # If our cmd line is longer, we create a batch file and execute it instead.
63
63
  if Util.win_os? && cmd_args.map(&:inspect).join(' ').size > 2048
64
64
  # remove '-classpath' and the classpath itself from the cmd line.
65
- cp_i = cmd_args.index{|x| x.starts_with('-classpath')}
65
+ cp_i = cmd_args.index{|x| x.to_s =~ /^-classpath/}
66
66
  2.times do
67
67
  cmd_args.delete_at cp_i unless cp_i.nil?
68
68
  end
@@ -13,6 +13,11 @@
13
13
  # License for the specific language governing permissions and limitations under
14
14
  # the License.
15
15
 
16
+ if RbConfig::CONFIG['host_os'] =~ /darwin/i
17
+ # On OS X we attempt to guess where JAVA_HOME is, if not set
18
+ # We set JAVA_HOME early so we can use it without calling Java.load first.
19
+ ENV['JAVA_HOME'] ||= '/System/Library/Frameworks/JavaVM.framework/Home'
20
+ end
16
21
 
17
22
  require 'rjb'
18
23
 
@@ -72,10 +77,6 @@ module Java
72
77
 
73
78
  end
74
79
 
75
- # On OS X we know where the default JDK is. We can try to guess for other OS.
76
- # We set JAVA_HOME early so we can use it without calling Java.load first.
77
- ENV['JAVA_HOME'] ||= '/System/Library/Frameworks/JavaVM.framework/Home' if RbConfig::CONFIG['host_os'] =~ /darwin/i
78
-
79
80
  class << self
80
81
 
81
82
  # Returns the classpath, an array listing directories, JAR files and
@@ -814,7 +814,7 @@ module Buildr
814
814
  def transitive(*args)
815
815
  options = Hash === args.last ? args.pop : {}
816
816
  dep_opts = {
817
- :scopes => options[:scopes] || [nil, "compile", "runtime", "provided"],
817
+ :scopes => options[:scopes] || [nil, "compile", "runtime"],
818
818
  :optional => options[:optional]
819
819
  }
820
820
  specs = args.flatten
@@ -157,8 +157,8 @@ module Buildr
157
157
  dest = File.expand_path(dest, target.to_s)
158
158
  trace "Extracting #{dest}"
159
159
  mkpath File.dirname(dest) rescue nil
160
- #entry.restore_permissions = true
161
- File.open(dest, 'wb') {|f| f.write entry.read}
160
+ File.open(dest, 'wb', entry.mode) {|f| f.write entry.read}
161
+ File.chmod(entry.mode, dest)
162
162
  end
163
163
  end
164
164
  end
data/lib/buildr/scala.rb CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
 
17
17
  ENV['SCALA_HOME'] ||= '/opt/local/share/scala/' if File.exist?('/opt/local/share/scala/lib/scala-compiler.jar')
18
- Buildr.repositories.remote << 'http://scala-tools.org/repo-releases'
18
+ Buildr.repositories.remote << 'http://oss.sonatype.org/content/repositories/releases'
19
19
 
20
20
  require 'buildr/scala/compiler'
21
21
  require 'buildr/scala/tests'
@@ -134,8 +134,10 @@ module Buildr::Scala
134
134
  VERSION = case
135
135
  when Buildr::Scala.version?("2.8.0"), Buildr::Scala.version?("2.8.1"), Buildr::Scala.version?("2.8.2")
136
136
  '1.5'
137
+ when Buildr::Scala.version?("2.9")
138
+ '1.11'
137
139
  else
138
- '1.6.1'
140
+ fail "No default specs2 version for Scala #{Scala.version_without_build}"
139
141
  end
140
142
 
141
143
  class << self
@@ -150,7 +152,12 @@ module Buildr::Scala
150
152
  end
151
153
 
152
154
  def artifact
153
- Buildr.settings.build['scala.specs2.artifact'] || "specs2_#{Buildr::Scala.version_without_build}"
155
+ case
156
+ when Buildr.settings.build['scala.specs2.artifact']
157
+ Buildr.settings.build['scala.specs2.artifact']
158
+ else
159
+ "specs2_#{Buildr::Scala.version_without_build}"
160
+ end
154
161
  end
155
162
 
156
163
  def scalaz_dependencies
@@ -14,7 +14,7 @@
14
14
  # the License.
15
15
 
16
16
  module Buildr::Scala
17
- DEFAULT_VERSION = '2.9.1'
17
+ DEFAULT_VERSION = '2.9.2'
18
18
 
19
19
  class << self
20
20
 
@@ -80,6 +80,10 @@ module Buildr::Scala
80
80
  # * :other -- Array of options to pass to the Scalac compiler as is, e.g. -Xprint-types
81
81
  class Scalac < Buildr::Compiler::Base
82
82
 
83
+ DEFAULT_ZINC_VERSION = '0.1.0'
84
+ DEFAULT_SBT_VERSION = '0.12.0'
85
+ DEFAULT_JLINE_VERSION = '1.0'
86
+
83
87
  # The scalac compiler jars are added to classpath at load time,
84
88
  # if you want to customize artifact versions, you must set them on the
85
89
  #
@@ -93,6 +97,17 @@ module Buildr::Scala
93
97
  ns.compiler! 'org.scala-lang:scala-compiler:jar:>=' + version
94
98
  end
95
99
 
100
+ ZINC_REQUIRES = ArtifactNamespace.for(self) do |ns|
101
+ zinc_version = Buildr.settings.build['zinc.version'] || DEFAULT_ZINC_VERSION
102
+ sbt_version = Buildr.settings.build['sbt.version'] || DEFAULT_SBT_VERSION
103
+ jline_version = Buildr.settings.build['jline.version'] || DEFAULT_JLINE_VERSION
104
+ ns.zinc! "com.typesafe.zinc:zinc:jar:>=#{zinc_version}"
105
+ ns.sbt_interface! "com.typesafe.sbt:sbt-interface:jar:>=#{sbt_version}"
106
+ ns.incremental! "com.typesafe.sbt:incremental-compiler:jar:>=#{sbt_version}"
107
+ ns.compiler_interface_sources! "com.typesafe.sbt:compiler-interface:jar:sources:>=#{sbt_version}"
108
+ ns.jline! "jline:jline:jar:>=#{jline_version}"
109
+ end
110
+
96
111
  class << self
97
112
  def scala_home
98
113
  env_home = ENV['SCALA_HOME']
@@ -117,11 +132,15 @@ module Buildr::Scala
117
132
  end
118
133
 
119
134
  def dependencies
120
- if use_installed?
135
+ scala_dependencies = if use_installed?
121
136
  ['scala-library', 'scala-compiler'].map { |s| File.expand_path("lib/#{s}.jar", scala_home) }
122
137
  else
123
138
  REQUIRES.artifacts.map(&:to_s)
124
139
  end
140
+
141
+ zinc_dependencies = ZINC_REQUIRES.artifacts.map(&:to_s)
142
+
143
+ scala_dependencies + zinc_dependencies
125
144
  end
126
145
 
127
146
  def use_fsc
@@ -155,11 +174,18 @@ module Buildr::Scala
155
174
  options[:optimise] ||= false
156
175
  options[:make] ||= :transitivenocp if Scala.version? 2.8
157
176
  options[:javac] ||= {}
158
-
159
177
  @java = Javac.new(project, options[:javac])
160
178
  end
161
179
 
162
180
  def compile(sources, target, dependencies) #:nodoc:
181
+ if zinc?
182
+ compile_with_zinc(sources, target, dependencies)
183
+ else
184
+ compile_with_scalac(sources, target, dependencies)
185
+ end
186
+ end
187
+
188
+ def compile_with_scalac(sources, target, dependencies) #:nodoc:
163
189
  check_options(options, OPTIONS + (Scala.version?(2.8) ? [:make] : []))
164
190
 
165
191
  java_sources = java_sources(sources)
@@ -211,6 +237,40 @@ module Buildr::Scala
211
237
  end
212
238
  end
213
239
 
240
+ def compile_with_zinc(sources, target, dependencies) #:nodoc:
241
+
242
+ java_sources = java_sources(sources)
243
+
244
+ dependencies.unshift target
245
+
246
+ cmd_args = []
247
+ cmd_args << '-sbt-interface' << REQUIRES.sbt_interface.artifact
248
+ cmd_args << '-compiler-interface' << REQUIRES.compiler_interface_sources.artifact
249
+ cmd_args << '-scala-library' << dependencies.find { |d| d =~ /scala-library/ }
250
+ cmd_args << '-scala-compiler' << dependencies.find { |d| d =~ /scala-compiler/ }
251
+ cmd_args << '-classpath' << dependencies.join(File::PATH_SEPARATOR)
252
+ source_paths = sources.select { |source| File.directory?(source) }
253
+ cmd_args << '-Ssourcepath' << ("-S" + source_paths.join(File::PATH_SEPARATOR)) unless source_paths.empty?
254
+ cmd_args << '-d' << File.expand_path(target)
255
+ cmd_args += scalac_args
256
+ cmd_args << "-debug" if trace?(:scalac)
257
+
258
+ cmd_args.map!(&:to_s)
259
+
260
+ cmd_args += files_from_sources(sources)
261
+
262
+ unless Buildr.application.options.dryrun
263
+ trace((['com.typesafe.zinc.Main.main'] + cmd_args).join(' '))
264
+
265
+ Java.load
266
+ begin
267
+ Java.com.typesafe.zinc.Main.main(cmd_args.to_java(Java.java.lang.String))
268
+ rescue => e
269
+ fail "Zinc compiler crashed:\n#{e.inspect}\n#{e.backtrace.join("\n")}"
270
+ end
271
+ end
272
+ end
273
+
214
274
  protected
215
275
 
216
276
  # :nodoc: see Compiler:Base
@@ -255,6 +315,10 @@ module Buildr::Scala
255
315
 
256
316
  private
257
317
 
318
+ def zinc?
319
+ (options[:incremental] || @project.scalac_options.incremental || (Buildr.settings.build['scalac.incremental'].to_s == "true"))
320
+ end
321
+
258
322
  def count(file, pattern)
259
323
  count = 0
260
324
  File.open(file, "r") do |infile|
@@ -283,13 +347,39 @@ module Buildr::Scala
283
347
  args << "-deprecation" if options[:deprecation]
284
348
  args << "-optimise" if options[:optimise]
285
349
  args << "-target:jvm-" + options[:target].to_s if options[:target]
286
- args + Array(options[:other])
350
+ args += Array(options[:other])
351
+ if zinc?
352
+ args.map { |arg| "-S" + arg } + Array(options[:zinc_options])
353
+ else
354
+ args
355
+ end
287
356
  end
357
+ end
288
358
 
359
+ module ProjectExtension
360
+ def scalac_options
361
+ @scalac ||= ScalacOptions.new(self)
362
+ end
289
363
  end
290
364
 
365
+ class ScalacOptions
366
+ attr_writer :incremental
367
+
368
+ def initialize(project)
369
+ @project = project
370
+ end
371
+
372
+ def incremental
373
+ @incremental || (@project.parent ? @project.parent.scalac_options.incremental : nil)
374
+ end
375
+ end
291
376
  end
292
377
 
293
378
  # Scala compiler comes first, ahead of Javac, this allows it to pick
294
379
  # projects that mix Scala and Java code by spotting Scala code first.
295
380
  Buildr::Compiler.compilers.unshift Buildr::Scala::Scalac
381
+
382
+ class Buildr::Project
383
+ include Buildr::Scala::ProjectExtension
384
+ end
385
+
@@ -23,8 +23,13 @@ module Buildr
23
23
  after_define(:scaladoc => :doc) do |project|
24
24
  if project.doc.engine? Scaladoc
25
25
  options = project.doc.options
26
- key = Scala.version?(2.7) ? :windowtitle : "doc-title".to_sym
27
- options[key] = (project.comment || project.name) unless options[key]
26
+ if Scala.version?(2.7)
27
+ options[:windowtitle] = (project.comment || project.name) unless options[:windowtitle]
28
+ else
29
+ doc_title = "doc-title".to_sym
30
+ options[doc_title] = (project.comment || project.name) unless options[doc_title]
31
+ options.delete(:windowtitle) if options[:windowtitle]
32
+ end
28
33
  end
29
34
  end
30
35
  end
@@ -33,7 +38,8 @@ module Buildr
33
38
  specify :language => :scala, :source_ext => 'scala'
34
39
 
35
40
  def generate(sources, target, options = {})
36
- cmd_args = [ '-d', target, trace?(:scaladoc) ? '-verbose' : '' ]
41
+ cmd_args = [ '-d', target]
42
+ cmd_args << '-verbose' if trace?(:scaladoc)
37
43
  options.reject { |key, value| [:sourcepath, :classpath].include?(key) }.
38
44
  each { |key, value| value.invoke if value.respond_to?(:invoke) }.
39
45
  each do |key, value|
@@ -74,11 +80,17 @@ module Buildr
74
80
 
75
81
  class VScaladoc < Base
76
82
  VERSION = '1.2-m1'
77
- Buildr.repositories.remote << 'http://scala-tools.org/repo-snapshots'
83
+ Buildr.repositories.remote << 'https://oss.sonatype.org/content/groups/scala-tools'
78
84
 
79
85
  class << self
80
86
  def dependencies
81
- [ "org.scala-tools:vscaladoc:jar:#{VERSION}" ]
87
+ case
88
+ when Buildr::Scala.version?("2.7")
89
+ [ "org.scala-tools:vscaladoc:jar:#{VERSION}" ]
90
+ else
91
+ warn "VScaladoc does not support Scala 2.8+"
92
+ []
93
+ end
82
94
  end
83
95
  end
84
96
 
@@ -40,7 +40,7 @@ module Buildr::Scala
40
40
  when Buildr::Scala.version?("2.8.1")
41
41
  '1.8'
42
42
  else
43
- '1.9'
43
+ '1.10.0'
44
44
  end
45
45
 
46
46
  class << self
@@ -58,10 +58,16 @@ module Buildr::Scala
58
58
 
59
59
  def dependencies
60
60
  return [version] if (version =~ /:/)
61
+ group = case
62
+ when version =~ /^1.[67]/
63
+ "org.scala-tools.testing"
64
+ else
65
+ "org.scalacheck"
66
+ end
61
67
  if classifier
62
- ["org.scala-tools.testing:#{artifact}:jar:#{classifier}:#{version}"]
68
+ ["#{group}:#{artifact}:jar:#{classifier}:#{version}"]
63
69
  else
64
- ["org.scala-tools.testing:#{artifact}:jar:#{version}"]
70
+ ["#{group}:#{artifact}:jar:#{version}"]
65
71
  end
66
72
  end
67
73
 
@@ -83,7 +89,12 @@ module Buildr::Scala
83
89
  # * :java_args -- Arguments passed as is to the JVM.
84
90
  class ScalaTest < Buildr::TestFramework::Java
85
91
 
86
- VERSION = Buildr::Scala.version?(2.7, 2.8) ? '1.3' : '1.6.1'
92
+ VERSION = case
93
+ when Buildr::Scala.version?(2.7)
94
+ '1.3'
95
+ else
96
+ '1.8'
97
+ end
87
98
 
88
99
  class << self
89
100
  def version
@@ -14,5 +14,5 @@
14
14
  # the License.
15
15
 
16
16
  module Buildr
17
- VERSION = '1.4.7'.freeze
17
+ VERSION = '1.4.8'.freeze
18
18
  end
@@ -13,60 +13,57 @@
13
13
  # License for the specific language governing permissions and limitations under
14
14
  # the License.
15
15
 
16
- desc "Create JRuby all-in-one distribution"
17
- task "all-in-one" => 'all-in-one:all-in-one'
16
+ def workspace_dir
17
+ "#{File.expand_path(File.join(File.dirname(__FILE__), ".."))}"
18
+ end
19
+
20
+ desc 'Create JRuby all-in-one distribution'
21
+ task 'all-in-one' => 'all-in-one:all-in-one'
18
22
 
19
- namespace :'all-in-one' do
23
+ namespace 'all-in-one' do
20
24
 
21
- version = "1.6.4"
25
+ version = '1.6.7'
22
26
  jruby_distro = "jruby-bin-#{version}.tar.gz"
23
27
  url = "http://jruby.org.s3.amazonaws.com/downloads/#{version}/#{jruby_distro}"
24
28
  dir = "jruby-#{version}"
25
29
 
26
- task "all-in-one" => [:gem,
27
- # Prepare to run
28
- :prepare,
29
- # Download and extract JRuby
30
- :download_and_extract,
31
- # Cleanup JRuby distribution
32
- :clean_dist,
33
- # Install Buildr gem and dependencies
34
- :install_dependencies,
35
- # Add Buildr executables/scripts
36
- :add_execs,
37
- # Package distribution
38
- :package
39
- ]
30
+ task 'all-in-one' => %w(gem prepare download_and_extract clean_dist install_dependencies add_execs package)
40
31
 
41
32
  desc 'Prepare to run'
42
- task :prepare do
33
+ task 'prepare' do
43
34
  mkpath '_all-in-one'
44
35
  cd '_all-in-one'
45
36
  end
46
37
 
47
38
  desc 'Download and extract JRuby'
48
- task :download_and_extract do
49
- unless File.exist? jruby_distro
39
+ task 'download_and_extract' do
40
+ unless File.exist?(jruby_distro)
50
41
  puts "Downloading JRuby from #{url} ..."
51
- sh 'wget', url
52
- puts "[X] Downloaded JRuby"
42
+ require 'open-uri'
43
+ File.open(jruby_distro, "wb") do |saved_file|
44
+ # the following "open" is provided by open-uri
45
+ open(url) do |read_file|
46
+ saved_file.write(read_file.read)
47
+ end
48
+ end
49
+ puts '[X] Downloaded JRuby'
53
50
  end
54
51
 
55
52
  rm_rf dir if File.exist? dir
56
53
 
57
54
  puts "Extracting JRuby to #{dir} ..."
58
55
  sh 'tar', 'xzf', jruby_distro
59
- puts "[X] Extracted JRuby"
56
+ puts '[X] Extracted JRuby'
60
57
  cd dir
61
58
  end
62
59
 
63
60
  desc 'Cleanup JRuby distribution'
64
- task :clean_dist do
61
+ task 'clean_dist' do
65
62
  puts 'Cleaning...'
66
63
  rm_rf 'docs'
67
64
  mkpath 'jruby-docs'
68
- mv Dir["COPYING*"], 'jruby-docs'
69
- mv Dir["LICENSE*"], 'jruby-docs'
65
+ mv Dir['COPYING*'], 'jruby-docs'
66
+ mv Dir['LICENSE*'], 'jruby-docs'
70
67
  mv 'README', 'jruby-docs'
71
68
  rm_rf 'lib/ruby/1.9'
72
69
  rm_rf 'lib/ruby/gems/1.8/doc'
@@ -75,48 +72,54 @@ namespace :'all-in-one' do
75
72
  end
76
73
 
77
74
  desc 'Install Buildr gem and dependencies'
78
- task :install_dependencies do
79
- puts "Install rubygems-update"
80
- sh "bin/jruby -S gem install rubygems-update"
75
+ task 'install_dependencies' do
76
+ puts 'Install ffi-ncurses'
77
+ sh 'bin/jruby -S gem install -b ffi-ncurses --version 0.4.0'
81
78
 
82
- puts "Upgrade Rubygems"
83
- sh "bin/jruby -S gem update --system"
79
+ puts 'Install rubygems-update'
80
+ sh 'bin/jruby -S gem install -b rubygems-update'
84
81
 
85
- puts "Install ffi-ncurses"
86
- sh "bin/jruby -S gem install ffi-ncurses"
82
+ # Disabled until we can figure out why it does not work in the CI
83
+ #puts 'Upgrade Rubygems'
84
+ #sh 'bin/jruby -S gem update --system'
87
85
 
88
- puts "Install Buildr gem ..."
89
- sh "bin/jruby", '-S', 'gem', 'install', FileList['../../pkg/*-java.gem'].first,
86
+ puts 'Install Buildr gem ...'
87
+ sh 'bin/jruby', '-S', 'gem', 'install', FileList['../../pkg/*-java.gem'].first,
90
88
  '--no-rdoc', '--no-ri'
91
- puts "[X] Install Buildr gem"
89
+ puts '[X] Install Buildr gem'
92
90
  end
93
91
 
94
92
  desc 'Add Buildr executables/scripts'
95
- task :add_execs do
93
+ task 'add_execs' do
96
94
  cp 'bin/jruby.exe', 'bin/_buildr.exe'
97
- cp Dir["../../all-in-one/*"], 'bin'
95
+ cp "#{workspace_dir}/all-in-one/buildr", 'bin/buildr'
96
+ cp "#{workspace_dir}/all-in-one/_buildr", 'bin/_buildr'
97
+ cp "#{workspace_dir}/all-in-one/buildr.cmd", 'bin/buildr.cmd'
98
+ File.chmod(0500, 'bin/_buildr', 'bin/buildr')
98
99
  end
99
100
 
100
101
  desc 'Package distribution'
101
- task :package do
102
- puts "Zipping distribution ..."
102
+ task 'package' do
103
+ pkg_dir = "#{workspace_dir}/pkg"
104
+ mkpath pkg_dir
105
+ puts 'Zipping distribution ...'
103
106
  cd '..'
104
107
  new_dir = "#{spec.name}-all-in-one-#{spec.version}"
105
108
  mv dir, new_dir
106
- zip = "#{new_dir}.zip"
109
+ zip = "#{pkg_dir}/#{new_dir}.zip"
107
110
  rm zip if File.exist? zip
108
111
  sh 'zip', '-q', '-r', zip, new_dir
109
- puts "[X] Zipped distribution"
112
+ puts '[X] Zipped distribution'
110
113
 
111
- puts "Tarring distribution ..."
112
- tar = "#{new_dir}.tar.gz"
114
+ puts 'Tarring distribution ...'
115
+ tar = "#{pkg_dir}/#{new_dir}.tar.gz"
113
116
  rm tar if File.exist? tar
114
117
  sh 'tar', 'czf', tar, new_dir
115
- puts "[X] Tarred distribution"
118
+ puts '[X] Tarred distribution'
116
119
 
117
120
  rm_rf new_dir
118
121
  end
119
122
 
120
123
  end
121
124
 
122
- task(:clobber) { rm_rf '_all-in-one' }
125
+ task('clobber') { rm_rf '_all-in-one' }