public
Rubygem
Description: Apache Buildr
Homepage: http://incubator.apache.org/buildr
Clone URL: git://github.com/vic/buildr.git
Search Repo:
A bit more reorgenizing, less spreading methods all over the place: 
warn_deprecated moved to Buildr::Application, recursive_with_dot_files now 
in Buildr::Util. 
Removed gem-install from Util: we should only accommodate Gem installation 
through Buildr::Application.
warn coloring should work on Windows if win32console installed.
Buildr's Rakefile no longer requires Highline (nice idea, but really 
tricky to pull off, file under "what was I thinking?").



git-svn-id: https://svn.apache.org/repos/asf/incubator/buildr/trunk@645768 
13f79535-47bb-0310-9956-ffa450edef68
Assaf (author)
Mon Apr 07 22:45:34 -0700 2008
commit  4f15197038e6836f5a1f6fc6202300d5926bde53
tree    216c0d08c364ba4a3bb5ba57dc5525908e58df6b
parent  a9f2e760a0e49e76d52c98c85bf7e9fa1b3f0cf4
...
13
14
15
 
16
17
18
...
13
14
15
16
17
18
19
0
@@ -13,6 +13,7 @@
0
 # License for the specific language governing permissions and limitations under
0
 # the License.
0
 
0
+
0
 $LOADED_FEATURES << 'jruby' unless RUBY_PLATFORM =~ /java/ # Pretend to have JRuby, keeps Nailgun happy.
0
 require 'buildr/jetty'
0
 require 'buildr/nailgun'
...
45
46
47
48
49
50
51
52
53
...
247
248
249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
251
252
...
271
272
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
...
45
46
47
 
 
 
48
49
50
...
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
...
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
0
@@ -45,9 +45,6 @@
0
 ENV["HOME"] ||= File.expand_path(Gem::user_home)
0
 ENV['BUILDR_ENV'] ||= 'development'
0
 
0
-# Add a touch of colors (red) to warnings.
0
-HighLine.use_color = !Buildr::Util.win_os?
0
-
0
 module Buildr
0
 
0
   class Application < Rake::Application #:nodoc:
0
@@ -247,6 +244,26 @@
0
     end
0
     private :load_tasks
0
 
0
+ # :call-seq:
0
+ # deprecated(message)
0
+ #
0
+ # Use with deprecated methods and classes. This method automatically adds the file name and line number,
0
+ # and the text 'Deprecated' before the message, and eliminated duplicate warnings. It only warns when
0
+ # running in verbose mode.
0
+ #
0
+ # For example:
0
+ # deprecated 'Please use new_foo instead of foo.'
0
+ def deprecated(message) #:nodoc:
0
+ return unless verbose
0
+ "#{caller[1]}: Deprecated: #{message}".tap do |message|
0
+ @deprecated ||= {}
0
+ unless @deprecated[message]
0
+ @deprecated[message] = true
0
+ warn message
0
+ end
0
+ end
0
+ end
0
+
0
   end
0
 
0
 
0
@@ -271,5 +288,24 @@
0
 
0
   Buildr.application = Rake.application = Buildr::Application.new
0
 
0
+end
0
+
0
+
0
+# Add a touch of colors (red) to warnings.
0
+if $stdout.isatty
0
+ begin
0
+ require 'Win32/Console/ANSI' if Config::CONFIG['host_os'] =~ /mswin/
0
+ HighLine.use_color = true
0
+ rescue LoadError
0
+ end
0
+end
0
+
0
+if HighLine.use_color?
0
+ module Kernel #:nodoc:
0
+ alias :warn_without_color :warn
0
+ def warn(message)
0
+ warn_without_color $terminal.color(message.to_s, :red)
0
+ end
0
+ end
0
 end
...
66
67
68
69
 
70
71
72
73
74
75
 
76
77
78
79
80
81
 
82
83
84
85
86
87
 
88
89
90
...
66
67
68
 
69
70
71
72
73
74
 
75
76
77
78
79
80
 
81
82
83
84
85
86
 
87
88
89
90
0
@@ -66,25 +66,25 @@
0
 
