buildr 1.3.5-java → 1.4.0-java

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.rb +1 -1
  37. data/lib/buildr/core.rb +1 -0
  38. data/lib/buildr/core/application.rb +33 -27
  39. data/lib/buildr/core/build.rb +41 -28
  40. data/lib/buildr/core/cc.rb +172 -0
  41. data/lib/buildr/core/checks.rb +1 -1
  42. data/lib/buildr/core/common.rb +7 -6
  43. data/lib/buildr/core/compile.rb +7 -8
  44. data/lib/buildr/core/doc.rb +263 -0
  45. data/lib/buildr/core/environment.rb +6 -6
  46. data/lib/buildr/core/filter.rb +77 -35
  47. data/lib/buildr/core/generate.rb +7 -7
  48. data/lib/buildr/core/help.rb +1 -1
  49. data/lib/buildr/core/osx.rb +6 -6
  50. data/lib/buildr/core/progressbar.rb +4 -4
  51. data/lib/buildr/core/project.rb +144 -36
  52. data/lib/buildr/core/shell.rb +34 -34
  53. data/lib/buildr/core/test.rb +89 -20
  54. data/lib/buildr/core/transports.rb +8 -7
  55. data/lib/buildr/core/util.rb +77 -23
  56. data/lib/buildr/groovy/bdd.rb +5 -5
  57. data/lib/buildr/groovy/compiler.rb +19 -15
  58. data/lib/buildr/groovy/shell.rb +6 -6
  59. data/lib/buildr/ide/eclipse.rb +148 -75
  60. data/lib/buildr/ide/eclipse/java.rb +3 -3
  61. data/lib/buildr/ide/eclipse/plugin.rb +8 -5
  62. data/lib/buildr/ide/eclipse/scala.rb +4 -2
  63. data/lib/buildr/ide/idea.rb +2 -2
  64. data/lib/buildr/ide/idea7x.rb +23 -4
  65. data/lib/buildr/java.rb +1 -0
  66. data/lib/buildr/java/ant.rb +4 -4
  67. data/lib/buildr/java/bdd.rb +51 -54
  68. data/lib/buildr/java/cobertura.rb +57 -35
  69. data/lib/buildr/java/commands.rb +14 -5
  70. data/lib/buildr/java/compiler.rb +3 -217
  71. data/lib/buildr/java/deprecated.rb +4 -4
  72. data/lib/buildr/java/doc.rb +70 -0
  73. data/lib/buildr/java/emma.rb +22 -22
  74. data/lib/buildr/java/jruby.rb +4 -4
  75. data/lib/buildr/java/jtestr_runner.rb.erb +27 -25
  76. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
  77. data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +8 -3
  78. data/lib/buildr/java/packaging.rb +30 -29
  79. data/lib/buildr/java/pom.rb +4 -4
  80. data/lib/buildr/java/rjb.rb +6 -6
  81. data/lib/buildr/java/test_result.rb +61 -85
  82. data/lib/buildr/java/tests.rb +44 -27
  83. data/lib/buildr/java/version_requirement.rb +8 -8
  84. data/lib/buildr/packaging/archive.rb +55 -22
  85. data/lib/buildr/packaging/artifact.rb +75 -36
  86. data/lib/buildr/packaging/artifact_namespace.rb +90 -78
  87. data/lib/buildr/packaging/artifact_search.rb +5 -5
  88. data/lib/buildr/packaging/gems.rb +11 -7
  89. data/lib/buildr/packaging/package.rb +10 -7
  90. data/lib/buildr/packaging/tar.rb +14 -14
  91. data/lib/buildr/packaging/version_requirement.rb +30 -10
  92. data/lib/buildr/packaging/ziptask.rb +51 -13
  93. data/lib/buildr/scala.rb +1 -0
  94. data/lib/buildr/scala/bdd.rb +25 -20
  95. data/lib/buildr/scala/compiler.rb +87 -40
  96. data/lib/buildr/scala/doc.rb +106 -0
  97. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
  98. data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java +57 -0
  99. data/lib/buildr/scala/shell.rb +14 -9
  100. data/lib/buildr/scala/tests.rb +33 -26
  101. data/lib/buildr/shell.rb +33 -33
  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 +148 -132
  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
