buildr 1.3.5-x86-mswin32 → 1.4.0-x86-mswin32
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +153 -8
- data/README.rdoc +1 -1
- data/addon/buildr/antlr.rb +5 -5
- data/addon/buildr/drb.rb +18 -18
- data/addon/buildr/hibernate.rb +18 -14
- data/addon/buildr/javacc.rb +4 -4
- data/addon/buildr/jetty.rb +5 -5
- data/addon/buildr/nailgun.rb +23 -23
- data/addon/buildr/openjpa.rb +1 -1
- data/addon/buildr/org/apache/buildr/BuildrNail$Main.class +0 -0
- data/addon/buildr/org/apache/buildr/BuildrNail.class +0 -0
- data/addon/buildr/org/apache/buildr/JettyWrapper$1.class +0 -0
- data/addon/buildr/org/apache/buildr/JettyWrapper$BuildrHandler.class +0 -0
- data/addon/buildr/org/apache/buildr/JettyWrapper.class +0 -0
- data/addon/buildr/protobuf.rb +75 -0
- data/addon/buildr/xmlbeans.rb +5 -5
- data/buildr.buildfile +2 -2
- data/buildr.gemspec +8 -7
- data/doc/_layouts/default.html +2 -2
- data/doc/artifacts.textile +4 -4
- data/doc/building.textile +35 -3
- data/doc/contributing.textile +5 -0
- data/doc/download.textile +16 -5
- data/doc/extending.textile +38 -12
- data/doc/installing.textile +6 -5
- data/doc/languages.textile +182 -42
- data/doc/more_stuff.textile +2 -2
- data/doc/packaging.textile +14 -15
- data/doc/projects.textile +7 -2
- data/doc/quick_start.textile +4 -4
- data/doc/scripts/buildr-git.rb +63 -63
- data/doc/scripts/gitflow.rb +21 -21
- data/doc/settings_profiles.textile +9 -2
- data/doc/testing.textile +16 -5
- data/etc/KEYS +38 -0
- data/lib/buildr.rb +1 -1
- data/lib/buildr/core.rb +1 -0
- data/lib/buildr/core/application.rb +33 -27
- data/lib/buildr/core/build.rb +41 -28
- data/lib/buildr/core/cc.rb +172 -0
- data/lib/buildr/core/checks.rb +1 -1
- data/lib/buildr/core/common.rb +7 -6
- data/lib/buildr/core/compile.rb +7 -8
- data/lib/buildr/core/doc.rb +263 -0
- data/lib/buildr/core/environment.rb +6 -6
- data/lib/buildr/core/filter.rb +77 -35
- data/lib/buildr/core/generate.rb +7 -7
- data/lib/buildr/core/help.rb +1 -1
- data/lib/buildr/core/osx.rb +6 -6
- data/lib/buildr/core/progressbar.rb +4 -4
- data/lib/buildr/core/project.rb +144 -36
- data/lib/buildr/core/shell.rb +34 -34
- data/lib/buildr/core/test.rb +89 -20
- data/lib/buildr/core/transports.rb +8 -7
- data/lib/buildr/core/util.rb +77 -23
- data/lib/buildr/groovy/bdd.rb +5 -5
- data/lib/buildr/groovy/compiler.rb +19 -15
- data/lib/buildr/groovy/shell.rb +6 -6
- data/lib/buildr/ide/eclipse.rb +148 -75
- data/lib/buildr/ide/eclipse/java.rb +3 -3
- data/lib/buildr/ide/eclipse/plugin.rb +8 -5
- data/lib/buildr/ide/eclipse/scala.rb +4 -2
- data/lib/buildr/ide/idea.rb +2 -2
- data/lib/buildr/ide/idea7x.rb +23 -4
- data/lib/buildr/java.rb +1 -0
- data/lib/buildr/java/ant.rb +4 -4
- data/lib/buildr/java/bdd.rb +51 -54
- data/lib/buildr/java/cobertura.rb +57 -35
- data/lib/buildr/java/commands.rb +14 -5
- data/lib/buildr/java/compiler.rb +3 -217
- data/lib/buildr/java/deprecated.rb +4 -4
- data/lib/buildr/java/doc.rb +70 -0
- data/lib/buildr/java/emma.rb +22 -22
- data/lib/buildr/java/jruby.rb +4 -4
- data/lib/buildr/java/jtestr_runner.rb.erb +27 -25
- data/lib/buildr/java/org/apache/buildr/JavaTestFilter.class +0 -0
- data/lib/buildr/java/org/apache/buildr/JavaTestFilter.java +8 -3
- data/lib/buildr/java/packaging.rb +30 -29
- data/lib/buildr/java/pom.rb +4 -4
- data/lib/buildr/java/rjb.rb +6 -6
- data/lib/buildr/java/test_result.rb +61 -85
- data/lib/buildr/java/tests.rb +44 -27
- data/lib/buildr/java/version_requirement.rb +8 -8
- data/lib/buildr/packaging/archive.rb +55 -22
- data/lib/buildr/packaging/artifact.rb +75 -36
- data/lib/buildr/packaging/artifact_namespace.rb +90 -78
- data/lib/buildr/packaging/artifact_search.rb +5 -5
- data/lib/buildr/packaging/gems.rb +11 -7
- data/lib/buildr/packaging/package.rb +10 -7
- data/lib/buildr/packaging/tar.rb +14 -14
- data/lib/buildr/packaging/version_requirement.rb +30 -10
- data/lib/buildr/packaging/ziptask.rb +51 -13
- data/lib/buildr/scala.rb +1 -0
- data/lib/buildr/scala/bdd.rb +25 -20
- data/lib/buildr/scala/compiler.rb +87 -40
- data/lib/buildr/scala/doc.rb +106 -0
- data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class +0 -0
- data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java +57 -0
- data/lib/buildr/scala/shell.rb +14 -9
- data/lib/buildr/scala/tests.rb +33 -26
- data/lib/buildr/shell.rb +33 -33
- data/rakelib/all-in-one.rake +113 -0
- data/rakelib/checks.rake +1 -1
- data/rakelib/doc.rake +7 -0
- data/rakelib/package.rake +1 -1
- data/rakelib/release.rake +9 -6
- data/rakelib/rspec.rake +26 -7
- data/rakelib/setup.rake +15 -3
- data/rakelib/stage.rake +18 -11
- data/spec/addon/drb_spec.rb +25 -25
- data/spec/core/application_spec.rb +111 -21
- data/spec/core/build_spec.rb +16 -15
- data/spec/core/cc_spec.rb +174 -0
- data/spec/core/checks_spec.rb +34 -34
- data/spec/core/common_spec.rb +51 -5
- data/spec/core/compile_spec.rb +89 -14
- data/spec/core/extension_spec.rb +127 -19
- data/spec/core/generate_spec.rb +2 -2
- data/spec/core/project_spec.rb +10 -10
- data/spec/core/test_spec.rb +144 -35
- data/spec/core/transport_spec.rb +8 -8
- data/spec/core/util_spec.rb +63 -5
- data/spec/groovy/bdd_spec.rb +5 -5
- data/spec/groovy/compiler_spec.rb +29 -18
- data/spec/ide/eclipse_spec.rb +185 -9
- data/spec/ide/idea7x_spec.rb +22 -10
- data/spec/java/ant_spec.rb +9 -5
- data/spec/java/bdd_spec.rb +29 -37
- data/spec/java/cobertura_spec.rb +12 -12
- data/spec/java/commands_spec.rb +34 -0
- data/spec/java/compiler_spec.rb +53 -53
- data/spec/java/emma_spec.rb +11 -11
- data/spec/java/java_spec.rb +10 -10
- data/spec/java/packaging_spec.rb +67 -20
- data/spec/java/test_coverage_helper.rb +18 -18
- data/spec/java/tests_spec.rb +13 -9
- data/spec/packaging/archive_spec.rb +187 -20
- data/spec/packaging/artifact_namespace_spec.rb +172 -83
- data/spec/packaging/artifact_spec.rb +83 -18
- data/spec/packaging/packaging_spec.rb +41 -14
- data/spec/sandbox.rb +23 -12
- data/spec/scala/bdd_spec.rb +13 -8
- data/spec/scala/compiler_spec.rb +18 -13
- data/spec/scala/scala.rb +3 -3
- data/spec/scala/tests_spec.rb +46 -24
- data/spec/spec_helpers.rb +28 -10
- data/spec/version_requirement_spec.rb +25 -11
- metadata +149 -133
- data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner$.class +0 -0
- data/lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.scala +0 -35
- data/rakelib/stage.rake~ +0 -213
data/doc/more_stuff.textile
CHANGED
@@ -280,7 +280,7 @@ Buildr.application.on_failure do |title, message, ex|
|
|
280
280
|
end
|
281
281
|
{% endhighlight %}
|
282
282
|
|
283
|
-
You can place this code inside @buildr.rb@ in your home directory.
|
283
|
+
You can place this code inside @buildr.rb@ in the @.buildr@ directory under your home directory.
|
284
284
|
|
285
285
|
h2(#eclipse). Eclipse
|
286
286
|
|
@@ -390,7 +390,7 @@ require 'buildr/java/emma'
|
|
390
390
|
require 'buildr/jdepend'
|
391
391
|
{% endhighlight %}
|
392
392
|
|
393
|
-
You may want to add those to the Buildfile. Alternatively, you can use these tasks for all your projects without modifying the Buildfile. One convenient method is to add these lines to the @buildr.rb@ file in your home directory.
|
393
|
+
You may want to add those to the Buildfile. Alternatively, you can use these tasks for all your projects without modifying the Buildfile. One convenient method is to add these lines to the @buildr.rb@ file in the @.buildr@ directory under your home directory.
|
394
394
|
|
395
395
|
Another option is to require it from the command line (@--require@ or @-r@), for example:
|
396
396
|
|
data/doc/packaging.textile
CHANGED
@@ -101,22 +101,21 @@ The @include@ method accepts files, directories and file tasks. You can also us
|
|
101
101
|
And the same way you @include@, you can also @exclude@ specific files you don't want showing up in the ZIP. For example, to exclude @.draft@ and @.raw@ files:
|
102
102
|
|
103
103
|
{% highlight ruby %}
|
104
|
-
package(:zip).include('target/docs').
|
105
|
-
exclude('target/docs/**/*.{draft,raw}')
|
104
|
+
package(:zip).include(_('target/docs')).exclude('*.draft', '*.raw')
|
106
105
|
{% endhighlight %}
|
107
106
|
|
108
107
|
So far we've included files under the root of the ZIP. Let's include some files under a given path using the @:path@ option:
|
109
108
|
|
110
109
|
{% highlight ruby %}
|
111
|
-
package(:zip).include 'target/docs', :path=>"#{id}-#{version}"
|
110
|
+
package(:zip).include _('target/docs'), :path=>"#{id}-#{version}"
|
112
111
|
{% endhighlight %}
|
113
112
|
|
114
113
|
If you need to use the @:path@ option repeatedly, consider using the @tap@ method instead. For example:
|
115
114
|
|
116
115
|
{% highlight ruby %}
|
117
116
|
package(:zip).path("#{id}-#{version}").tap do |path|
|
118
|
-
path.include 'target/docs'
|
119
|
-
path.include 'README'
|
117
|
+
path.include _('target/docs')
|
118
|
+
path.include _('README')
|
120
119
|
end
|
121
120
|
{% endhighlight %}
|
122
121
|
|
@@ -127,33 +126,33 @@ p(note). To allow you to spread files across different paths, the include/exclud
|
|
127
126
|
If you need to include a file or directory under a different name, use the @:as@ option. For example:
|
128
127
|
|
129
128
|
{% highlight ruby %}
|
130
|
-
package(:zip).include('corporate-logo-350x240.png', :as=>'logo.png')
|
129
|
+
package(:zip).include(_('corporate-logo-350x240.png'), :as=>'logo.png')
|
131
130
|
{% endhighlight %}
|
132
131
|
|
133
132
|
You can also use @:as=>'.'@ to include all files from the given directory. For example:
|
134
133
|
|
135
134
|
{% highlight ruby %}
|
136
|
-
package(:zip).include 'target/docs/*'
|
137
|
-
package(:zip).include 'target/docs', :as=>'.'
|
135
|
+
package(:zip).include _('target/docs/*')
|
136
|
+
package(:zip).include _('target/docs'), :as=>'.'
|
138
137
|
{% endhighlight %}
|
139
138
|
|
140
|
-
These two
|
139
|
+
These two perform identically. They both include all the files from the @target/docs@ directory, but not the directory itself, and they are both lazy, meaning that the files can be created later and they will still get packaged into the zip package.
|
141
140
|
|
142
|
-
For example, when @package :jar
|
141
|
+
For example, when you use @package :jar@, under the hood it specifies to include all the files from @target/classes@ with @:as=>'.'@. Even though this happens during project definition and nothing has been compiled yet (and in fact @target/classes@ may not even exist yet), the .class files generated during compilation are still packaged in the .jar file, as expected.
|
143
142
|
|
144
143
|
If you need to get rid of all the included files, call the @clean@ method. Some packaging types default to adding various files and directories, for example, JAR packaging will include all the compiled classes and resources.
|
145
144
|
|
146
145
|
You can also merge two ZIP files together, expanding the content of one ZIP into the other. For example:
|
147
146
|
|
148
147
|
{% highlight ruby %}
|
149
|
-
package(:zip).merge 'part1.zip', 'part2.zip'
|
148
|
+
package(:zip).merge _('part1.zip'), _('part2.zip')
|
150
149
|
{% endhighlight %}
|
151
150
|
|
152
151
|
If you need to be more selective, you can apply the include/exclude pattern to the expanded ZIP. For example:
|
153
152
|
|
154
153
|
{% highlight ruby %}
|
155
154
|
# Everything but the libs
|
156
|
-
package(:zip).merge('bigbad.war').exclude('libs/**/*')
|
155
|
+
package(:zip).merge(_('bigbad.war')).exclude('libs/**/*')
|
157
156
|
{% endhighlight %}
|
158
157
|
|
159
158
|
|
@@ -257,7 +256,7 @@ If you already have WSDL files in the @src/main/axis2@ directory but would like
|
|
257
256
|
{% highlight ruby %}
|
258
257
|
# Host name depends on environment.
|
259
258
|
host = ENV['ENV'] == 'test' ? 'test.host' : 'ws.example.com'
|
260
|
-
filter.from('src/main/axis2').into(
|
259
|
+
filter.from(_('src/main/axis2')).into(_(:target)).
|
261
260
|
include('services.xml', '==*==.wsdl').using('http_port'=>'8080', 'http_host'=>host)
|
262
261
|
package(:aar).wsdls.clear
|
263
262
|
package(:aar).with(:services_xml=>_('target/services.xml'), :wsdls=>_('target/==*==.wsdl'))
|
@@ -404,11 +403,11 @@ package :sources
|
|
404
403
|
|
405
404
|
This one creates a ZIP package with the classifier "sources" that will contain all the source directories in that project, typically @src/main/java@, but also other sources generated from Apt, JavaCC, XMLBeans and friends.
|
406
405
|
|
407
|
-
You can also generate a ZIP package with the classifier "javadoc" that contains the JavaDoc documentation for the project. It uses the same set of documentation files generated by the project's @
|
406
|
+
You can also generate a ZIP package with the classifier "javadoc" that contains the JavaDoc documentation for the project. It uses the same set of documentation files generated by the project's @doc@ task, so you can use it in combination with the @doc@ method. For example:
|
408
407
|
|
409
408
|
{% highlight ruby %}
|
410
409
|
package :javadoc
|
411
|
-
|
410
|
+
doc :windowtitle=>'Buggy but Works'
|
412
411
|
{% endhighlight %}
|
413
412
|
|
414
413
|
By default Buildr picks the project's description for the window title.
|
data/doc/projects.textile
CHANGED
@@ -13,7 +13,9 @@ Feed it a project definition, and Buildr will set up all these tasks for you. Th
|
|
13
13
|
The remainder of this guide deals with what it takes to build a project. But first, let's pick up a sample project to work with. We'll call it _killer-app_:
|
14
14
|
|
15
15
|
{% highlight ruby %}
|
16
|
-
require
|
16
|
+
require "buildr/openjpa"
|
17
|
+
|
18
|
+
include Buildr::OpenJPA
|
17
19
|
|
18
20
|
VERSION_NUMBER = '1.0'
|
19
21
|
|
@@ -90,7 +92,7 @@ When you start with a new project you won't see the @target@ or @reports@ direct
|
|
90
92
|
|
91
93
|
h2(#naming). Naming And Finding Projects
|
92
94
|
|
93
|
-
Each project has a given name, the first argument you pass when calling @define@. The project name is just a string, but we advise to stay clear of colon (@:@) and slashes (@/@ and @\@), which could conflict with other task and file names. Also, avoid using common Buildr task names, don't pick @compile
|
95
|
+
Each project has a given name, the first argument you pass when calling @define@. The project name is just a string, but we advise to stay clear of colon (@:@) and slashes (@/@ and @\@), which could conflict with other task and file names. Also, avoid using common Buildr task names, don't pick @compile@, @build@ or any existing task name for your project name.
|
94
96
|
|
95
97
|
Since each project knows its parent project, child projects and siblings, you can reference them from within the project using just the given name. In other cases, you'll need to use the full name. The full name is just @parent:child@. So if you wanted to refer to _teh-impl_, you could do so with either @project('killer-app:teh-impl')@ or @project('killer-app').project('teh-impl')@.
|
96
98
|
|
@@ -201,6 +203,9 @@ For example:
|
|
201
203
|
# Relative to the current project
|
202
204
|
path_to('src', 'main', 'java')
|
203
205
|
|
206
|
+
# the same using symbols
|
207
|
+
path_to(:src, :main, :java)
|
208
|
+
|
204
209
|
# Exactly the same thing
|
205
210
|
_('src/main/java')
|
206
211
|
|
data/doc/quick_start.textile
CHANGED
@@ -169,7 +169,7 @@ If there is one area in which Buildr excels, it is defining custom tasks. This
|
|
169
169
|
define 'killer-app' do
|
170
170
|
project.version = '0.1.0'
|
171
171
|
package :jar
|
172
|
-
|
172
|
+
|
173
173
|
task :run => :compile do
|
174
174
|
system 'java -cp target/classes org.apache.killer.Main'
|
175
175
|
end
|
@@ -185,13 +185,13 @@ $ buildr killer-app:run
|
|
185
185
|
This works, but it's clumsy. The reason we had to give the "@killer-app:@" prefix is because we defined the @run@ task _within_ our project, rather than outside of the @define@ block. However, if we define @run@ outside of the project, then we don't really have access to the @compile@ task (which is project-specific). The solution here is a bit of magic known as @local_task@. This is how tasks like @compile@ and @test@, which are technically project-specific (think: instance methods) can be invoked without the fully-qualified project name:
|
186
186
|
|
187
187
|
{% highlight ruby %}
|
188
|
-
local_task :run
|
188
|
+
Project.local_task :run
|
189
189
|
|
190
190
|
define 'killer-app' do
|
191
191
|
project.version '0.1.0'
|
192
|
-
|
192
|
+
|
193
193
|
package :jar
|
194
|
-
|
194
|
+
|
195
195
|
task :run => :compile do
|
196
196
|
system 'java -cp target/classes org.apache.killer.Main'
|
197
197
|
end
|
data/doc/scripts/buildr-git.rb
CHANGED
@@ -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
|