0
     # *Deprecated:* Use +path_to(:target)+ instead.
0
     def target
0
- warn_deprecated 'Use path_to(:target) instead'
0
+ Buildr.application.deprecated 'Use path_to(:target) instead'
0
       layout.expand(:target)
0
     end
0
 
0
     # *Deprecated:* Use Layout instead.
0
     def target=(dir)
0
- warn_deprecated 'Use Layout instead'
0
+ Buildr.application.deprecated 'Use Layout instead'
0
       layout[:target] = _(dir)
0
     end
0
 
0
     # *Deprecated:* Use +path_to(:reports)+ instead.
0
     def reports()
0
- warn_deprecated 'Use path_to(:reports) instead'
0
+ Buildr.application.deprecated 'Use path_to(:reports) instead'
0
       layout.expand(:reports)
0
     end
0
 
0
     # *Deprecated:* Use Layout instead.
0
     def reports=(dir)
0
- warn_deprecated 'Use Layout instead'
0
+ Buildr.application.deprecated 'Use Layout instead'
0
       layout[:reports] = _(dir)
0
     end
0
 
...
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
...
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
14
15
16
 
17
18
19
20
21
22
 
 
 
 
 
 
 
 
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
25
26
...
116
117
118
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
120
121
0
@@ -14,48 +14,13 @@
0
 # the License.
0
 
0
 require 'tempfile'
0
-require 'pathname'
0
 require 'open-uri'
0
 $LOADED_FEATURES << 'rubygems/open-uri.rb' # avoid loading rubygems' open-uri
0
 require 'uri/open-sftp'
0
 require 'buildr/core/util'
0
 require 'buildr/core/transports'
0
 
0
-module Rake #:nodoc
0
- class FileList
0
- class << self
0
- def recursive(*dirs)
0
- FileList[dirs.map { |dir| File.join(dir, '/**/{*,.*}') }].reject { |file| File.basename(file) =~ /^[.]{1,2}$/ }
0
- end
0
- end
0
- end
0
 
0
- class Task #:nodoc:
0
- def invoke(*args)
0
- task_args = TaskArguments.new(arg_names, args)
0
- invoke_with_call_chain(task_args, Thread.current[:rake_chain] || InvocationChain::EMPTY)
0
- end
0
-
0
- def invoke_with_call_chain(task_args, invocation_chain)
0
- new_chain = InvocationChain.append(self, invocation_chain)
0
- @lock.synchronize do
0
- if application.options.trace
0
- puts "** Invoke #{name} #{format_trace_flags}"
0
- end
0
- return if @already_invoked
0
- @already_invoked = true
0
- invoke_prerequisites(task_args, new_chain)
0
- begin
0
- old_chain, Thread.current[:rake_chain] = Thread.current[:rake_chain], new_chain
0
- execute(task_args) if needed?
0
- ensure
0
- Thread.current[:rake_chain] = nil
0
- end
0
- end
0
- end
0
- end
0
-end
0
-
0
 module Buildr
0
 
0
   # :call-seq:
0
@@ -151,36 +116,6 @@
0
       end
0
     end
0
 
0
- end
0
-
0
-end
0
-
0
-
0
-module Kernel #:nodoc:
0
-
0
- alias :warn_without_color :warn
0
- def warn(message)
0
- warn_without_color $terminal.color(message.to_s, :red)
0
- end
0
-
0
- # :call-seq:
0
- # warn_deprecated(message)
0
- #
0
- # Use with deprecated methods and classes. This method automatically adds the file name and line number,
0
- # and the text 'Deprecated' before the message, and eliminated duplicate warnings. It only warns when
0
- # running in verbose mode.
0
- #
0
- # For example:
0
- # warn_deprecated 'Please use new_foo instead of foo.'
0
- def warn_deprecated(message) #:nodoc:
0
- return unless verbose
0
- "#{caller[1]}: Deprecated: #{message}".tap do |message|
0
- @deprecated ||= {}
0
- unless @deprecated[message]
0
- @deprecated[message] = true
0
- warn message
0
- end
0
- end
0
   end
0
 
0
 end
...
249
250
251
252
 