@@ -54,19 +54,19 @@ module Buildr
54
54
 
55
55
  def javacc(*args)
56
56
  if Hash === args.last
57
- options = args.pop
57
+ options = args.pop
58
58
  in_package = options[:in_package].split(".")
59
59
  else
60
60
  in_package = []
61
61
  end
62
62
  file(path_to(:target, :generated, :javacc)=>args.flatten) do |task|
63
63
  JavaCC.javacc task.prerequisites, :output=>File.join(task.name, in_package)
64
- end
64
+ end
65
65
  end
66
66
 
67
67
  def jjtree(*args)
68
68
  if Hash === args.last
69
- options = args.pop
69
+ options = args.pop
70
70
  in_package = options[:in_package].split(".")
71
71
  build_node_files = options[:build_node_files]
72
72
  else
@@ -74,7 +74,7 @@ module Buildr
74
74
  end
75
75
  file(path_to(:target, :generated, :jjtree)=>args.flatten) do |task|
76
76
  JavaCC.jjtree task.prerequisites, :output=>File.join(task.name, in_package), :build_node_files=>build_node_files
77
- end
77
+ end
78
78
  end
79
79
 
80
80
  end
@@ -46,15 +46,15 @@ module Buildr
46
46
  # Which version of Jetty we're using by default (change with options.jetty.version).
47
47
  VERSION = "6.1.3"
48
48
  SLF4J_VERSION = "1.4.3"
49
-
49
+
50
50
  # Libraries used by Jetty.
51
51
  REQUIRES = [ "org.mortbay.jetty:jetty:jar:#{VERSION}", "org.mortbay.jetty:jetty-util:jar:#{VERSION}",
52
- "org.mortbay.jetty:servlet-api-2.5:jar:#{VERSION}", "org.slf4j:slf4j-api:jar:#{SLF4J_VERSION}",
52
+ "org.mortbay.jetty:servlet-api-2.5:jar:#{VERSION}", "org.slf4j:slf4j-api:jar:#{SLF4J_VERSION}",
53
53
  "org.slf4j:slf4j-simple:jar:#{SLF4J_VERSION}", "org.slf4j:jcl104-over-slf4j:jar:#{SLF4J_VERSION}" ]
54
-
54
+
55
55
  Java.classpath << REQUIRES
56
56
  Java.classpath << File.dirname(__FILE__)
57
-
57
+
58
58
  # Default URL for Jetty (change with options.jetty.url).
59
59
  URL = "http://localhost:8080"
60
60
 
@@ -135,7 +135,7 @@ module Buildr
135
135
  response = http.request_get("/buildr/")
136
136
  response.is_a?(Net::HTTPSuccess) && response.body =~ /Alive/
137
137
  end
138
- rescue Errno::ECONNREFUSED, Errno::EBADF
138
+ rescue Errno::ECONNREFUSED, Errno::EBADF
139
139
  false
140
140
  end
141
141
  end
@@ -21,18 +21,18 @@ require 'buildr/drb'
21
21
 
22
22
 
23
23
  module Buildr
24
-
24
+
25
25
  # This addon is provided for fast interaction with a DRb BuildrServer (buildr/drb).
26
- #
26
+ #
27
27
  # This module delegates task invocation to the BuildrServer, it only implements
28
28
  # nailgun required logic (server/client).
29
29
  #
30
30
  # Usage:
31
31
  #
32
32
  # buildr -r buildr/nailgun nailgun:start
33
- #
33
+ #
34
34
  # Once the server has been started you can invoke tasks using the nailgun client
35
- # installed on $JRUBY_HOME/tool/nailgun. It's recommended to add this path to
35
+ # installed on $JRUBY_HOME/tool/nailgun. It's recommended to add this path to
36
36
  # your PATH environment variable, so that the ng command is available at any dir.
37
37
  #
