buildr 1.4.14 → 1.4.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +8 -8
  2. data/CHANGELOG +24 -0
  3. data/_buildr +0 -0
  4. data/_jbuildr +0 -0
  5. data/addon/buildr/bnd.rb +1 -1
  6. data/addon/buildr/git_auto_version.rb +1 -1
  7. data/addon/buildr/gpg.rb +1 -1
  8. data/addon/buildr/jaxb_xjc.rb +4 -2
  9. data/addon/buildr/package_as_nsis.rb +1 -1
  10. data/addon/buildr/sonar.rb +1 -1
  11. data/addon/buildr/top_level_generate_dir.rb +1 -1
  12. data/bin/buildr +0 -0
  13. data/buildr.gemspec +3 -1
  14. data/doc/download.textile +12 -0
  15. data/doc/index.textile +21 -0
  16. data/doc/packaging.textile +8 -0
  17. data/doc/scripts/buildr-git.rb +0 -0
  18. data/doc/scripts/gitflow.rb +0 -0
  19. data/doc/scripts/install-jruby.sh +0 -0
  20. data/doc/scripts/install-linux.sh +0 -0
  21. data/doc/scripts/install-osx.sh +0 -0
  22. data/doc/settings_profiles.textile +1 -0
  23. data/lib/buildr/core/application.rb +12 -0
  24. data/lib/buildr/core/assets.rb +7 -7
  25. data/lib/buildr/core/compile.rb +1 -1
  26. data/lib/buildr/core/console.rb +1 -1
  27. data/lib/buildr/core/progressbar.rb +1 -1
  28. data/lib/buildr/core/util.rb +1 -1
  29. data/lib/buildr/ide/idea.rb +10 -2
  30. data/lib/buildr/java/ecj.rb +1 -1
  31. data/lib/buildr/java/external.rb +1 -1
  32. data/lib/buildr/java/packaging.rb +4 -7
  33. data/lib/buildr/java/tests.rb +1 -1
  34. data/lib/buildr/packaging/archive.rb +2 -1
  35. data/lib/buildr/packaging/artifact.rb +51 -1
  36. data/lib/buildr/packaging/test_jar.rb +1 -1
  37. data/lib/buildr/version.rb +1 -1
  38. data/rakelib/doc.rake +7 -5
  39. data/rakelib/release.rake +11 -4
  40. data/rakelib/stage.rake +2 -2
  41. data/spec/addon/bnd_spec.rb +1 -1
  42. data/spec/addon/jaxb_xjc_spec.rb +4 -4
  43. data/spec/core/cc_spec.rb +2 -1
  44. data/spec/core/common_spec.rb +4 -4
  45. data/spec/core/compile_spec.rb +5 -5
  46. data/spec/core/console_spec.rb +2 -2
  47. data/spec/core/extension_spec.rb +0 -0
  48. data/spec/core/test_spec.rb +2 -2
  49. data/spec/core/transport_spec.rb +21 -19
  50. data/spec/ide/idea_spec.rb +25 -0
  51. data/spec/java/commands_spec.rb +1 -1
  52. data/spec/java/compiler_spec.rb +16 -0
  53. data/spec/java/ecj_spec.rb +2 -10
  54. data/spec/java/emma_spec.rb +1 -1
  55. data/spec/java/external_spec.rb +2 -1
  56. data/spec/java/java_spec.rb +1 -1
  57. data/spec/java/packaging_spec.rb +4 -5
  58. data/spec/java/pom_spec.rb +1 -1
  59. data/spec/java/test_coverage_helper.rb +2 -2
  60. data/spec/packaging/archive_spec.rb +22 -3
  61. data/spec/packaging/artifact_spec.rb +85 -1
  62. data/spec/sandbox.rb +1 -1
  63. data/spec/xpath_matchers.rb +1 -1
  64. metadata +4 -4
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWYyYTQ1NDRhZjI2NTBiYmEyYzA4MTBjNDIxYjk5ZDBlYzQzZGY4MA==
4
+ NjA1N2Y5NWJjMTgwY2FmMTU0ZWQ3NDI4ZjI1OTVlYjUzM2Q4ZjZhMA==
5
5
  data.tar.gz: !binary |-