253
254
255
256
257
258
 
259
260
261
...
249
250
251
 
252
253
254
255
256
257
 
258
259
260
261
0
@@ -249,13 +249,13 @@
0
 
0
     # *Deprecated*: Use dependencies instead.
0
     def classpath
0
- warn_deprecated 'Use dependencies instead.'
0
+ Buildr.application.deprecated 'Use dependencies instead.'
0
       dependencies
0
     end
0
 
0
     # *Deprecated*: Use dependencies= instead.
0
     def classpath=(artifacts)
0
- warn_deprecated 'Use dependencies= instead.'
0
+ Buildr.application.deprecated 'Use dependencies= instead.'
0
       self.dependencies = artifacts
0
     end
0
 
...
165
166
167
168
 
169
170
171
...
165
166
167
 
168
169
170
171
0
@@ -165,7 +165,7 @@
0
       raise 'No target directory specified, where am I going to copy the files to?' if target.nil?
0
 
0
       copy_map = sources.flatten.map(&:to_s).inject({}) do |map, source|
0
- files = FileList.recursive(source).
0
+ files = Util.recursive_with_dot_files(source).
0
           map { |file| Util.relative_path(file, source) }.
0
           select { |file| @include.empty? || @include.any? { |pattern| File.fnmatch(pattern, file, File::FNM_PATHNAME) } }.
0
           reject { |file| @exclude.any? { |pattern| File.fnmatch(pattern, file, File::FNM_PATHNAME) } }
...
149
150
151
152
 
153
154
155
...
149
150
151
 
152
153
154
155
0
@@ -149,7 +149,7 @@
0
         end
0
         package = packages.find { |pkg| pkg.name == file_name } || packager.call(file_name)
0
       else
0
- warn_deprecated "We changed the way package_as methods are implemented. See the package method documentation for more details."
0
+ Buildr.application.deprecated "We changed the way package_as methods are implemented. See the package method documentation for more details."
0
         file_name ||= path_to(:target, Artifact.hash_to_file_name(spec))
0
         package = packager.call(file_name, spec)
0
       end
...
322
323
324
325
 
326
327
328
...
322
323
324
 
325
326
327
328
0
@@ -322,7 +322,7 @@
0
 
0
       # *Deprecated* Check the Extension module to see how extensions are handled.
0
       def on_define(&block)
0
- warn_deprecated 'This method is deprecated, see Extension'
0
+ Buildr.application.deprecated 'This method is deprecated, see Extension'
0
         (@on_define ||= []) << block if block
0
       end
0
 
...
204
205
206
207
 
208
209
210
211
212
213
 
214
215
216
...
313
314
315
316
 
317
318
319
...
350
351
352
353
 
354
355
356
...
204
205
206
 
207
208
209
210
211
212
 
213
214
215
216
...
313
314
315
 
316
317
318
319
...
350
351
352
 
353
354
355
356
0
@@ -204,13 +204,13 @@
0
 
0
     # *Deprecated*: Use dependencies instead.
0
     def classpath
0
- warn_deprecated 'Use dependencies instead.'
0
+ Buildr.application.deprecated 'Use dependencies instead.'
0
       dependencies
0
     end
0
 
0
     # *Deprecated*: Use dependencies= instead.
0
     def classpath=(artifacts)
0
- warn_deprecated 'Use dependencies= instead.'
0
+ Buildr.application.deprecated 'Use dependencies= instead.'
0
       self.dependencies = artifacts
0
     end
0
 
0
@@ -313,7 +313,7 @@
0
         elsif name == :integration
0
           options[:integration] = true
0
         else
0
- warn_deprecated "Please replace with using(:#{name}=>true)"
0
+ Buildr.application.deprecated "Please replace with using(:#{name}=>true)"
0
           options[name.to_sym] = true
0
         end
0
       end
0
@@ -350,7 +350,7 @@
0
 
0
     # *Deprecated*: Use tests instead.
0
     def classes
0
- warn_deprecated 'Call tests instead of classes'
0
+ Buildr.application.deprecated 'Call tests instead of classes'
0
       tests
0
     end
0
 
...
16
17
18
 
19
20
21
...
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
...
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
121
122
123
 
 
 
 
 
 
 
 
 
124
125
126
 
127
128
129
...
186
187
188
 
189
190
191
...
245
246
247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
...
16
17
18
19
20
21
22
...
39
40
41
 
 
 
 
 
 
 
 
 
 
 
42
43
44
...
58
59
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
62
63
64
...
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
...
157
158
159
160
161
162
163
...
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
0
@@ -16,6 +16,7 @@
0
 require 'rbconfig'
0
 require 'pathname'
0
 
0
+
0
 module Buildr
0
   
0
   module Util
0
@@ -38,17 +39,6 @@
0
       Config::CONFIG['host_os'] =~ /windows|cygwin|bccwin|cygwin|djgpp|mingw|mswin|wince/i
0
     end
0
 
0
- # Finds and returns path to executable. Consults PATH environment variable.
0
- # Returns nil if executable not found.
0
- def which(name)
0
- if win_os?
0
- path = ENV['PATH'].split(File::PATH_SEPARATOR).map { |path| path.gsub('\\', '/') }.map { |path| "#{path}/#{name}.{exe,bat,com}" }
0
- else
0
- path = ENV['PATH'].split(File::PATH_SEPARATOR).map { |path| "#{path}/#{name}" }
0
- end
0
- FileList[path].existing.first
0
- end
0
-
0
     # Runs Ruby with these command line arguments. The last argument may be a hash,
0
     # supporting the following keys:
0
     # :command -- Runs the specified script (e.g., :command=>'gem')
0
@@ -68,35 +58,6 @@
0
       end
0
     end
0
 
0
- # :call-seq:
0
- # install_gems(*dependencies)
0
- #
0
- def install_gems(*gems)
0
- installed = Gem::SourceIndex.from_installed_gems
0
- dependencies = gems.map do |gem|
0
- case gem
0
- when Gem::Dependency then gem
0
- when Array then Gem::Dependency.new(*gem)
0
- when String then Gem::Dependency.new(gem, '> 0')
0
- else raise "Invalid gem dependency: #{gem.inspect}"
0
- end
0
- end
0
- dependencies.select { |dep| installed.search(dep.name, dep.version_requirements).empty? }.each do |dep|
0
- puts "Installing #{dep} ..."
0
- if win_os? # run the installer directly
0
- begin
0
- require 'rubygems/dependency_installer'
0
- Gem::DependencyInstaller.new(dep.name, dep.version_requirements).install
0
- rescue LoadError
0
- require 'rubygems/remote_installer'
0
- Gem::RemoteInstaller.new.install(dep.name, dep.version_requirements)
0
- end
0
- else
0
- ruby 'install', dep.name, '-v', dep.version_requirements.to_s.inspect, :command=>'gem', :sudo=>true
0
- end
0
- end
0
- end
0
-
0
     # Just like File.expand_path, but for windows systems it
0
     # capitalizes the drive name and ensures backslashes are used
0
     def normalize_path(path, *dirs)
0
0
@@ -121,9 +82,19 @@
0
       to, from = File.expand_path(to.to_s, "/"), File.expand_path(from.to_s, "/")
0
       Pathname.new(to).relative_path_from(Pathname.new(from)).to_s
0
     end
0
+
0
+ # Generally speaking, it's not a good idea to operate on dot files (files starting with dot).
0
+ # These are considered invisible files (.svn, .hg, .irbrc, etc). Dir.glob/FileList ignore them
0
+ # on purpose. There are few cases where we do have to work with them (filter, zip), a better
0
+ # solution is welcome, maybe being more explicit with include. For now, this will do.
0
+ def recursive_with_dot_files(*dirs)
0
+ FileList[dirs.map { |dir| File.join(dir, '/**/{*,.*}') }].reject { |file| File.basename(file) =~ /^[.]{1,2}$/ }
0
+ end
0
+
0
   end
0
 end
0
 
0
+
0
 module Kernel #:nodoc:
0
   # Borrowed from Ruby 1.9.
0
   def tap
0
@@ -186,6 +157,7 @@
0
   end
0
 end
0
 