38
38
  # ng build # invoke the build task
@@ -46,12 +46,12 @@ module Buildr
46
46
  ARTIFACT_SPEC = "com.martiansoftware:nailgun:jar:#{VERSION}"
47
47
  PORT = DRbApplication::PORT + 2
48
48
  ADDON_BIN = File.dirname(__FILE__)
49
-
49
+
50
50
  # Returns the path to JRUBY_HOME.
51
51
  def jruby_home
52
52
  ENV['JRUBY_HOME'] || Config::CONFIG['prefix']
53
53
  end
54
-
54
+
55
55
  # Returns the path to NAILGUN_HOME.
56
56
  def nailgun_home
57
57
  ENV['NAILGUN_HOME'] || File.expand_path('tool/nailgun', jruby_home)
@@ -109,17 +109,17 @@ module Buildr
109
109
  stdout = Util.ctor(org.jruby.RubyIO, runtime, java.io.OutputStream => nail.out)
110
110
  stderr = Util.ctor(org.jruby.RubyIO, runtime, java.io.OutputStream => nail.err)
111
111
  stdin = Util.ctor(org.jruby.RubyIO, runtime, java.io.InputStream => nail.in)
112
-
112
+
113
113
  dir = nail.getWorkingDirectory
114
114
  argv = [nail.command] + nail.args
115
-
115
+
116
116
  DRbApplication.remote_run :dir => dir, :argv => argv,
117
117
  :in => stdin, :out => stdout, :err => stderr
118
118
  rescue => e
119
119
  nail.err.println e unless SystemExit === e
120
120
  nail.exit 1
121
121
  end
122
-
122
+
123
123
  end # Client
124
124
 
125
125
  module Server
@@ -131,24 +131,24 @@ module Buildr
131
131
 
132
132
  def start
133
133
  self.allow_nails_by_class_name = false
134
-
134
+
135
135
  NGClient::Main.nail = NGClient.new
136
136
  self.default_nail_class = NGClient::Main
137
-
137
+
138
138
  @thread = java.lang.Thread.new(self)
139
139
  @thread.setName(to_s)
140
140
  @thread.start
141
-
141
+
142
142
  sleep 1 while getPort == 0
143
143
  info "#{self} Started."
144
144
  end
145
-
145
+
146
146
  def stop
147
147
  @thread.kill
148
148
  end
149
149
 
150
150
  def to_s
151
- version = "Buildr #{Buildr::VERSION} #{RUBY_PLATFORM[/java/] && '(JRuby '+JRUBY_VERSION+')'}"
151
+ version = "Buildr #{Buildr::VERSION} #{RUBY_PLATFORM[/java/] && '(JRuby '+ (Buildr.settings.build['jruby'] || JRUBY_VERSION) +')'}"
152
152
  self.class.name+'('+[version, @host, @port].join(', ')+')'
153
153
  end
154
154
  end # Server
@@ -157,13 +157,13 @@ module Buildr
157
157
 
158
158
  dist_zip = Buildr.download(tmp_path(NAME + '.zip') => URL)
159
159
  dist_dir = Buildr.unzip(tmp_path(NAME) => dist_zip)
160
-
160
+
161
161
  nailgun_jar = file(tmp_path(NAME, NAME, NAME + '.jar'))
162
162
  nailgun_jar.enhance [dist_dir] unless File.exist?(nailgun_jar.to_s)
163
163
 
164
164
  attr_reader :artifact
165
165
  @artifact = Buildr.artifact(ARTIFACT_SPEC).from(nailgun_jar)
166
-
166
+
167
167
  compiled_bin = file(tmp_path(NAME, NAME, 'ng' + Config::CONFIG['EXEEXT']) => dist_dir.target) do |task|
168
168
  unless task.to_s.pathmap('%x') == '.exe'
169
169
  Dir.chdir(task.to_s.pathmap('%d')) do
@@ -197,25 +197,25 @@ module Buildr
197
197
  server.start
198
198
  end
199
199
 
200
- task('setup' => artifact) do
200
+ task('setup' => artifact) do
201
201
  module Util
202
202
  include Buildr::Util
203
203
  end
204
-
204
+
205
205
  Util.add_to_sysloader artifact.to_s
206
206
  Util.add_to_sysloader ADDON_BIN
207
-
207
+
208
208
  class NGClient
209
209
  include org.apache.buildr.BuildrNail
210
210
  include Client
211
211
  end
212
-
212
+
213
213
  class NGServer < com.martiansoftware.nailgun.NGServer
214
214
  include Server
215
- end
215
+ end
216
216
  end
217
-
217
+
218
218
  end # ng_tasks
219
-
219
+
220
220
  end # module Nailgun
221
221
  end
@@ -26,7 +26,7 @@ module Buildr
26
26
 
27
27
  REQUIRES = [ "org.apache.openjpa:openjpa:jar:#{VERSION}",
28
28
  "commons-collections:commons-collections:jar:3.1",
29
- "commons-dbcp:commons-dbcp:jar:1.2.1",
29
+ "commons-dbcp:commons-dbcp:jar:1.2.1",
30
30
  "commons-lang:commons-lang:jar:2.1",
31
31
  "commons-pool:commons-pool:jar:1.2",
32
32
  "javax.persistence:persistence-api:jar:1.0",
@@ -0,0 +1,75 @@
1
+ # Licensed to the Apache Software Foundation (ASF) under one or more
2
+ # contributor license agreements. See the NOTICE file distributed with this
3
+ # work for additional information regarding copyright ownership. The ASF
4
+ # licenses this file to you under the Apache License, Version 2.0 (the
5
+ # "License"); you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+ # License for the specific language governing permissions and limitations under
14
+ # the License.
15
+
16
+
17
+ module Buildr
18
+ # Provides Protocol buffer code generation tasks. Require explicitly using <code>require "buildr/protobuf"</code>.
19
+ module Protobuf
20
+ class << self
21
+ def protoc(*args)
22
+ options = Hash === args.last ? args.pop : {}
23
+ rake_check_options options, :output, :lang, :include
24
+
25
+ options[:lang] ||= :java
26
+ options[:output] ||= File.expand_path "target/generated/protoc"
27
+ options[:include] ||= []
28
+
29
+ command_line = []
30
+
31
+ command_line << "--#{options[:lang]}_out=#{options[:output]}" if options[:output]
32
+
33
+ (paths_from_sources(*args) + options[:include]).each { |i| command_line << "-I#{i}" }
34
+
35
+ command_line += files_from_sources(*args)
36
+
37
+ mkdir_p( options[:output] )
38
+
39
+ system protoc_path, *command_line
40
+ end
41
+
42
+ def protoc_path
43
+ ENV['PROTOC'] || "protoc"
44
+ end
45
+
46
+ def files_from_sources(*args)
47
+ args.flatten.map(&:to_s).collect { |f| File.directory?(f) ? FileList[f + "/**/*.proto"] : f }.flatten
48
+ end
49
+
50
+ def paths_from_sources(*args)
51
+ args.flatten.map(&:to_s).collect { |f| File.directory?(f) ? f : File.dirname(f) }
52
+ end
53
+ end
54
+
55
+ def protoc(*args)
56
+ if Hash === args.last
57
+ options = args.pop
58
+ else
59
+ options = {}
60
+ end
61
+
62
+ options[:output] ||= path_to(:target, :generated, :protoc)
63
+ options[:lang] ||= compile.language if compile.language
64
+
65
+ file(options[:output]=>Protobuf.files_from_sources(*args)) do |task|
66
+ Protobuf.protoc task.prerequisites, options
67
+ end
68
+ end
69
+
70
+ end
71
+
72
+ class Project
73
+ include Protobuf
74
+ end
75
+ end
@@ -23,12 +23,12 @@ module Buildr
23
23
  # Provides XMLBeans schema compiler. Require explicitly using <code>require "buildr/xmlbeans"</code>.
24
24
  #
25
25
  # require 'buildr/xmlbeans'
26
- # define 'some_proj' do
26
+ # define 'some_proj' do
27
27
  # compile_xml_beans _(:source, :main, :xsd) # the directory with *.xsd
28
28
  # end
29
29
  module XMLBeans
30
30
 
31
- # You can use ArtifactNamespace to customize the versions of
31
+ # You can use ArtifactNamespace to customize the versions of
32
32
  # <code>:xmlbeans</code> or <code>:stax</code> used by this module:
33
33
  #
34
34
  # require 'buildr/xmlbeans'
@@ -37,7 +37,7 @@ module Buildr
37
37
  ns.xmlbeans! 'org.apache.xmlbeans:xmlbeans:jar:2.3.0', '>2'
38
38
  ns.stax_api! 'stax:stax-api:jar:>=1.0.1'
39
39
  end
40
-
40
+
41
41
  class << self
42
42
 
43
43
  def compile(*args)
@@ -48,7 +48,7 @@ module Buildr
48
48
  Buildr.ant "xmlbeans" do |ant|
49
49
  ant.taskdef :name=>"xmlbeans", :classname=>"org.apache.xmlbeans.impl.tool.XMLBean",
50
50
  :classpath=>requires.join(File::PATH_SEPARATOR)
51
- ant.xmlbeans :srconly=>"true", :srcgendir=>options[:output].to_s, :classgendir=>options[:output].to_s,
51
+ ant.xmlbeans :srconly=>"true", :srcgendir=>options[:output].to_s, :classgendir=>options[:output].to_s,
52
52
  :javasource=>options[:javasource] do
53
53
  args.flatten.each { |file| ant.fileset File.directory?(file) ? { :dir=>file } : { :file=>file } }
54
54
  end
@@ -58,7 +58,7 @@ module Buildr
58
58
  end
59
59
 
60
60
  def requires()
61
- @requires ||= REQUIRES.artifacts.each(&:invoke).map(&:to_s)
61
+ @requires ||= REQUIRES.artifacts
62
62
  end
63
63
  end
64
64
 
data/buildr.buildfile CHANGED
@@ -22,14 +22,14 @@ repositories.remote << 'http://scala-tools.org/repo-releases/'
22
22
 
23
23
 
24
24
  define 'buildr' do
25
- compile.using :source=>'1.4', :target=>'1.4', :debug=>false
25
+ compile.using :source=>'1.5', :target=>'1.5', :debug=>false
26
26
 
27
27
  define 'java' do
28
28
  compile.using(:javac).from(FileList['lib/buildr/java/**/*.java']).into('lib/buildr/java')
29
29
  end
30
30
 
31
31
  define 'scala' do
32
- compile.using(:scalac).from(FileList['lib/buildr/scala/**/*.scala']).into('lib/buildr/scala')
32
+ compile.using(:javac).from(FileList['lib/buildr/scala/**/*.java']).into('lib/buildr/scala')
33
33
  end
34
34
 
35
35
  desc 'Buildr extra packages (Antlr, Cobertura, Hibernate, Javacc, JDepend, Jetty, OpenJPA, XmlBeans)'
data/buildr.gemspec CHANGED
@@ -16,11 +16,11 @@
16
16
 
17
17
  Gem::Specification.new do |spec|
18
18
  spec.name = 'buildr'
19
- spec.version = '1.3.5'
19
+ spec.version = '1.4.0'
20
20
  spec.author = 'Apache Buildr'
21
21
  spec.email = "users@buildr.apache.org"
22
22
  spec.homepage = "http://buildr.apache.org/"
23
- spec.summary = "A build system that doesn't suck"
23
+ spec.summary = "Build like you code"
24
24
  spec.description = <<-TEXT
25
25
  Apache Buildr is a build system for Java-based applications, including support
26
26
  for Scala, Groovy and a growing number of JVM languages and tools. We wanted
@@ -33,7 +33,7 @@ for those one-off tasks, with a language that's a joy to use.
33
33
  # Rakefile needs to create spec for both platforms (ruby and java), using the
34
34
  # $platform global variable. In all other cases, we figure it out from RUBY_PLATFORM.
35
35
  spec.platform = $platform || RUBY_PLATFORM[/java/] || 'ruby'
36
-
36
+
37
37
  spec.files = Dir['{addon,bin,doc,etc,lib,rakelib,spec}/**/*', '*.{gemspec,buildfile}'] +
38
38
  ['LICENSE', 'NOTICE', 'CHANGELOG', 'README.rdoc', 'Rakefile', '_buildr', '_jbuildr']
39
39
  spec.require_paths = 'lib', 'addon'
@@ -53,12 +53,13 @@ for those one-off tasks, with a language that's a joy to use.
53
53
  spec.add_dependency 'net-sftp', '2.0.2'
54
54
  spec.add_dependency 'rubyzip', '0.9.1'
55
55
  spec.add_dependency 'highline', '1.5.1'
56
- spec.add_dependency 'rubyforge', '1.0.5'
56
+ spec.add_dependency 'json_pure', '1.4.0'
57
+ spec.add_dependency 'rubyforge', '2.0.3'
57
58
  spec.add_dependency 'hoe', '2.3.3'
58
- spec.add_dependency 'rjb', '1.1.9' if spec.platform.to_s == 'ruby'
59
- spec.add_dependency 'rjb', '1.1.6' if spec.platform.to_s == 'x86-mswin32'
59
+ spec.add_dependency 'rjb', '1.2.5' if spec.platform.to_s == 'ruby'
60
+ spec.add_dependency 'rjb', '1.2.5' if spec.platform.to_s == 'x86-mswin32'
60
61
  spec.add_dependency 'Antwrap', '0.7.0'
61
- spec.add_dependency 'rspec', '1.2.8'
62
+ spec.add_dependency 'rspec', '>= 1.2.9'
62
63
  spec.add_dependency 'xml-simple', '1.0.12'
63
64
  spec.add_dependency 'archive-tar-minitar', '0.5.2'
64
65
  spec.add_dependency 'jruby-openssl', '0.5.2' if spec.platform.to_s == 'java'
@@ -15,8 +15,8 @@
15
15
  <body>
16
16
  <div id='wrap'>
17
17
  <div id='header'>
18
- <a href='http://buildr.apache.org/' title="The build system that doesn't suck"><img alt='buildr' src='images/buildr.png'></a>
19
- <div class='tagline'>The build system that doesn't suck</div>
18
+ <a href='http://buildr.apache.org/' title="Build like you code"><img alt='buildr' src='images/buildr.png'></a>
19
+ <div class='tagline'>Build like you code</div>
20
20
  </div>
21
21
  <div id='pages'>
22
22
  <ol class='toc'>
@@ -52,7 +52,7 @@ p(note). Buildr projects also define a @group@ attribute which can lead to some
52
52
  If you have several artifacts you always use together, consider placing them in an array. Methods that accept lists of artifacts also accept arrays. For example:
53
53
 
54
54
  {% highlight ruby %}
55
- OPENJPA = ['org.apache.openjpa:openjpa-all:jar:0.9.7',
55
+ OPENJPA = ['org.apache.openjpa:openjpa:jar:1.2.1',
56
56
  'net.sourceforge.serp:serp:jar:1.12.0']
57
57
  AXIS_OF_WS = [AXIS2, AXIOM]
58
58
 
@@ -125,7 +125,7 @@ You can choose to relocate the local repository by giving it a different path, f
125
125
  repositories.local = '/usr/local/maven/repository'
126
126
  {% endhighlight %}
127
127
 
128
- That's one change you don't want to commit into the Buildfile, so the best place to do it is in your home directory's @buildr.rb@ file.
128
+ That's one change you don't want to commit into the Buildfile, so the best place to do it is in the @buildr.rb@ file in the @.buildr@ directory under your home directory.
129
129
 
130
130
  Buildr downloads artifacts when it needs to use them, for example, to compile a project. You don't need to download artifacts directly. Except when you do, for example, if you want to download all the latest artifacts and then go off-line. It's as simple as:
131
131
 
@@ -139,7 +139,7 @@ h2(#downloading). Downloading Artifacts
139
139
  Within your buildfile you can download artifacts directly by invoking them, for example:
140
140
 
141
141
  {% highlight ruby %}
142
- artifact('org.apache.openjpa:openjpa-all:jar:0.9.7').invoke
142
+ artifact('org.apache.openjpa:openjpa:jar:1.2.1').invoke
143
143
  artifacts(OPENJPA).each(&:invoke)
144
144
  {% endhighlight %}
145
145
 
@@ -208,4 +208,4 @@ upload bean
208
208
  p(tip). Calling the @install@ (and likewise @upload@) method on an artifact run @buildr install@. If you need to download and install an artifact, invoke the task directly with @install(<artifact>).invoke@.
209
209
 
210
210
 
211
- Next we're going to "package some artifacts":packaging.html.
211
+ We'll talk more about installing and uploading in the next chapter, but right now we're going to "package some artifacts":packaging.html.
data/doc/building.textile CHANGED
@@ -25,7 +25,7 @@ Buildr uses file tasks to handle dependencies, but here we're talking about the
25
25
 
26
26
  An easier way to specify dependencies is by calling the @compile.with@ method. It takes a list of arguments and adds them to the dependency list. The @compile.with@ method is easier to use, it accepts several type of dependencies. You can use file names, file tasks, projects, artifacts specifications and even pass arrays of dependencies.
27
27
 
28
- Most dependencies fall into the last three categories. When you pass a project to @compile.with@, it picks up all the packages created by that project. In doing so, it establishes an order of dependency between the two projects (see "Defining the Project":projects.html#defining). For example, if you make a change in project _teh-api_ and build _teh-impl_, Buildr will detect that change, recompile and package _teh-api_ before compiling _teh-impl_. You can also select a specific package using the @package@ or @packages@ methods (see "Packaging":packaging.html).
28
+ Most dependencies fall into the last three categories. When you pass a project to @compile.with@, it picks up all the packages created by that project. In doing so, it establishes an order of dependency between the two projects (see "Defining the Project":projects.html#defining). For example, if you make a change in project _teh-api_ and build _teh-impl_, Buildr will detect that change, recompile and package _teh-api_ before compiling _teh-impl_. You can also select a specific package using the project's @package@ or @packages@ methods (see "Packaging":packaging.html).
29
29
 
30
30
  When you pass an artifact specification to @compile.with@, it creates an @Artifact@ task that will download that artifact from one of the remote repositories, install it in the local repository, and use it in your project. Rake's dependency mechanism is used here to make sure the artifact is downloaded once, when needed. Check the "Artifacts":artifacts.html section for more information about artifact specification and repositories.
31
31
 
@@ -115,7 +115,7 @@ The default source and target directories, compiler settings and other options y
115
115
  h2(#resources). Resources
116
116
 
117
117
 
118
- The @compile@ task comes bundled with a @resources@ task. It copies files from the @src/main/resources@ directory into @target/resources@. Best used for copying files that you want to included in the generated code, like configuration files, i18n messages, images, etc.
118
+ The @compile@ task comes bundled with a @resources@ task. It copies files from the @src/main/resources@ directory into @target/resources@. Best used for copying files that you want to include in the generated code, like configuration files, i18n messages, images, etc.
119
119
 
120
120
  The @resources@ task uses a filter that can change files as it copies them from source to destination. The most common use is by mapping values using a hash. For example, to substitute "${version}" for the project's version number and "${copyright}" for "Acme Inc (C) 2007" :
121
121
 
@@ -140,9 +140,10 @@ test:
140
140
  You can specify a different format by passing it as the first argument. Supported formats include:
141
141
 
142
142
  |_. Format |_. Usage |
143
- | @:ant@ | Map from @key@ to value. |
143
+ | @:ant@ | Map from <code>@key@</code> to value. |
144
144
  | @:maven@ | Map from @${key}@ to value (default). |
145
145
  | @:ruby@ | Map from @#{key}@ to value. |
146
+ | @:erb@ | Map from @<%=key%>@ to value. |
146
147
  | @Regexp@ | Map using the matched value of the regular expression (e.g. @/=(.*?)=/@). |
147
148
 
148
149
  For example, using the @:ruby@ format instead of the default @:maven@ format:
@@ -241,4 +242,35 @@ clean { rm_rf _('staged') }
241
242
 
242
243
  The @rm_rf@ method deletes the directory and all files in it. It's named after UNIX's infamous @rm -rf@. Use it wisely. This is also a good time to introduce you to @FileUtils@, a standard Ruby library that contains convenient methods for creating and deleting directories, copying and moving files, even comparing two files. They're all free of charge when you use Buildr.
243
244
 
245
+
246
+ h2(#continuous-compilation). Continuous Compilation
247
+
248
+ And if all that weren't enough, Buildr also offers a time-saving feature called continuous compilation. This feature, implemented by the @cc@ task, instructs Buildr to loop eternally, polling your project's source directories for changes. Whenever a change is detected, Buildr immediately triggers the appropriate compilation step and goes right back to polling. This allows you to reap many of the benefits of an incrementally compiling IDE like Eclipse without sacrificing your favorite build tool.
249
+
250
+ To get started, simply invoke the @cc@ task at the command prompt:
251
+
252
+ {% highlight sh %}
253
+ $ buildr cc
254
+ {% endhighlight %}
255
+
256
+ This task will immediately invoke the @compile@ and @test:compile@ tasks on your project if necessary. This ensures that your build is completely up to the minute before polling is initiated. After this initial build (if required), Buildr will print a notification indicating which directories are being monitored. By default, these directories will include any source folders (e.g. @src/main/java/@), any test directories (e.g. @src/spec/scala/@) as well as any resources (e.g. @src/main/resources/). The Buildr process will remain running during this time, meaning that in order to test this functionality, we will need to open a new shell:
257
+
258
+ {% highlight sh %}
259
+ $ touch src/main/java/Test.java
260
+ {% endhighlight %}
261
+
262
+ The moment we run this command, Buildr will detect the change and invoke the @compile@ task. It will *not* invoke the @test:compile@ task, since none of the test files were actually changed. This ensures that potentially time-consuming tasks are avoided if possible. Note that, unlike the @build@ task, the continuous compilation also does not actually run any of your tests. Continuous compilation is designed to be a simple daemon which runs forever, quickly recompiling your project as soon as you save or delete a file. We can terminate the continuous compilation task by pressing Ctrl-C. Left to its own devices, the @cc@ task really will loop forever.
263
+
264
+ There are several advantages to continuous compilation. Number one is convenience. Once you invoke the @cc@ task, you can focus exclusively on the code, editing and saving your files in an unbroken workflow. There is no need to break your concentration to invoke Buildr manually unless you need to run the test suite, deploy the application or anything beyond compilation. The second advantage is speed. By using the continuous compilation process, you avoid repeatedly incurring Buildr's startup overhead. While this startup time is kept to a minimum, it is still perceptable, particularly when running on JRuby. Since the @cc@ task runs within a Buildr instance which has already been started, there is no need for repeated, inefficient load times. Again, this allows you to focus more completely on what's really important: the code.
265
+
266
+ By default, the @cc@ task will poll your sources once every 200 milliseconds. We have found that this frequency strikes a nice balance between CPU load (which is insignificant) and nearly-instant detection. However, you may wish to tune this value based on your own needs. To do so, simply use the @cc.frequency@ property in your project definition:
267
+
268
+ {% highlight ruby %}
269
+ project 'foo' do
270
+ cc.frequency 1.5 # poll every one-and-a-half seconds
271
+ end
272
+ {% endhighlight %}
273
+
274
+ If you find that the 200 ms default imposes too much overhead, try changing @cc.frequency@ to a higher value. On the flip side, if you find that you're waiting too long for changes to be caught by the poll, tune the frequency lower.
275
+
244
276
  Now let's "talk about the artifacts":artifacts.html we mentioned before.