6
- YTJiMGJjZDg4NDkyNWNkZDFmYjFiOTFiOTIwZjc5NTcwYzBhN2U3ZA==
6
+ MzQyNmY0NDBmZWFmN2EzMTIwYmYxMGY0ZDY4NDQ4M2Q4OWNlZjZiNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NGNiMWI1YzM1MDU1NWY5OWM1OGVkNTE4OWRiM2FmZTU4NjZlNWI0YzY0YmY3
10
- NzJkMDgzNDBkNTE2Y2U3YTJjMWE2YTBjZGFiYWYxYmUxZDlkOGVjMzM0ODY4
11
- MzNmODBiODRhMDQ1MzFlYWExYjJmYTA3YzZmMmZiYzY2ZmRkYTI=
9
+ NDE2YzBkODdkNjU4MjQxNmI5ZmE3NTk1MThjOGQ5NGY4ZDZlYzdkNTVjZWZl
10
+ ZmM4NDFlYzIyNzgzMjlkNTFmMDkzY2E3YWUzODc0NDhiNWZmNmVkYWQ1Y2My
11
+ YjE5NjQ3MDU4YWZiZjg1M2RiY2IzMWQ4YWY1Mzg2NmUxNWIxMTc=
12
12
  data.tar.gz: !binary |-
13
- N2RjNTVkZjExMDY1YmU4ODdmMGVlNDg5NjEyNzRhMmM4MWE0NjY5ODk3NWQ0
14
- YTE1Y2ExZWJiNzliMDcwMTIyOWNiMGE5ZDI3ZjExN2NiNzljY2FhOGNhYzky
15
- ZGQxMWRjMjU1N2YwYjk0MTQyNmIzZDlkZTJmZmZlMjQyMTFlNjg=
13
+ YzczYTYyNjJhZDk5ODhlNzZjZmM0OGY5NzdmODhmZTlkMWZhMzYyOGYzYzk3
14
+ YmUwNzQ2NGY0MmE5MjAyYzlmYjAyOTU2NzNjZDlhN2QxOTQ0Y2YzYTlmMjAw
15
+ MmUxNmIxNjM3NDUyN2RlMzBkNzY0NGYwMTkyMjA5NmY0ZWU1ZmI=
data/CHANGELOG CHANGED
@@ -1,3 +1,27 @@
1
+ 1.4.15 (2013-11-06)
2
+ * Change: Update to TestNG 6.8.7.
3
+ * Change: Updated the 'test_jar' package type to have a
4
+ classifier of 'tests' and thus match maven
5
+ conventions. Reported by Chris Bozic.
6
+ * Fixed: BUILDR-689 - Ensure that war file includes generated
7
+ assets rather than the "source" assets that may have
8
+ been filtered.
9
+ * Fixed: BUILDR-689 - Define assets task before the project is
10
+ defined to avoid "undefined method `project='" if the
11
+ project attempts to generate into the same directory.
12
+ * Added: BUILDR-679 - Support uploading to a snapshot repository
13
+ defined by repositories.snapshot_to if the artifact is
14
+ a snapshot. Submitted by Tammo van Lessen.
15
+ * Change: Update the jaxb_xjc addon to add output directory to
16
+ generated IDEA project files.
17
+ * Change: Update the default output directory used in the jaxb_xjc
18
+ addon to use Maven conventions.
19
+ * Fixed: Bug in IdeaProject.partition_dependencies resulted in
20
+ projects being rebuilt if artifacts were added to the
21
+ project with dependencies on the current project.
22
+ * Fixed: BUILDR-605 - Ensure package task invokes included paths.
23
+ * Fixed: BUILDR-609 - compile.from should accept Task argument.
24
+
1
25
  1.4.14 (2013-10-11)
2
26
  * Change: Remove highline dependency.
3
27
  * Fixed: BUILDR-682 - Fix the documentation for releasing using
data/_buildr CHANGED
File without changes
data/_jbuildr CHANGED
File without changes
@@ -156,4 +156,4 @@ end
156
156
 
157
157
  class Buildr::Project
158
158
  include Buildr::Bnd::ProjectExtension
159
- end
159
+ end
@@ -30,4 +30,4 @@ end
30
30
 
