buildr 1.3.5 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. data/CHANGELOG +153 -8
  2. data/README.rdoc +1 -1
  3. data/addon/buildr/antlr.rb +5 -5
  4. data/addon/buildr/drb.rb +18 -18
  5. data/addon/buildr/hibernate.rb +18 -14
  6. data/addon/buildr/javacc.rb +4 -4
  7. data/addon/buildr/jetty.rb +5 -5
  8. data/addon/buildr/nailgun.rb +23 -23
  9. data/addon/buildr/openjpa.rb +1 -1
  10. data/addon/buildr/org/apache/buildr/BuildrNail$Main.class +0 -0
  11. data/addon/buildr/org/apache/buildr/BuildrNail.class +0 -0
  12. data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
  13. data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
  14. data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
  15. data/addon/buildr/protobuf.rb +75 -0
  16. data/addon/buildr/xmlbeans.rb +5 -5
  17. data/buildr.buildfile +2 -2
  18. data/buildr.gemspec +8 -7
  19. data/doc/_layouts/default.html +2 -2
  20. data/doc/artifacts.textile +4 -4
  21. data/doc/building.textile +35 -3
  22. data/doc/contributing.textile +5 -0
  23. data/doc/download.textile +16 -5
  24. data/doc/extending.textile +38 -12
  25. data/doc/installing.textile +6 -5
  26. data/doc/languages.textile +182 -42
  27. data/doc/more_stuff.textile +2 -2
  28. data/doc/packaging.textile +14 -15
  29. data/doc/projects.textile +7 -2
  30. data/doc/quick_start.textile +4 -4
  31. data/doc/scripts/buildr-git.rb +63 -63
  32. data/doc/scripts/gitflow.rb +21 -21
  33. data/doc/settings_profiles.textile +9 -2
  34. data/doc/testing.textile +16 -5
  35. data/etc/KEYS +38 -0
  36. data/lib/buildr/core/application.rb +33 -27
  37. data/lib/buildr/core/build.rb +41 -28
  38. data/lib/buildr/core/cc.rb +172 -0
  39. data/lib/buildr/core/checks.rb +1 -1
  40. data/lib/buildr/core/common.rb +7 -6
  41. data/lib/buildr/core/compile.rb +7 -8
  42. data/lib/buildr/core/doc.rb +263 -0
  43. data/lib/buildr/core/environment.rb +6 -6
  44. data/lib/buildr/core/filter.rb +77 -35
  45. data/lib/buildr/core/generate.rb +7 -7
  46. data/lib/buildr/core/help.rb +1 -1
  47. data/lib/buildr/core/osx.rb +6 -6
  48. data/lib/buildr/core/progressbar.rb +4 -4
  49. data/lib/buildr/core/project.rb +144 -36
  50. data/lib/buildr/core/shell.rb +34 -34
  51. data/lib/buildr/core/test.rb +89 -20
  52. data/lib/buildr/core/transports.rb +8 -7
  53. data/lib/buildr/core/util.rb +77 -23
  54. data/lib/buildr/core.rb +1 -0
  55. data/lib/buildr/groovy/bdd.rb +5 -5
  56. data/lib/buildr/groovy/compiler.rb +19 -15
  57. data/lib/buildr/groovy/shell.rb +6 -6
  58. data/lib/buildr/ide/eclipse/java.rb +3 -3
  59. data/lib/buildr/ide/eclipse/plugin.rb +8 -5
  60. data/lib/buildr/ide/eclipse/scala.rb +4 -2
  61. data/lib/buildr/ide/eclipse.rb +148 -75
  62. data/lib/buildr/ide/idea.rb +2 -2
  63. data/lib/buildr/ide/idea7x.rb +23 -4
  64. data/lib/buildr/java/ant.rb +4 -4
  65. data/lib/buildr/java/bdd.rb +51 -54
  66. data/lib/buildr/java/cobertura.rb +57 -35
  67. data/lib/buildr/java/commands.rb +14 -5
  68. data/lib/buildr/java/compiler.rb +3 -217
  69. data/lib/buildr/java/deprecated.rb +4 -4
  70. data/lib/buildr/java/doc.rb +70 -0
  71. data/lib/buildr/java/emma.rb +22 -22
  72. data/lib/buildr/java/jruby.rb +4 -4
  73. data/lib/buildr/java/jtestr_runner.rb.erb +27 -25
  74. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  75. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +8 -3
  76. data/lib/buildr/java/packaging.rb +30 -29
  77. data/lib/buildr/java/pom.rb +4 -4
  78. data/lib/buildr/java/rjb.rb +6 -6
  79. data/lib/buildr/java/test_result.rb +61 -85
  80. data/lib/buildr/java/tests.rb +44 -27
  81. data/lib/buildr/java/version_requirement.rb +8 -8
  82. data/lib/buildr/java.rb +1 -0
  83. data/lib/buildr/packaging/archive.rb +55 -22
  84. data/lib/buildr/packaging/artifact.rb +75 -36
  85. data/lib/buildr/packaging/artifact_namespace.rb +90 -78
  86. data/lib/buildr/packaging/artifact_search.rb +5 -5
  87. data/lib/buildr/packaging/gems.rb +11 -7
  88. data/lib/buildr/packaging/package.rb +10 -7
  89. data/lib/buildr/packaging/tar.rb +14 -14
  90. data/lib/buildr/packaging/version_requirement.rb +30 -10
  91. data/lib/buildr/packaging/ziptask.rb +51 -13
  92. data/lib/buildr/scala/bdd.rb +25 -20
  93. data/lib/buildr/scala/compiler.rb +87 -40
  94. data/lib/buildr/scala/doc.rb +106 -0
  95. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
  96. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java +57 -0
  97. data/lib/buildr/scala/shell.rb +14 -9
  98. data/lib/buildr/scala/tests.rb +33 -26
  99. data/lib/buildr/scala.rb +1 -0
  100. data/lib/buildr/shell.rb +33 -33
  101. data/lib/buildr.rb +1 -1
  102. data/rakelib/all-in-one.rake +113 -0
  103. data/rakelib/checks.rake +1 -1
  104. data/rakelib/doc.rake +7 -0
  105. data/rakelib/package.rake +1 -1
  106. data/rakelib/release.rake +9 -6
  107. data/rakelib/rspec.rake +26 -7
  108. data/rakelib/setup.rake +15 -3
  109. data/rakelib/stage.rake +18 -11
  110. data/spec/addon/drb_spec.rb +25 -25
  111. data/spec/core/application_spec.rb +111 -21
  112. data/spec/core/build_spec.rb +16 -15
  113. data/spec/core/cc_spec.rb +174 -0
  114. data/spec/core/checks_spec.rb +34 -34
  115. data/spec/core/common_spec.rb +51 -5
  116. data/spec/core/compile_spec.rb +89 -14
  117. data/spec/core/extension_spec.rb +127 -19
  118. data/spec/core/generate_spec.rb +2 -2
  119. data/spec/core/project_spec.rb +10 -10
  120. data/spec/core/test_spec.rb +144 -35
  121. data/spec/core/transport_spec.rb +8 -8
  122. data/spec/core/util_spec.rb +63 -5
  123. data/spec/groovy/bdd_spec.rb +5 -5
  124. data/spec/groovy/compiler_spec.rb +29 -18
  125. data/spec/ide/eclipse_spec.rb +185 -9
  126. data/spec/ide/idea7x_spec.rb +22 -10
  127. data/spec/java/ant_spec.rb +9 -5
  128. data/spec/java/bdd_spec.rb +29 -37
  129. data/spec/java/cobertura_spec.rb +12 -12
  130. data/spec/java/commands_spec.rb +34 -0
  131. data/spec/java/compiler_spec.rb +53 -53
  132. data/spec/java/emma_spec.rb +11 -11
  133. data/spec/java/java_spec.rb +10 -10
  134. data/spec/java/packaging_spec.rb +67 -20
  135. data/spec/java/test_coverage_helper.rb +18 -18
  136. data/spec/java/tests_spec.rb +13 -9
  137. data/spec/packaging/archive_spec.rb +187 -20
  138. data/spec/packaging/artifact_namespace_spec.rb +172 -83
  139. data/spec/packaging/artifact_spec.rb +83 -18
  140. data/spec/packaging/packaging_spec.rb +41 -14
  141. data/spec/sandbox.rb +23 -12
  142. data/spec/scala/bdd_spec.rb +13 -8
  143. data/spec/scala/compiler_spec.rb +18 -13
  144. data/spec/scala/scala.rb +3 -3
  145. data/spec/scala/tests_spec.rb +46 -24
  146. data/spec/spec_helpers.rb +28 -10
  147. data/spec/version_requirement_spec.rb +25 -11
  148. metadata +149 -133
  149. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner$.class +0 -0
  150. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.scala +0 -35
  151. data/rakelib/stage.rake~ +0 -213
@@ -29,7 +29,7 @@
29
29
  # git apache setup svn --help
30
30
  # git apache sync --help
31
31
  #
32
- # To configure your local repo for svn synchronization,
32
+ # To configure your local repo for svn synchronization,
33
33
  #
34
34
  # git apache update-authors
35
35
  # git remote add upstream git@github.com:buildr/buildr.git
@@ -77,11 +77,11 @@ module BuildrGit
77
77
  def options(opts)
78
78
  opts.url = @@url
79
79
  opts.file = self.class.authors_file
80
- [['-u', '--url URL',
80
+ [['-u', '--url URL',
81
81
  "From URL. defaults to: #{opts.url}", lambda { |url|
82
82
  opts.url = url
83
83
  }],
84
- ['-f', '--file FILE',
84
+ ['-f', '--file FILE',
85
85
  "Write to FILE, defaults to #{opts.file}", lambda { |path|
86
86
  opts.file = path
87
87
  }]
@@ -97,7 +97,7 @@ module BuildrGit
97
97
 
98
98
  class CloneCommand < GitFlow/:clone
99
99
  @help = "Create a clone from github.com/buildr repository."
100
-
100
+
101
101
  def options(opts)
102
102
  opts.origin = 'git://github.com/buildr/buildr.git'
103
103
  opts.svn_prefix = 'apache'
@@ -113,7 +113,7 @@ module BuildrGit
113
113
 
114
114
  def execute(opts, argv)
115
115
  git 'clone', opts.origin, opts.local
116
- Dir.chdir(opts.local) do
116
+ Dir.chdir(opts.local) do
117
117
  run 'update-users'
118
118
  run 'setup'
119
119
  end
@@ -125,7 +125,7 @@ module BuildrGit
125
125
  def options(opt)
126
126
  []
127
127
  end
128
-
128
+
129
129
  def execute(opt, argv)
130
130
  run 'setup', 'alias'
131
131
  run 'setup', 'svn'
@@ -146,10 +146,10 @@ module BuildrGit
146
146
  opt.svn_prefix = 'apache'
147
147
  opt.svn_path = 'buildr'
148
148
  opt.townhall = 'origin'
149
- [['--username SVN_USER', 'Use Apache svn username for this svn remote',
149
+ [['--username SVN_USER', 'Use Apache svn username for this svn remote',
150
150
  lambda { |e| opt.apache_login = e }],
151
151
  ['--svn-prefix PREFIX', 'The name of svn remote to use for project.',
152
- "Defaults to #{opt.svn_prefix}",
152
+ "Defaults to #{opt.svn_prefix}",
153
153
  lambda{|p| opt.svn_prefix = p }],
154
154
  ['--svn-uri URI', lambda {|p| opt.svn_uri = p }],
155
155
  ['--svn-rev REVISION', lambda {|p| opt.svn_rev = p }],
@@ -166,21 +166,21 @@ module BuildrGit
166
166
  git 'config', 'svn.authorsfile', authors_file
167
167
  git 'config', 'apache.svn', opt.svn_prefix
168
168
  git 'config', 'apache.git', opt.townhall
169
-
169
+
170
170
  if opt.apache_login
171
171
  user, email = UpdateUsersCommand.user_email(opt.apache_login, authors_file)
172
172
  puts "You claim to be #{user} <#{email}> with apache login: #{opt.apache_login}"
173
173
  git('config', 'user.name', user)
174
174
  git('config', 'user.email', email)
175
175
  end
176
-
176
+
177
177
  if opt.svn_rev
178
178
  revision = opt.svn_rev
179
179
  else
180
180
  location, revision = svn_loc_rev
181
181
  revision = opt.svn_rev || revision
182
182
  end
183
-
183
+
184
184
  if opt.svn_uri
185
185
  repo = opt.svn_uri
186
186
  else
@@ -189,13 +189,13 @@ module BuildrGit
189
189
  repo = $`
190
190
  end
191
191
 
192
- # Tell git where the svn repository is
192
+ # Tell git where the svn repository is
193
193
  git('config', "svn-remote.#{opt.svn_prefix}.url", repo)
194
194
  git('config', "svn-remote.#{opt.svn_prefix}.fetch",
195
195
  "#{opt.svn_path}/trunk:refs/remotes/#{opt.svn_prefix}/trunk")
196
- git('config', "svn-remote.#{opt.svn_prefix}.branches",
196
+ git('config', "svn-remote.#{opt.svn_prefix}.branches",
197
197
  "#{opt.svn_path}/branches/*:refs/remotes/#{opt.svn_prefix}/*")
198
- git('config', "svn-remote.#{opt.svn_prefix}.tags",
198
+ git('config', "svn-remote.#{opt.svn_prefix}.tags",
199
199
  "#{opt.svn_path}/tags/*:refs/remotes/#{opt.svn_prefix}/tags/*")
200
200
 
201
201
  # Store the user for svn dcommit
@@ -214,9 +214,9 @@ module BuildrGit
214
214
  # update svn metadata
215
215
  mkdir_p(expand_path('.git/svn'))
216
216
  svn_meta = expand_path('.git/svn/.metadata')
217
- git('config', '--file', svn_meta,
217
+ git('config', '--file', svn_meta,
218
218
  "svn-remote.#{opt.svn_prefix}.branches-maxRev", revision)
219
- git('config', '--file', svn_meta,
219
+ git('config', '--file', svn_meta,
220
220
  "svn-remote.#{opt.svn_prefix}.tags-maxRev", revision)
221
221
  end
222
222
 
@@ -255,18 +255,18 @@ apache.svn - The svn remote using to get changes from Apache SVN.
255
255
  class SyncCommand < GitFlow/:sync
256
256
  @help = "Synchronizes between Apache svn and git townhall."
257
257
  @documentation = <<-DOC
258
- This command will perform the following actions:
258
+ This command will perform the following actions:
259
259
  * fetch changes from apache svn.
260
260
  * rebase them on the current branch or on the one specified with --onto
261
261
  * dcommit (this will push your changes to Apache trunk)
262
262
 
263
263
  GIT CONFIG VALUES:
264
264
 
265
- apache.svn
265
+ apache.svn
266
266
  The svn remote using to get changes from Apache SVN.
267
267
  Set by setup-svn --svn-prefix.
268
268
 
269
- apache.git
269
+ apache.git
270
270
  The git remote used as townhall repository.
271
271
  Set by setup-svn --townhall.
272
272
 
@@ -281,7 +281,7 @@ DOC
281
281
  opt.git_branch = 'master'
282
282
  opt.apache_git = git('config', '--get', 'apache.git').chomp rescue nil
283
283
  opt.apache_svn = git('config', '--get', 'apache.svn').chomp rescue nil
284
- opt.svn_username = git('config', '--get',
284
+ opt.svn_username = git('config', '--get',
285
285
  "svn-remote.#{opt.apache_svn}.username").chomp rescue nil
286
286
  [['--apache-svn SVN_REMOTE', 'The SVN remote used to get changes from Apache',
287
287
  "Current value: #{opt.apache_svn}",
@@ -289,15 +289,15 @@ DOC
289
289
  ['--apache-git REMOTE', 'The git remote used as town-hall repository.',
290
290
  "Current value: #{opt.apache_git}",
291
291
  lambda { |r| opt.apache_git = r }],
292
- ['--username SVN_USER',
292
+ ['--username SVN_USER',
293
293
  'Specify the SVN username for dcommit',
294
294
  "Defaults to: #{opt.svn_username}",
295
295
  lambda { |b| opt.svn_username = b }],
296
296
  ['--svn-branch SVN_BRANCH',
297
- 'Specify the SVN branch to rebase changes from, and where to dcommit',
297
+ 'Specify the SVN branch to rebase changes from, and where to dcommit',
298
298
  "Defaults to: #{opt.svn_branch}",
299
299
  lambda { |b| opt.svn_branch = b }],
300
- ['--git-branch REMOTE_BRANCH',
300
+ ['--git-branch REMOTE_BRANCH',
301
301
  'Specify the remote town-hall branch (on apache.git) to update',
302
302
  "Defaults to: #{opt.git_branch}",
303
303
  lambda { |b| opt.git_branch = b }],
@@ -318,29 +318,29 @@ DOC
318
318
  # obtain latest changes from svn
319
319
  git('svn', 'fetch', '--svn-remote', opt.apache_svn)
320
320
  # obtain latest changes from git
321
- git('fetch', opt.apache_git,
321
+ git('fetch', opt.apache_git,
322
322
  "#{opt.git_branch}:refs/remotes/#{opt.apache_git}/#{opt.git_branch}")
323
323
 
324
324
  # rebase svn changes in the desired branch
325
325
  git('rebase', "#{opt.apache_svn}/#{opt.svn_branch}", opt.branch)
326
326
  git('rebase', "#{opt.apache_git}/#{opt.git_branch}", opt.branch)
327
-
327
+
328
328
  # dcommit to the specific svn branch
329
- ['svn', 'dcommit',
329
+ ['svn', 'dcommit',
330
330
  '--svn-remote', opt.apache_svn, '--commit-url', commit_url].tap do |cmd|
331
331
  if opt.svn_username
332
332
  cmd << '--username' << opt.svn_username
333
333
  end
334
334
  git(*cmd)
335
335
  end
336
-
336
+
337
337
  # update townhall remote ref
338
- git('update-ref',
338
+ git('update-ref',
339
339
  "refs/remotes/#{opt.apache_git}/#{opt.git_branch}",
340
340
  "refs/remotes/#{opt.apache_svn}/#{opt.svn_branch}")
341
341
 
342
342
  # forward the remote townhall/master to apache/trunk
343
- git('push', opt.apache_git,
343
+ git('push', opt.apache_git,
344
344
  "refs/remotes/#{opt.apache_git}/#{opt.git_branch}:#{opt.git_branch}")
345
345
 
346
346
  # get back to the original branch
@@ -349,7 +349,7 @@ DOC
349
349
  end
350
350
 
351
351
 
352
- # This one is displayed when the user executes this script using
352
+ # This one is displayed when the user executes this script using
353
353
  # open-uri -e
354
354
  HEADER = <<HEADER
355
355
 
@@ -364,8 +364,8 @@ and recommended workflow, or any other option.
364
364
 
365
365
  Ctrl+D or an invalid option to abort
366
366
  HEADER
367
-
368
- # When fork is completed, we display the following notice on a
367
+
368
+ # When fork is completed, we display the following notice on a
369
369
  # pager, giving the user a brief overview of git aliases used
370
370
  # to keep the mirror in sync.
371
371
  NOTICE = <<NOTICE
@@ -381,27 +381,27 @@ ALIASES:
381
381
 
382
382
  git apache merge # Merge already fetched changes on the current branch
383
383
  # Use this command to get up to date with trunk changes
384
- # you can always cherry-pick from the apache/trunk
384
+ # you can always cherry-pick from the apache/trunk
385
385
  # branch.
386
386
 
387
387
  git apache pull # get apache-fetch && git apache-merge
388
-
389
- git apache push # Push to Apache's SVN. Only staged changes (those
390
- # recorded using `git commit`) will be sent to SVN.
388
+
389
+ git apache push # Push to Apache's SVN. Only staged changes (those
390
+ # recorded using `git commit`) will be sent to SVN.
391
391
  # You need not to be on the master branch.
392
392
  # Actually you can work on a tiny-feature branch and
393
- # commit directly from it.
393
+ # commit directly from it.
394
394
  #
395
- # VERY IMPORTANT:
395
+ # VERY IMPORTANT:
396
396
  #
397
397
  # Missing commits on Apache's SVN will be sent using
398
398
  # your apache svn account. This means that you can
399
399
  # make some commits on behalf of others (like patches
400
400
  # comming from JIRA issues or casual contributors)
401
- # Review the apache-push alias on .git/config if you
401
+ # Review the apache-push alias on .git/config if you
402
402
  # want to change login-name used for commit to SVN.
403
- #
404
- # See the recommended workflow to avoid commiting
403
+ #
404
+ # See the recommended workflow to avoid commiting
405
405
  # other developers' changes and the following section.
406
406
 
407
407
  THE GITHUB MIRROR:
@@ -410,11 +410,11 @@ THE GITHUB MIRROR:
410
410
 
411
411
  http://github.com/buildr/buildr
412
412
 
413
- This mirror DOES NOT replace Apache's SVN repository. We really care about
414
- using Apache infrastructure and following Apache project guidelines for
413
+ This mirror DOES NOT replace Apache's SVN repository. We really care about
414
+ using Apache infrastructure and following Apache project guidelines for
415
415
  contributions. This git mirror is provided only for developers convenience,
416
416
  allowing them to easily create experimental branches or review code from
417
- other committers.
417
+ other committers.
418
418
 
419
419
  All code that wants to make it to the official Apache Buildr repository needs
420
420
  to be committed to the Apache SVN repository by using the command:
@@ -423,39 +423,39 @@ THE GITHUB MIRROR:
423
423
 
424
424
  This command will synchronize both ways svn<->git to keep trunk upto date.
425
425
  You need to be an Apache committer and have permissions on the SVN repo.
426
-
426
+
427
427
  It's VERY IMPORTANT for Buildr committers to remember that contributions from
428
428
  external entities wanting to be accepted will require them to sign the Apache ICLA.
429
- We provide the git mirror to make it easier for people to experiment and
429
+ We provide the git mirror to make it easier for people to experiment and
430
430
  contribute back to Buildr, before merging their code in, please remember they
431
- have to create create a JIRA issue granting ASF permission to include their code,
431
+ have to create create a JIRA issue granting ASF permission to include their code,
432
432
  just like any other contribution following Apache's guidelines.
433
433
 
434
- So, it's very important - if you care about meritocracy - to follow or at
434
+ So, it's very important - if you care about meritocracy - to follow or at
435
435
  least that you get an idea of the recommended workflow.
436
436
 
437
437
  RECOMMENDED WORKFLOW:
438
-
439
- So now that you have your local buildr copy you can create topic branches
440
- to work on independent features, and still merge easily with head changes.
438
+
439
+ So now that you have your local buildr copy you can create topic branches
440
+ to work on independent features, and still merge easily with head changes.
441
441
 
442
442
  They may seem lots of things to consider, but it's all for Buildr's healt.
443
443
  As all things git, you can always follow your own workflow and even create
444
444
  aliases on you .git/config file to avoid typing much. So, here they are:
445
445
 
446
- 1) get your gitflow configured
446
+ 1) get your gitflow configured
447
447
  (you have already do so, this was the most difficult part)
448
448
 
449
449
  2) create a topic branch to work on, say.. you want to add cool-feature:
450
450
 
451
- git checkout -b cool-feature master
451
+ git checkout -b cool-feature master
452
452
  # now on branch cool-feature
453
453
 
454
454
  3) hack hack hack.. use the source luke.
455
- every time you feel you have something important like added failing
455
+ every time you feel you have something important like added failing
456
456
  spec, added part of feature, or resolved some conflict from merges,
457
- you can commit your current progress. If you want to be selective, use:
458
-
457
+ you can commit your current progress. If you want to be selective, use:
458
+
459
459
  git commit --interactive
460
460
 
461
461
  3) review your changes, get ALL specs passing, repeat step 3 as needed
@@ -465,12 +465,12 @@ RECOMMENDED WORKFLOW:
465
465
  git apache-fetch
466
466
  # You can inspect the upstream changes without having to merge them
467
467
  git log apache/trunk # what are they doing!!
468
-
468
+
469
469
  5) integrate mainstream changes to your cool-feature branch, you can always
470
470
  use `git cherry-pick` to select only some commits.
471
471
 
472
472
  git merge apache/trunk cool-feature
473
-
473
+
474
474
  6) Go to 3 unless ALL specs are passing.
475
475
 
476
476
  7.a) (Skip to 7.b you have commit bit on Apache's SVN)
@@ -481,19 +481,19 @@ RECOMMENDED WORKFLOW:
481
481
  https://issues.apache.org/jira/browse/BUILDR
482
482
  dev@buildr.apache.org
483
483
 
484
- 7.b) Now you have everyhing on staging area and merged important changes
484
+ 7.b) Now you have everyhing on staging area and merged important changes
485
485
  from apache/trunk, it's time to commit them to Apache's SVN.
486
486
 
487
- git apache-push
487
+ git apache-push
488
488
 
489
489
  8) Optional. If you are a buildr committer you may want to synchronize
490
- the github mirror for helping others to get changes without having to
490
+ the github mirror for helping others to get changes without having to
491
491
  wait on Victor's cronjob to run every hour (useful for urgent changes).
492
492
 
493
493
  git synchronize
494
494
 
495
495
  9) Pull changes from origin frequently.
496
-
496
+
497
497
  git fetch origin
498
498
  git rebase --onto origin/master master master
499
499
 
@@ -508,5 +508,5 @@ RESOURCES:
508
508
 
509
509
  NOTICE
510
510
  #' for emacs
511
-
511
+
512
512
  end
@@ -20,7 +20,7 @@ require 'fileutils'
20
20
 
21
21
  module GitFlow
22
22
  extend self
23
-
23
+
24
24
  attr_accessor :should_run, :trace, :program
25
25
 
26
26
  self.program = 'gitflow'
@@ -34,7 +34,7 @@ It is generic enougth to be used on any git based project besides Apache Buildr.
34
34
  OVERVIEW:
35
35
 
36
36
  gitflow is intended to help developers with their daily git workflow,
37
- performing repetitive git commands for them. It is implemented in
37
+ performing repetitive git commands for them. It is implemented in
38
38
  ruby so you can do anything, from invoking rake tasks to telling
39
39
  people on twitter you are having trouble with their code :P.
40
40
 
@@ -53,7 +53,7 @@ After that you can use
53
53
 
54
54
  EXTENDING YOUR WORKFLOW:
55
55
 
56
- You can create your own gitflow commands, to adapt your development
56
+ You can create your own gitflow commands, to adapt your development
57
57
  workflow.
58
58
 
59
59
  Simply create a ruby script somewhere say ~/.buildr/gitflow.rb
@@ -66,17 +66,17 @@ A sample command would look like this.. (you may want to look at buildr-git.rb)
66
66
 
67
67
  #!/usr/bin/env ruby
68
68
  require /path/to/gitflow.rb
69
-
69
+
70
70
  class MyCommand < GitFlow/'my-flow'
71
-
71
+
72
72
  @help = "Summary to be displayed when listing commands"
73
73
  @documentation = "Very long help that will be paged if necessary. (for --help)"
74
-
74
+
75
75
  # takes an openstruct to place default values and option values.
76
76
  # returns an array of arguments given to optparse.on
77
77
  def options(opts)
78
78
  opts.something = 'default'
79
- [
79
+ [
80
80
  ['--name NAME', lambda { |n| opts.name = n }],
81
81
  ['--yes', lambda { |n| opts.yes = true }]
82
82
  ]
@@ -94,7 +94,7 @@ A sample command would look like this.. (you may want to look at buildr-git.rb)
94
94
  class SubCommand < MyCommand/'sub-work'
95
95
  ... # implement a subcommand
96
96
  end
97
-
97
+
98
98
  end
99
99
 
100
100
  You would then get help for your command with
@@ -203,26 +203,26 @@ HELP
203
203
 
204
204
  # Override this method in your command class if it
205
205
  # needs to parse command line options.
206
- #
206
+ #
207
207
  # This method takes an openstruct object as argument
208
- # allowing you to store default values on it, and
208
+ # allowing you to store default values on it, and
209
209
  # set option values.
210
210
  #
211
- # The return value must be an array of arguments
211
+ # The return value must be an array of arguments
212
212
  # given to optparse.on
213
213
  def options(opt)
214
214
  []
215
215
  end
216
-
216
+
217
217
  # Override this method in your command class to implement
218
218
  # the command.
219
219
  # First argument is the openstruct object after
220
- # it has been populated by the option parser.
220
+ # it has been populated by the option parser.
221
221
  # Second argument is the array of non-option arguments.
222
222
  def execute(opt, argv)
223
223
  fail "#{self.class.command} not implemented"
224
224
  end
225
-
225
+
226
226
  # Run the command line given on argv
227
227
  def run(*argv, &block)
228
228
  GitFlow.run(*argv, &block)
@@ -233,11 +233,11 @@ HELP
233
233
  GitFlow.pager
234
234
  yield
235
235
  end
236
-
236
+
237
237
  def trace(*str)
238
238
  STDERR.puts(*str) if GitFlow.trace
239
239
  end
240
-
240
+
241
241
  def git(*args)
242
242
  cmd = 'git ' + args.map { |arg| arg[' '] ? %Q{"#{arg}"} : arg }.join(' ')
243
243
  trace cmd
@@ -245,13 +245,13 @@ HELP
245
245
  fail "GIT command `#{cmd}` failed with status #{$?.exitstatus}" unless $?.exitstatus == 0
246
246
  }
247
247
  end
248
-
248
+
249
249
  def sh(*args)
250
250
  `#{args.join(' ')}`.tap {
251
251
  fail "Shell command `#{args.join(' ')}` failed with status #{$?.exitstatus}" unless $?.exitstatus == 0
252
252
  }
253
253
  end
254
-
254
+
255
255
  def expand_path(path, dir=Dir.pwd)
256
256
  File.expand_path(path, dir)
257
257
  end
@@ -259,7 +259,7 @@ HELP
259
259
 
260
260
  class NoSuchCommand < GitFlow/nil
261
261
  @documentation = HELP
262
-
262
+
263
263
  def execute(opts, argv)
264
264
  page do
265
265
  puts "Command not found: #{argv.join(' ').inspect}"
@@ -271,7 +271,7 @@ HELP
271
271
  class HelpCommand < GitFlow/:help
272
272
  @help = "Display help for a command or show command list"
273
273
  @documentation = "Displays help for the command given as argument"
274
-
274
+
275
275
  def execute(opts, argv)
276
276
  if argv.empty?
277
277
  opt = GitFlow.optparse
@@ -290,7 +290,7 @@ HELP
290
290
  end
291
291
  end
292
292
  end
293
-
293
+
294
294
  end
295
295
 
296
296
  at_exit { GitFlow.run(*ARGV) if GitFlow.should_run }
@@ -41,6 +41,7 @@ Buildr supports the following environment variables:
41
41
  | @HOME@ | Your home directory. |
42
42
  | @HTTP_PROXY@ | URL for HTTP proxy server (see "Specifying Repositories":artifacts.html#repositories). |
43
43
  | @HTTPS_PROXY@ | URL for HTTPS proxy server (see "Specifying Repositories":artifacts.html#repositories). |
44
+ | @IGNORE_BUILDFILE@ | Set to "true" or "yes" to ignore changes in Buildfile or its dependencies when running tests. |
44
45
  | @JAVA_HOME@ | Points to your JDK, required when using Java and Ant. |
45
46
  | @JAVA_OPTS@ | Command line options to pass to the JDK (e.g. @'-Xms1g'@). |
46
47
  | @M2_REPO@ | Location of the Maven2 local repository. Defaults to the @.m2@ directory in your home directory (@ENV['HOME']@). |
@@ -165,9 +166,9 @@ Build settings can be retreived using the @Buildr.settings.build@ accessor.
165
166
 
166
167
  h2(#variable). Non constant settings
167
168
 
168
- Before loading the Buildfile, Buildr will attempt to load two other files: the @buildr.rb@ file it finds in your home directory, followed by the @buildr.rb@ file it finds in the build directory.
169
+ Before loading the Buildfile, Buildr will attempt to load two other files: the @buildr.rb@ file in the @.buildr@ directory under your home directory, followed by the @buildr.rb@ file it finds in the build directory.
169
170
 
170
- The loading order allows you to place global settings that affect all your builds in your home directory's @buildr.rb@, but also over-ride those with settings for a given project.
171
+ The loading order allows you to place global settings that affect all your builds in your @buildr.rb@, but also over-ride those with settings for a given project.
171
172
 
172
173
  Here's an example @buildr.rb@:
173
174
 
@@ -179,6 +180,12 @@ repositories.upload_to[:password] = 'supersecret'
179
180
  repositories.remote << 'http://inside-the-firewall'
180
181
  {% endhighlight %}
181
182
 
183
+ p(note). Buildr 1.3 and earlier used the file @buildr.rb@ directly in your home directory. Starting with version 1.4, Buildr loads @buildr.rb@ from the @.buildr@ directory under your home directory in preference. If you use Buildr 1.3 and earlier and don't want to duplicate your settings, you can move you existing @buildr.rb@ under the @.buildr@ directory and create a new @buildr.rb@ in your home directory containing:
184
+
185
+ {% highlight ruby %}
186
+ # Backward compatibility: Buildr 1.4+ uses $HOME/.buildr/buildr.rb
187
+ load File.expand_path('buildr.rb', Buildr.application.home_dir)
188
+ {% endhighlight %}
182
189
 
183
190
  h2(#environments). Environments
184
191
 
data/doc/testing.textile CHANGED
@@ -4,7 +4,7 @@ title: Testing
4
4
  ---
5
5
 
6
6
 
7
- Untested code is broken code, so we take testing seriously. Off the bat you get to use either JUnit or TestNG for writing unit tests and integration tests. And you can also add your own framework, or even script tests using Ruby. But= first, let's start with the basics.
7
+ Untested code is broken code, so we take testing seriously. Off the bat you get to use either JUnit or TestNG for writing unit tests and integration tests. And you can also add your own framework, or even script tests using Ruby. But first, let's start with the basics.
8
8
 
9
9
 
10
10
  h2(#writing). Writing Tests
@@ -44,15 +44,15 @@ When tests fail, Buildr fails the @test@ task. This is usually a good thing, bu
44
44
  test.using :fail_on_failure=>false
45
45
  {% endhighlight %}
46
46
 
47
- Besides giving you a free pass to ignore failures, you can use it for other causes, for example, to be somewhat forgiving:
47
+ Besides giving you a free pass to ignore failures, you can use it for other causes, for example, as a gentle reminder:
48
48
 
49
49
  {% highlight ruby %}
50
50
  test do
51
- fail 'More than 3 tests failed!' if test.failed_tests.size > 3
51
+ warn "Did you forget something?" if test.tests.nil? || test.tests.empty?
52
52
  end
53
53
  {% endhighlight %}
54
54
 
55
- The @failed_tests@ collection holds the names of all classes with failed tests. And there's @classes@, which holds the names of all test classes. Ruby arithmetic allows you to get the name of all passed test classes with a simple @test.classes – test.failed_tests@. We'll let you imagine creative use for these two.
55
+ The @tests@ collection holds the names of all classes with tests, if any. And there's @classes@, which holds the names of all test classes. We'll let you imagine creative use for these two.
56
56
 
57
57
 
58
58
  h2(#running). Running Tests
@@ -106,6 +106,17 @@ $ buildr package test=all
106
106
 
107
107
  We're using @package@ and not @build@ above. When using a continuous build system, you want to make sure that packages are created, contain the right files, and also run the integration tests.
108
108
 
109
+ During development, if you want to re-run only tests that have failed during the last test execution, you can execute:
110
+
111
+ {% highlight sh %}
112
+ $ buildr test:failed
113
+ {% endhighlight %}
114
+
115
+ One last note on running tests. By default when you run tests, Buildr will automatically run all transitive test dependencies. This mean if you run "buildr test" inside project @bar@ and @bar@ depends on project @foo@, Buildr will first run tests in project @foo@ if there have been any changes affecting @foo@ that haven't been taken into account yet. This behavior often surprises people, especially when they are trying to get things done and only care about tests in @bar@ at that moment. For those times when you'd like to focus your testing on specific projects, Buildr has the @only@ option that will only run tests for projects specified on the command line,
116
+
117
+ {% highlight sh %}
118
+ $ buildr test=only bar:test
119
+ {% endhighlight %}
109
120
 
110
121
  h2(#integration). Integration Tests
111
122
 
@@ -170,7 +181,7 @@ end
170
181
  check package(:war).path('WEB-INF'), 'should contain files' do
171
182
  it.should_not be_empty
172
183
  end
173
- check package(:war).path('WEB-INF/classes'), 'should contain classes' do
184
+ check package(:war).path('WEB-INF/classes'), 'should contain classes' do
174
185
  it.should contain('**/*.class')
175
186
  end
176
187
  check package(:war).entry('META-INF/MANIFEST'), 'should have license' do
data/etc/KEYS CHANGED
@@ -149,3 +149,41 @@ Ajt5Ierk8kbjO9yM75Y2+84McRiR8JCld2WJFNXXwKCIWuh6+UtGPqafxHccKQYv
149
149
  QKtVPfIqp4oI8qSfsZ0gMafFRwCfTqvRMVFyLEnygWnhpxgJRYk+8Fc=
150
150
  =ryOG
151
151
  -----END PGP PUBLIC KEY BLOCK-----
152
+
153
+
154
+ pub 2048R/191DFA62 2010-03-15
155
+ uid Antoine Toulme <antoine@lunar-ocean.com>
156
+ sig 3 191DFA62 2010-03-15 Antoine Toulme <antoine@lunar-ocean.com>
157
+ sub 2048R/F82CCCA4 2010-03-15
158
+ sig 191DFA62 2010-03-15 Antoine Toulme <antoine@lunar-ocean.com>
159
+
160
+ -----BEGIN PGP PUBLIC KEY BLOCK-----
161
+ Version: GnuPG v1.4.10 (Darwin)
162
+
163
+ mQENBEud3FYBCACjGYLotue6+saF39/Yim+UrSnLgsM6hwPETpwOawQOKUuEd8/N
164
+ I07bCXI7HHgeBHQ0ENTWqH4hO1CoyKDsIChY37GYLZkx7KS8HVCxg/b6DNVp5vTi
165
+ oHm8XTGvdVzkvoKj4Se0T+jpTfVYoiq8CRY0jH3Wqxs8QGfVGVkVJ9hgz8UyJUyB
166
+ 7PidE0P4U/xmZ3lMzxWr9d1TabNjCQmtgRgoi8auX3VP0TXJbedPXPF3xuhbFSWl
167
+ LAZhujzZwefGvJk9XX1lsA2BnMvTBC9PJqCbfaRE+3/bl3Cwq8CtyOjJ4O9i1ie8
168
+ +exUX8RSitlP3uxMJoFR2z/qHeRTors5d1DfABEBAAG0KEFudG9pbmUgVG91bG1l
169
+ IDxhbnRvaW5lQGx1bmFyLW9jZWFuLmNvbT6JATgEEwECACIFAkud3FYCGwMGCwkI
170
+ BwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEO7QCd8ZHfpiNL4H/3oe0+MVB72FR7Bg
171
+ IRoNTxnsGb1kSarTMyYQHhWMQqUiH1hEqP0R0oPDcOumw08m91jmZFPEgk53fpZJ
172
+ OL0T8UnG4XoIHilRqc55OiFkXgDFivS1RQLG6ZkLnslD70+hURiU26JJ3tQO4Jh9
173
+ E9fAUy6KFGvwgAC9KMaw0wVgPZ9Ippd4lDE8VOPIOqZqvJ5kcYzi983I/b7eUhL9
174
+ IMLGRRftG9VKMCxV+1mIIv+62KTaC0SlzOqaGpaC52HjJt3ogOyIjKqyoU+U+fXY
175
+ AaP3iwHqXD2ojgbz89A5cckf99YImJlLGoWEiCNyhNh5EfuUH1QyuFssitJXsZS2
176
+ PBzhr0G5AQ0ES53cVgEIAM/nSJsPWIq4GuLjTdOA1LyN/k2a/L2fU4jGu5VVrAJu
177
+ 2e4BEBfte9WubzubOL7JMnS/v4ilZe9PQnQkXWWIZUbkK2lsqws8J5rzk2OyzjJj
178
+ aosoQfMJKgyLC0qmwhWElzlAbOU5ISCw58hCuATO5DnVCB4f3ltsLPyJ6T8RPb24
179
+ YbBWzdxKdXrsqKhTlLkWUpBIg+yD+Z7EIBJtCOjU3/F/H+OBnyFdnT+9zR0QKzeB
180
+ v3pRvQiBiMPNtOME+kjVJqTqjpCy8xh1AFjmOPjgOpQXv8YeCj/B4OcpyGpqJdL4
181
+ TYIvwu/HFXSrCTAPlu7Jk4hMnsHRlVaTAkKBGP5KAAUAEQEAAYkBHwQYAQIACQUC
182
+ S53cVgIbDAAKCRDu0AnfGR36YlhKB/46x/wrVl89i/jBa5iSVcIOpHhypLylGXaG
183
+ J7a9ICfyVwmL0DNpdWOKlmPXEM3NEmELfJXiOZhzGKOE8y/JM/lS+z09rXngCm96
184
+ CAzjwjNb6FC9wMZGsQGp7M/7VthyAjS/wlhS2PExCIWHglmsaPPj4NBAQxg/M8Na
185
+ n5F6Rq2K6rOE1x882i5wNsgAEb1iOFEUE1ctYSNbmO6JQfFyvz0cKpdmW52/iC41
186
+ sIHg4pUCB3Z7wT6vvSs/eQ3jARt7mok3JE56JL0sV2+Z2SePiFUn/ixKdn1lKP8d
187
+ +THIYJ/ZdpxUZeNKy7f1djoctqAk5T7ujVJh2d6xRXwqvQcJKoeW
188
+ =6E9O
189
+ -----END PGP PUBLIC KEY BLOCK-----