0
+
0
 class Hash
0
 
0
   class << self
0
@@ -245,5 +217,33 @@
0
     }.join("\n")
0
   end
0
 
0
+end
0
+
0
+
0
+module Rake #:nodoc
0
+ class Task #:nodoc:
0
+ def invoke(*args)
0
+ task_args = TaskArguments.new(arg_names, args)
0
+ invoke_with_call_chain(task_args, Thread.current[:rake_chain] || InvocationChain::EMPTY)
0
+ end
0
+
0
+ def invoke_with_call_chain(task_args, invocation_chain)
0
+ new_chain = InvocationChain.append(self, invocation_chain)
0
+ @lock.synchronize do
0
+ if application.options.trace
0
+ puts "** Invoke #{name} #{format_trace_flags}"
0
+ end
0
+ return if @already_invoked
0
+ @already_invoked = true
0
+ invoke_prerequisites(task_args, new_chain)
0
+ begin
0
+ old_chain, Thread.current[:rake_chain] = Thread.current[:rake_chain], new_chain
0
+ execute(task_args) if needed?
0
+ ensure
0
+ Thread.current[:rake_chain] = nil
0
+ end
0
+ end
0
+ end
0
+ end
0
 end
...
31
32
33
34
 
35
36
37
38
...
41
42
43
44
 
45
46
47
48
49
50
 
51
52
53
...
55
56
57
58
 
59
60
61
62
63
64
65
66
...
66
67
68
69
 
70
71
72
73
74
75
 
76
77
78
79
80
81
 
82
83
84
85
86
87
 
88
89
90
91
92
93
 
94
95
96
97
98
99
100
 
101
102
103
...
108
109
110
111
 
112
113
114
115
...
126
127
128
129
 
130
131
132
133
134
135
 
136
137
138
...
31
32
33
 
34
35
36
37
38
...
41
42
43
 
44
45
46
47
48
49
 
50
51
52
53
...
55
56
57
 
58
59
60
61
62
63
64
65
66
...
66
67
68
 
69
70
71
72
73
74
 
75
76
77
78
79
80
 
81
82
83
84
85
86
 
87
88
89
90
91
92
 
93
94
95
96
97
98
99
 
100
101
102
103
...
108
109
110
 
111
112
113
114
115
...
126
127
128
 
129
130
131
132
133
134
 
135
136
137
138
0
@@ -31,7 +31,7 @@
0
 
0
     # *Deprecated:* Append to Java.classpath directly.
0
     def classpath
0
- warn_deprecated 'Append to Java.classpath instead.'
0
+ Buildr.application.deprecated 'Append to Java.classpath instead.'
0
       ::Java.classpath
0
     end
0
 
0
0
@@ -41,13 +41,13 @@
0
 
0
     # *Deprecated:* No longer necessary.
0
     def setup
0
- warn_deprecated 'See documentation for new way to access Java code.'
0
+ Buildr.application.deprecated 'See documentation for new way to access Java code.'
0
       yield self if block_given?
0
     end
0
     
0
     # *Deprecated:* Use Java.load instead.
0
     def load
0
- warn_deprecated 'Use Java.load instead.'
0
+ Buildr.application.deprecated 'Use Java.load instead.'
0
       ::Java.load
0
     end
0
 
0
@@ -55,7 +55,7 @@
0
 
0
     # *Deprecated:* Use Java.pkg.pkg.ClassName to import a Java class.
0
     def import(class_name)
0
- warn_deprecated 'Use Java.pkg.pkg.ClassName to import a Java class.'
0
+ Buildr.application.deprecated 'Use Java.pkg.pkg.ClassName to import a Java class.'
0
       ::Java.instance_eval(class_name)
0
     end
0
   end
0
0
0
0
0
0
@@ -66,38 +66,38 @@
0
     # *Deprecated*: Use Java::Commands.java instead.
0
     def java(*args, &block)
0
       return send(:method_missing, :java) if args.empty?
0
- warn_deprecated 'Use Java::Commands.javadoc instead.'
0
+ Buildr.application.deprecated 'Use Java::Commands.javadoc instead.'
0
       Commands.java(*args, &block)
0
     end
0
 
0
     # *Deprecated*: Use Java::Commands.apt instead.
0
     def apt(*args)
0
- warn_deprecated 'Use Java::Commands.javadoc instead.'
0
+ Buildr.application.deprecated 'Use Java::Commands.javadoc instead.'
0
       Commands.apt(*args)
0
     end
0
 
0
     # *Deprecated*: Use Java::Commands.javac instead.
0
     def javac(*args)
0
- warn_deprecated 'Use Java::Commands.javadoc instead.'
0
+ Buildr.application.deprecated 'Use Java::Commands.javadoc instead.'
0
       Commands.javac(*args)
0
     end
0
 
0
     # *Deprecated*: Use Java::Commands.javadoc instead.
0
     def javadoc(*args)
0
- warn_deprecated 'Use Java::Commands.javadoc instead.'
0
+ Buildr.application.deprecated 'Use Java::Commands.javadoc instead.'
0
       Commands.javadoc(*args)
0
     end
0
 
0
     # *Deprecated:* Use ENV_JAVA['java.version'] instead.
0
     def version
0
- warn_deprecated 'Use ENV_JAVA[\'java.version\'] instead.'
0
+ Buildr.application.deprecated 'Use ENV_JAVA[\'java.version\'] instead.'
0
       Java.load
0
       ENV_JAVA['java.version']
0
     end
0
 
0
     # *Deprecated:* Use ENV['JAVA_HOME'] instead
0
     def home
0
- warn_deprecated 'Use ENV[\'JAVA_HOME\'] instead.'
0
+ Buildr.application.deprecated 'Use ENV[\'JAVA_HOME\'] instead.'
0
       ENV['JAVA_HOME']
0
     end
0
 
0
@@ -108,7 +108,7 @@
0
     # and installs various dependencies that are required on the classpath before calling
0
     # any Java code (e.g. Ant and its tasks).
0
     def wrapper
0
- warn_deprecated 'See documentation for new way to access Java code.'
0
+ Buildr.application.deprecated 'See documentation for new way to access Java code.'
0
       if block_given?
0
         Java.load
0
         yield JavaWrapper.instance
0
0
@@ -126,13 +126,13 @@
0
 
0
     # *Deprecated:* Use ENV['JAVA_OPTS'] instead.
0
     def java_args
0
- warn_deprecated "Use ENV['JAVA_OPTS'] instead"
0
+ Buildr.application.deprecated "Use ENV['JAVA_OPTS'] instead"
0
       (ENV["JAVA_OPTS"] || ENV["JAVA_OPTIONS"]).to_s.split
0
     end
0
 
0
     # *Deprecated:* Use ENV['JAVA_OPTS'] instead.
0
     def java_args=(args)
0
- warn_deprecated "Use ENV['JAVA_OPTS'] instead"
0
+ Buildr.application.deprecated "Use ENV['JAVA_OPTS'] instead"
0
       ENV['JAVA_OPTS'] = Array(args).join(' ')
0
     end
0
 
...
163
164
165
166
 
167
168
169
...
406
407
408
409
 
410
411
412
...
163
164
165
 
166
167
168
169
...
406
407
408
 
409
410
411
412
0
@@ -163,7 +163,7 @@
0
 
0
       def in_directory(dir)
0
         prefix = Regexp.new('^' + Regexp.escape(File.dirname(dir) + File::SEPARATOR))
0
- FileList.recursive(dir).reject { |file| excluded?(file) }.
0
+ Util.recursive_with_dot_files(dir).reject { |file| excluded?(file) }.
0
           each { |file| yield file, file.sub(prefix, '') }
0
       end
0
 
0
@@ -406,7 +406,7 @@
0
       # coming from, since some tasks touch the directory, e.g. when the
0
       # content of target/classes is included into a WAR.
0
       most_recent = @paths.collect { |name, path| path.sources }.flatten.
0
- each { |src| File.directory?(src) ? FileList.recursive(src) | [src] : src }.flatten.
0
+ each { |src| File.directory?(src) ? Util.recursive_with_dot_files(src) | [src] : src }.flatten.
0
         select { |file| File.exist?(file) }.collect { |file| File.stat(file).mtime }.max
0
       File.stat(name).mtime < (most_recent || Rake::EARLY) || super
0
     end
...
23
24
25
26
 
27
28
29
30
31
...
32
33
34
35
 
36
37
38
39
40
41
 
42
43
44
45
46
47
 
48
49
50
51
...
52
53
54
55
 
56
57
58
59
60
61
62
 
63
64
65
66
...
71
72
73
74
 
75
76
77
78
 
79
80
81
...
23
24
25
 
26
27
28
29
30
31
...
32
33
34
 
35
36
37
38
39
40
 
41
42
43
44
45
46
 
47
48
49
50
51
...
52
53
54
 
55
56
57
58
59
60
61
 
62
63
64
65
66
...
71
72
73
 
74
75
76
77
 
78
79
80
81
0
@@ -23,7 +23,7 @@
0
 
0
   desc 'Check that source files contain the Apache license'
0
   task 'license' do
0
- say 'Checking that files contain the Apache license ... '
0
+ print 'Checking that files contain the Apache license ... '
0
     excluded = ['.class', '.png', '.jar', '.tif', 'README', 'LICENSE', 'CHANGELOG', 'DISCLAIMER', 'NOTICE', 'KEYS']
0
     required = FileList[spec.files].exclude(*excluded).exclude(*Array($license_excluded)).select { |fn| File.file?(fn) }
0
     missing = required.reject { |fn|
0
0
0
@@ -32,19 +32,19 @@
0
       comments =~ /Licensed to the Apache Software Foundation/ && comments =~ /http:\/\/www.apache.org\/licenses\/LICENSE-2.0/
0
     }
0
     fail "#{missing.join(', ')} missing Apache License, please add it before making a release!" unless missing.empty?
0
- say 'OK'
0
+ puts 'OK'
0
   end
0
 
0
   file 'incubating'=>'package' do
0
     rm_rf 'incubating'
0
     mkpath 'incubating'
0
- say 'Creating -incubating packages ... '
0
+ print 'Creating -incubating packages ... '
0
     packages = FileList['pkg/*.{gem,zip,tgz}'].map do |package|
0
       package.pathmap('incubating/%n-incubating%x').tap do |incubating|
0
         cp package, incubating
0
       end
0
     end
0
- say 'Done'
0
+ puts 'Done'
0
   end
0
 
0
   task 'sign', :incubating do |task, args|
0
0
@@ -52,14 +52,14 @@
0
     sources = FileList[args.incubating ? 'incubating/*' : 'pkg/*']
0
 
0
     gpg_user = ENV['GPG_USER'] or fail 'Please set GPG_USER (--local-user) environment variable so we know which key to use.'
0
- say 'Signing release files ...'
0
+ print 'Signing release files ...'
0
     sources.each do |fn|
0
       contents = File.open(fn, 'rb') { |file| file.read }
0
       File.open(fn + '.md5', 'w') { |file| file.write MD5.hexdigest(contents) << ' ' << File.basename(fn) }
0
       File.open(fn + '.sha1', 'w') { |file| file.write SHA1.hexdigest(contents) << ' ' << File.basename(fn) }
0
       sh 'gpg', '--local-user', gpg_user, '--armor', '--output', fn + '.asc', '--detach-sig', fn, :verbose=>true
0
     end
0
- say 'Done'
0
+ puts 'Done'
0
   end
0
 
0
   task 'upload', :project, :incubating, :depends=>['site', 'KEYS', 'sign'] do |task, args|
0
0
@@ -71,11 +71,11 @@
0
 
0
     dir = task('sign').prerequisite.find { |prereq| File.directory?(prereq.name) }
0
     fail 'Please enhance sign task with directory containing files to release' unless dir
0
- say 'Uploading packages to Apache dist ...'
0
+ puts 'Uploading packages to Apache dist ...'
0
     args = FileList["#{dir}/*", 'KEYS'].flatten << target
0
     
0
     sh 'rsync', '-progress', *args
0
- say 'Done'
0
+ puts 'Done'
0
   end
0
 
0
 end