31
31
  class Buildr::Project
32
32
  include Buildr::GitAutoVersion::ProjectExtension
33
- end
33
+ end
@@ -81,4 +81,4 @@ end
81
81
 
82
82
  class Buildr::Project
83
83
  include Buildr::GPG::ProjectExtension
84
- end
84
+ end
@@ -47,9 +47,11 @@ module Buildr
47
47
  args = args.dup
48
48
  files = Array === files ? files.flatten : [files]
49
49
 
50
- target_dir = options[:directory] || path_to(:target, :generated, :jaxb)
50
+ target_dir = File.expand_path(options[:directory] || _(:target, :generated, :jaxb, 'main/java'))
51
51
  timestamp_file = File.expand_path("#{target_dir}/jaxb-#{options[:id] || 1}.cache")
52
52
 
53
+ project.iml.main_source_directories << target_dir if project.iml?
54
+
53
55
  file(target_dir => timestamp_file)
54
56
 
55
57
  file(timestamp_file => files.flatten) do |task|
@@ -69,4 +71,4 @@ end
69
71
 
70
72
  class Buildr::Project
71
73
  include Buildr::JaxbXjc
72
- end
74
+ end
@@ -77,4 +77,4 @@ end
77
77
 
78
78
  class Buildr::Project
79
79
  include Buildr::PackageAsNsis
80
- end
80
+ end
@@ -139,4 +139,4 @@ end
139
139
 
140
140
  class Buildr::Project
141
141
  include Buildr::Sonar::ProjectExtension
142
- end
142
+ end
@@ -34,4 +34,4 @@ end
34
34
 
35
35
  class Buildr::Project
36
36
  include Buildr::TopLevelGenerateDir::ProjectExtension
37
- end
37
+ end
data/bin/buildr CHANGED
File without changes
@@ -58,6 +58,8 @@ for those one-off tasks, with a language that's a joy to use.
58
58
  spec.add_dependency 'builder', '3.2.2'
59
59
  spec.add_dependency 'net-ssh', '2.7.0'
60
60
  spec.add_dependency 'net-sftp', '2.1.2'
61
+ # Required for sftp support under windows
62
+ spec.add_dependency "jruby-pageant", '1.1.1' if $platform.to_s == 'java'
61
63
  spec.add_dependency 'rubyzip', '0.9.9'
62
64
  spec.add_dependency 'json_pure', '1.8.0'
63
65
  spec.add_dependency 'rubyforge', '2.0.4'
@@ -78,7 +80,7 @@ for those one-off tasks, with a language that's a joy to use.
78
80
 
79
81
  # Unable to get this consistently working under jruby on windows
80
82
  unless $platform.to_s == 'java'
81
- spec.add_development_dependency 'jekyll', '1.2.1'
83
+ spec.add_development_dependency 'jekyll', '0.11.2'
82
84
  spec.add_development_dependency 'RedCloth', '4.2.9'
83
85
  spec.add_development_dependency 'jekylltask', '1.1.0'
84
86
  spec.add_development_dependency 'rdoc', '4.0.1'
@@ -20,6 +20,18 @@ The source code is included in both source and binary distribution, the Gem dist
20
20
 
