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.
- data/CHANGELOG +41 -0
- data/Rakefile +0 -6
- data/addon/buildr/bnd.rb +13 -3
- data/addon/buildr/checkstyle.rb +1 -1
- data/addon/buildr/git_auto_version.rb +33 -0
- data/addon/buildr/{gwt.rake → gwt.rb} +0 -0
- data/addon/buildr/jacoco.rb +194 -0
- data/buildr.buildfile +1 -1
- data/buildr.gemspec +23 -16
- data/doc/_layouts/default.html +0 -2
- data/doc/contributing.textile +47 -0
- data/doc/download.textile +24 -0
- data/doc/index.textile +43 -23
- data/doc/languages.textile +65 -6
- data/doc/more_stuff.textile +12 -0
- data/doc/packaging.textile +2 -0
- data/doc/settings_profiles.textile +1 -1
- data/lib/buildr.rb +0 -4
- data/lib/buildr/core/application.rb +41 -8
- data/lib/buildr/core/build.rb +102 -1
- data/lib/buildr/core/cc.rb +14 -8
- data/lib/buildr/core/generate.rb +148 -7
- data/lib/buildr/core/util.rb +3 -3
- data/lib/buildr/ide/eclipse.rb +114 -0
- data/lib/buildr/ide/idea.rb +95 -1
- data/lib/buildr/java/commands.rb +1 -1
- data/lib/buildr/java/rjb.rb +5 -4
- data/lib/buildr/packaging/artifact.rb +1 -1
- data/lib/buildr/packaging/ziptask.rb +2 -2
- data/lib/buildr/scala.rb +1 -1
- data/lib/buildr/scala/bdd.rb +9 -2
- data/lib/buildr/scala/compiler.rb +94 -4
- data/lib/buildr/scala/doc.rb +17 -5
- data/lib/buildr/scala/tests.rb +15 -4
- data/lib/buildr/version.rb +1 -1
- data/rakelib/all-in-one.rake +50 -47
- data/rakelib/checks.rake +4 -4
- data/rakelib/doc.rake +85 -88
- data/rakelib/metrics.rake +9 -9
- data/rakelib/package.rake +13 -34
- data/rakelib/release.rake +11 -12
- data/rakelib/rspec.rake +71 -76
- data/rakelib/stage.rake +25 -51
- data/spec/addon/bnd_spec.rb +61 -7
- data/spec/core/build_spec.rb +117 -0
- data/spec/core/cc_spec.rb +36 -22
- data/spec/core/common_spec.rb +3 -2
- data/spec/core/compile_spec.rb +3 -3
- data/spec/core/generate_from_eclipse_spec.rb +280 -0
- data/spec/java/bdd_spec.rb +2 -2
- data/spec/java/packaging_spec.rb +2 -1
- data/spec/packaging/archive_spec.rb +25 -2
- data/spec/packaging/artifact_spec.rb +2 -2
- data/spec/sandbox.rb +3 -2
- data/spec/scala/compiler_spec.rb +41 -0
- data/spec/scala/doc_spec.rb +22 -3
- data/spec/scala/scala.rb +2 -2
- data/spec/scala/tests_spec.rb +2 -2
- metadata +223 -194
- data/addon/buildr/jdepend.rb.orig +0 -178
- data/doc/installing.textile.orig +0 -282
- data/doc/more_stuff.textile.orig +0 -1004
- data/lib/buildr/ide/eclipse/java.rb +0 -49
- data/lib/buildr/ide/eclipse/plugin.rb +0 -67
- data/lib/buildr/ide/eclipse/scala.rb +0 -64
data/lib/buildr/java/commands.rb
CHANGED
@@ -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.
|
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
|
data/lib/buildr/java/rjb.rb
CHANGED
@@ -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"
|
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
|
-
|
161
|
-
File.
|
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://
|
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'
|
data/lib/buildr/scala/bdd.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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.
|
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
|
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
|
+
|
data/lib/buildr/scala/doc.rb
CHANGED
@@ -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
|
-
|
27
|
-
|
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
|
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 << '
|
83
|
+
Buildr.repositories.remote << 'https://oss.sonatype.org/content/groups/scala-tools'
|
78
84
|
|
79
85
|
class << self
|
80
86
|
def dependencies
|
81
|
-
|
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
|
|
data/lib/buildr/scala/tests.rb
CHANGED
@@ -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.
|
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
|
-
["
|
68
|
+
["#{group}:#{artifact}:jar:#{classifier}:#{version}"]
|
63
69
|
else
|
64
|
-
["
|
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 =
|
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
|
data/lib/buildr/version.rb
CHANGED
data/rakelib/all-in-one.rake
CHANGED
@@ -13,60 +13,57 @@
|
|
13
13
|
# License for the specific language governing permissions and limitations under
|
14
14
|
# the License.
|
15
15
|
|
16
|
-
|
17
|
-
|
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
|
23
|
+
namespace 'all-in-one' do
|
20
24
|
|
21
|
-
version =
|
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
|
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
|
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
|
49
|
-
unless File.exist?
|
39
|
+
task 'download_and_extract' do
|
40
|
+
unless File.exist?(jruby_distro)
|
50
41
|
puts "Downloading JRuby from #{url} ..."
|
51
|
-
|
52
|
-
|
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
|
56
|
+
puts '[X] Extracted JRuby'
|
60
57
|
cd dir
|
61
58
|
end
|
62
59
|
|
63
60
|
desc 'Cleanup JRuby distribution'
|
64
|
-
task
|
61
|
+
task 'clean_dist' do
|
65
62
|
puts 'Cleaning...'
|
66
63
|
rm_rf 'docs'
|
67
64
|
mkpath 'jruby-docs'
|
68
|
-
mv Dir[
|
69
|
-
mv Dir[
|
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
|
79
|
-
puts
|
80
|
-
sh
|
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
|
83
|
-
sh
|
79
|
+
puts 'Install rubygems-update'
|
80
|
+
sh 'bin/jruby -S gem install -b rubygems-update'
|
84
81
|
|
85
|
-
|
86
|
-
|
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
|
89
|
-
sh
|
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
|
89
|
+
puts '[X] Install Buildr gem'
|
92
90
|
end
|
93
91
|
|
94
92
|
desc 'Add Buildr executables/scripts'
|
95
|
-
task
|
93
|
+
task 'add_execs' do
|
96
94
|
cp 'bin/jruby.exe', 'bin/_buildr.exe'
|
97
|
-
cp
|
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
|
102
|
-
|
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
|
112
|
+
puts '[X] Zipped distribution'
|
110
113
|
|
111
|
-
puts
|
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
|
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(
|
125
|
+
task('clobber') { rm_rf '_all-in-one' }
|