21
21
  h2(#dist). Binaries and Source Code
22
22
 
23
+ h3. buildr 1.4.14 (2013-10-11)
24
+
25
+ |_. Package |_. MD5 Checksum |_. PGP |
26
+ | "buildr-1.4.14-java.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.14/buildr-1.4.14-java.gem | "f90047a502b964943bda09b0a76b98f2":http://www.apache.org/dist/buildr/1.4.14/buildr-1.4.14-java.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.14/buildr-1.4.14-java.gem.asc |
27
+ | "buildr-1.4.14-x86-mswin32.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.14/buildr-1.4.14-x86-mswin32.gem | "f98125eb8edae9ecb720d04d895b113b":http://www.apache.org/dist/buildr/1.4.14/buildr-1.4.14-x86-mswin32.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.14/buildr-1.4.14-x86-mswin32.gem.asc |
28
+ | "buildr-1.4.14.gem":http://www.apache.org/dyn/closer.cgi/buildr/1.4.14/buildr-1.4.14.gem | "b797e2a07b7da07a317ea90ec1d7a36c":http://www.apache.org/dist/buildr/1.4.14/buildr-1.4.14.gem.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.14/buildr-1.4.14.gem.asc |
29
+ | "buildr-1.4.14.tgz":http://www.apache.org/dyn/closer.cgi/buildr/1.4.14/buildr-1.4.14.tgz | "ddece5f90aef3ccd589eeff81af2a686":http://www.apache.org/dist/buildr/1.4.14/buildr-1.4.14.tgz.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.14/buildr-1.4.14.tgz.asc |
30
+ | "buildr-1.4.14.zip":http://www.apache.org/dyn/closer.cgi/buildr/1.4.14/buildr-1.4.14.zip | "40c0bffb0b2d3ca1ad43a5e0020e2afb":http://www.apache.org/dist/buildr/1.4.14/buildr-1.4.14.zip.md5 | "Sig":http://www.apache.org/dist/buildr/1.4.14/buildr-1.4.14.zip.asc |
31
+
32
+ p>. ("Release signing keys":http://www.apache.org/dist/buildr/1.4.14/KEYS)
33
+
34
+
23
35
  h3. buildr 1.4.13 (2013-10-02)
24
36
 
25
37
  |_. Package |_. MD5 Checksum |_. PGP |
@@ -46,6 +46,27 @@ So let's get started. You can "read the documentation online":quick_start.html,
46
46
 
47
47
  h2(#news). What's New
48
48
 
49
+ Highlights from Buildr 1.4.15 (2013-11-06)
50
+ * Change: Updated the 'test_jar' package type to have a
51
+ classifier of 'tests' and thus match maven
52
+ conventions. Reported by Chris Bozic.
53
+ * Fixed: BUILDR-689 - Ensure that war file includes generated
54
+ assets rather than the "source" assets that may have
55
+ been filtered.
56
+ * Fixed: BUILDR-689 - Define assets task before the project is
57
+ defined to avoid "undefined method `project='" if the
58
+ project attempts to generate into the same directory.
59
+ * Added: BUILDR-679 - Support uploading to a snapshot repository
60
+ defined by repositories.snapshot_to if the artifact is
61
+ a snapshot. Submitted by Tammo van Lessen.
62
+ * Change: Update the default output directory used in the jaxb_xjc
63
+ addon to use Maven conventions.
64
+ * Fixed: Bug in IdeaProject.partition_dependencies resulted in
65
+ projects being rebuilt if artifacts were added to the
66
+ project with dependencies on the current project.
67
+ * Fixed: BUILDR-605 - Ensure package task invokes included paths.
68
+ * Fixed: BUILDR-609 - compile.from should accept Task argument.
69
+
49
70
  Highlights from Buildr 1.4.14 (2013-10-11)
50
71
  * Fixed: Fixed regression in gwt addon.
51
72
  * Fixed: Fixed regression using transitive dependencies due to
@@ -585,6 +585,14 @@ Of course, you'll need to tell Buildr about the release server:
585
585
  repositories.release_to = 'sftp://john:secret@release/usr/share/repo'
586
586
  {% endhighlight %}
587
587
 
588
+ If you have separate repositories for releases and snapshots, you can specify them accordingly. Buildr takes care of picking the correct one.
589
+
590
+ {% highlight ruby %}
591
+ repositories.release_to = 'sftp://john:secret@release/usr/share/repo/releases'
592
+ repositories.snapshot_to = 'sftp://john:secret@release/usr/share/repo/snapshots'
593
+ {% endhighlight %}
594
+
595
+
588
596
  This example uses the SFTP protocol. In addition, you can use the HTTP protocol -- Buildr supports HTTP and HTTPS, Basic Authentication and uploads using PUT -- or point to a directory on your file system.
589
597
 
590
598
  The URL in this example contains the release server ("release"), path to repository ("user/share/repo") and username/password for access. The way SFTP works, you specify the path on the release server, and give the user permissions to create directories and files inside the repository. The file system path is different from the path you use to download these artifacts through an HTTP server, and starts at the root, not the user's home directory.
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -58,6 +58,7 @@ repositories.release_to[:username] = ENV['USERNAME']
58
58
  repositories.release_to[:password] = ENV['PASSWORD']
59
59
  {% endhighlight %}
60
60
 
61
+ The same works for the @repositories.snapshot_to@ hash.
61
62
 
62
63
  h2(#personal). Personal Settings
63
64
 
@@ -668,6 +668,18 @@ module Rake #:nodoc
668
668
  end
669
669
  end
670
670
 
671
+ # Under windows, paths passed to mkpath, mkdir_p and mkdirs need to be normalized.
672
+ # Otherwise ruby may decide to treat the drive component as a directory (i.e.
673
+ # create a directory named "C:"). This patch hooks in at a low level to work around
674
+ # this issue.
675
+ module FileUtils
676
+ def fu_list(arg) #:nodoc:
677
+ [arg].flatten.map { |path| Buildr::Util.normalize_path(path) }
678
+ end
679
+
680
+ private_module_function :fu_list
681
+ end
682
+
671
683
  module FileUtils
672
684
  def fu_output_message(msg) #:nodoc:
673
685
  if Rake::FileUtilsExt::DEFAULT == RakeFileUtils.verbose_flag
@@ -31,7 +31,7 @@ module Buildr #:nodoc:
31
31
  def paths
32
32
  unless @paths
33
33
  @paths = []
34
- @paths << project._(:source, :main, :webapp) if File.exist?(project._(:source, :main, :webapp))
34
+ @paths << project._(:source, :main, :assets) if File.exist?(project._(:source, :main, :assets))
35
35
  end
36
36
  @paths
37
37
  end
@@ -72,21 +72,21 @@ module Buildr #:nodoc:
72
72
  Project.local_task("assets")
73
73
  end
74
74
 
75
+ before_define do |project|
76
+ # Force the construction of the assets task
77
+ project.assets.paths
78
+ end
79
+
75
80
  # Access the asset task
76
81
  def assets
77
82
  if @assets.nil?
78
- @assets = AssetsTask.define_task(project._(:target, :main, :webapp) => [])
83
+ @assets = AssetsTask.define_task(project._(:target, :main, :assets) => [])
79
84
  @assets.project = self
80
85
  project.task('assets').enhance([@assets])
81
86
  project.build.enhance([@assets])
82
87
  end
83
88
  @assets
84
89
  end
85
-
86
- after_define do |project|
87
- # Force construction
88
- project.assets
89
- end
90
90
  end
91
91
  end
92
92
  end
@@ -92,7 +92,7 @@ module Buildr #:nodoc:
92
92
  if (!File.directory?(found)) && found.match(/.*\.#{Array(source_ext).join('|')}/)
93
93
  return true
94
94
  end
95
- } if File.exist? path
95
+ } if File.exist? path.to_s
96
96
  }
97
97
  false
98
98
  end
@@ -194,7 +194,7 @@ module Buildr #nodoc
194
194
  require 'Win32/Console/ANSI'
195
195
  end
196
196
  end
197
- rescue Java::JavaLang::IncompatibleClassChangeError
197
+ rescue
198
198
  # Unfortunately we have multiple incompatible jline libraries
199
199
  # in the classpath. This is probably because we are using jruby
200
200
  # 1.7.5 with a library like scala and both use incompatible jline
@@ -158,4 +158,4 @@ protected
158
158
  @total == 0 ? ['%s %8s %s', :title, :count, :elapsed] : ['%s: %s |--| %8s/%s %s', :title, :percentage, :count, :total, :time]
159
159
  end
160
160
 
161
- end
161
+ end
@@ -27,7 +27,7 @@ module Buildr #:nodoc:
27
27
  #
28
28
  # Gem.win_platform? only checks these RUBY_PLATFORM global,
29
29
  # that in some cases like when running on JRuby is not
30
- # succifient for our purpose:
30
+ # sufficient for our purpose:
31
31
  #
32
32
  # For JRuby, the value for RUBY_PLATFORM will always be 'java'
33
33
  # That's why this function checks on Config::CONFIG['host_os']
@@ -299,6 +299,7 @@ module Buildr #:nodoc:
299
299
  def add_web_facet(options = {})
300
300
  name = options[:name] || "Web"
301
301
  default_webroots = {}
302
+ default_webroots[buildr_project._(:source, :main, :webapp)] = "/" if File.exist?(buildr_project._(:source, :main, :webapp))
302
303
  buildr_project.assets.paths.each {|p| default_webroots[p] = "/" }
303
304
  webroots = options[:webroots] || default_webroots
304
305
  default_deployment_descriptors = []
@@ -647,12 +648,19 @@ module Buildr #:nodoc:
647
648
 
648
649
  def add_configuration(name, type, factory_name, default = false)
649
650
  add_to_composite_component(self.configurations) do |xml|
650
- xml.configuration(:name => name, :type => type, :factoryName => factory_name, :default => default) do |xml|
651
+ options = {:type => type, :factoryName => factory_name}
652
+ options[:name] = name unless default
653
+ options[:default] = true if default
654
+ xml.configuration(options) do |xml|
651
655
  yield xml if block_given?
652
656
  end
653
657
  end
654
658
  end
655
659
 
660
+ def add_default_configuration(type, factory_name)
661
+ add_configuration(nil, type, factory_name)
662
+ end
663
+
656
664
  def add_postgres_data_source(name, options = {})
657
665
  if options[:url].nil? && options[:database]
658
666
  default_url = "jdbc:postgresql://#{(options[:host] || "127.0.0.1")}:#{(options[:port] || "5432")}/#{options[:database]}"
@@ -1013,7 +1021,7 @@ module Buildr #:nodoc:
1013
1021
  dependencies.each do |dependency|
1014
1022
  artifacts = Buildr.artifacts(dependency)
1015
1023
  artifacts_as_strings = artifacts.map(&:to_s)
1016
- all_projects = Buildr::Project.instance_variable_get("@projects").keys - [buildr_project.name]
1024
+ all_projects = Buildr::Project.instance_variable_get("@projects").keys
1017
1025
  project = Buildr.projects(all_projects).detect do |project|
1018
1026
  [project.packages, project.compile.target, project.resources.target, project.test.compile.target, project.test.resources.target].flatten.
1019
1027
  detect { |component| artifacts_as_strings.include?(component.to_s) }
@@ -66,4 +66,4 @@ end
66
66
 
67
67
  Java.classpath << "org.eclipse.jdt.core.compiler:ecj:jar:3.5.1"
68
68
  # Adding ecj before javac
69
- Buildr::Compiler.compilers.unshift Buildr::Compiler::Ecj
69
+ Buildr::Compiler.compilers.unshift Buildr::Compiler::Ecj
@@ -70,4 +70,4 @@ module Buildr #:nodoc:
70
70
  end
71
71
  end
72
72
 
73
- Buildr::Compiler.compilers << Buildr::Compiler::ExternalJavac
73
+ Buildr::Compiler.compilers << Buildr::Compiler::ExternalJavac
@@ -684,13 +684,10 @@ module Buildr #:nodoc:
684
684
  # Add libraries in WEB-INF lib, and classes in WEB-INF classes
685
685
  war.with :classes=>[compile.target, resources.target].compact
686
686
  war.with :libs=>compile.dependencies
687
- # Add included files, or the webapp directory.
688
- assets.paths.each do |asset|
689
- war.tap do |war|
690
- war.enhance([asset])
691
- end
692
- war.include asset, :as => '.'
693
- end
687
+ webapp = path_to(:source, :main, :webapp)
688
+ war.with webapp if File.exist?(webapp)
689
+ war.enhance([assets])
690
+ war.include assets.to_s, :as => '.' unless assets.paths.empty?
694
691
  end
695
692
  end
696
693
 
@@ -296,7 +296,7 @@ module Buildr #:nodoc:
296
296
  # * :args -- Arguments passed to the TestNG command line runner.
297
297
  class TestNG < TestFramework::Java
298
298
 
299
- VERSION = '6.8.5'
299
+ VERSION = '6.8.7'
300
300
 
301
301
  class << self
302
302
  def version
@@ -62,7 +62,7 @@ module Buildr #:nodoc:
62
62
  # include(:from=>path) => self
63
63
  # include(*files, :merge=>true) => self
64
64
  def include(*args)
65
- options = args.pop if Hash === args.last
65
+ options = Hash === args.last ? args.pop : nil
66
66
  files = to_artifacts(args)
67
67
  raise 'AchiveTask.include() values should not include nil' if files.include? nil
68
68
 
@@ -207,6 +207,7 @@ module Buildr #:nodoc:
207
207
  @sources << proc { source }
208
208
  @actions << proc do |file_map|
209
209
  file = source.to_s
210
+ file(file).invoke
210
211
  unless excluded?(file)
211
212
  if File.directory?(file)
212
213
  in_directory file do |file, rel_path|
@@ -179,7 +179,8 @@ module Buildr #:nodoc:
179
179
  #
180
180
  # Uploads the artifact, its POM and digital signatures to remote server.
181
181
  #
182
- # In the first form, uses the upload options specified by repositories.release_to.
182
+ # In the first form, uses the upload options specified by repositories.release_to
183
+ # or repositories.snapshot_to if the subject is a snapshot artifact.
183
184
  # In the second form, uses a URL that includes all the relevant information.
184
185
  # In the third form, uses a hash with the options :url, :username, :password,
185
186
  # and :permissions. All but :url are optional.
@@ -188,6 +189,7 @@ module Buildr #:nodoc:
188
189
  end
189
190
 
190
191
  def upload_task(upload_to = nil)
192
+ upload_to ||= Buildr.repositories.snapshot_to if snapshot? && Buildr.repositories.snapshot_to != nil && Buildr.repositories.snapshot_to[:url] != nil
191
193
  upload_to ||= Buildr.repositories.release_to
192
194
  upload_to = { :url=>upload_to } unless Hash === upload_to
193
195
  raise ArgumentError, 'Don\'t know where to upload, perhaps you forgot to set repositories.release_to' unless upload_to[:url]
@@ -715,6 +717,54 @@ module Buildr #:nodoc:
715
717
  @release_to
716
718
  end
717
719
 
720
+ # :call-seq:
721
+ # snapshot_to = url
722
+ # snapshot_to = hash
723
+ #
724
+ # Specifies the release server. Accepts a Hash with different repository settings
725
+ # (e.g. url, username, password), or a String to only set the repository URL.
726
+ #
727
+ # Besides the URL, all other settings depend on the transport protocol in use.
728
+ #
729
+ # For example:
730
+ # repositories.snapshot_to = 'sftp://john:secret@example.com/var/www/repo/'
731
+ #
732
+ # repositories.snapshot_to = { :url=>'sftp://example.com/var/www/repo/',
733
+ # :username='john', :password=>'secret' }
734
+ # Or in the settings.yaml file:
735
+ # repositories:
736
+ # snapshot_to: sftp://john:secret@example.com/var/www/repo/
737
+ #
738
+ # repositories:
739
+ # snapshot_to:
740
+ # url: sftp://example.com/var/www/repo/
741
+ # username: john
742
+ # password: secret
743
+ def snapshot_to=(options)
744
+ options = { :url=>options } unless Hash === options
745
+ @snapshot_to = options
746
+ end
747
+
748
+ # :call-seq:
749
+ # snapshot_to => hash
750
+ #
751
+ # Returns the current snapshot release server setting as a Hash. This is a more convenient way to
752
+ # configure the settings, as it allows you to specify the settings progressively.
753
+ #
754
+ # For example, the Buildfile will contain the repository URL used by all developers:
755
+ # repositories.snapshot_to[:url] ||= 'sftp://example.com/var/www/repo'
756
+ # Your private buildr.rb will contain your credentials:
757
+ # repositories.snapshot_to[:username] = 'john'
758
+ # repositories.snapshot_to[:password] = 'secret'
759
+ def snapshot_to
760
+ unless @snapshot_to
761
+ value = (Buildr.settings.user['repositories'] && Buildr.settings.user['repositories']['snapshot_to']) \
762
+ || (Buildr.settings.build['repositories'] && Buildr.settings.build['repositories']['snapshot_to'])
763
+ @snapshot_to = Hash === value ? value.inject({}) { |hash, (key, value)| hash.update(key.to_sym=>value) } : { :url=>Array(value).first }
764
+ end
765
+ @snapshot_to
766
+ end
767
+
718
768
  end
719
769
 
720
770
  # :call-seq: