buildr 1.4.15-java → 1.4.16-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG +33 -0
- data/README.rdoc +4 -7
- data/_buildr +0 -0
- data/_jbuildr +0 -0
- data/addon/buildr/checkstyle.rb +3 -1
- data/addon/buildr/git_auto_version.rb +3 -2
- data/addon/buildr/gpg.rb +1 -1
- data/addon/buildr/gwt.rb +54 -11
- data/addon/buildr/jacoco.rb +34 -0
- data/addon/buildr/pmd.rb +2 -2
- data/addon/buildr/wsgen.rb +11 -3
- data/buildr.buildfile +1 -1
- data/buildr.gemspec +1 -1
- data/doc/contributing.textile +4 -18
- data/doc/download.textile +19 -7
- data/doc/index.textile +15 -50
- data/doc/scripts/install-jruby.sh +0 -0
- data/doc/scripts/install-linux.sh +0 -0
- data/doc/scripts/install-osx.sh +0 -0
- data/lib/buildr/ide/idea.rb +19 -2
- data/lib/buildr/version.rb +1 -1
- data/rakelib/release.rake +9 -12
- data/rakelib/stage.rake +3 -5
- data/spec/core/extension_spec.rb +0 -0
- metadata +3 -6
- data/doc/scripts/buildr-git.rb +0 -512
- data/doc/scripts/gitflow.rb +0 -296
- data/lib/buildr/scala/org/apache/buildr/Specs2Runner.class +0 -0
File without changes
|
File without changes
|
data/doc/scripts/install-osx.sh
CHANGED
File without changes
|
data/lib/buildr/ide/idea.rb
CHANGED
@@ -56,12 +56,12 @@ module Buildr #:nodoc:
|
|
56
56
|
document.write(f, -1, false, true)
|
57
57
|
end
|
58
58
|
|
59
|
-
protected
|
60
|
-
|
61
59
|
def name
|
62
60
|
"#{self.id}#{suffix}"
|
63
61
|
end
|
64
62
|
|
63
|
+
protected
|
64
|
+
|
65
65
|
def relative(path)
|
66
66
|
::Buildr::Util.relative_path(File.expand_path(path.to_s), self.base_directory)
|
67
67
|
end
|
@@ -677,6 +677,7 @@ module Buildr #:nodoc:
|
|
677
677
|
end
|
678
678
|
|
679
679
|
def add_sql_server_data_source(name, options = {})
|
680
|
+
default_url = nil
|
680
681
|
if options[:url].nil? && options[:database]
|
681
682
|
default_url = "jdbc:jtds:sqlserver://#{(options[:host] || "127.0.0.1")}:#{(options[:port] || "1433")}/#{options[:database]}"
|
682
683
|
end
|
@@ -688,6 +689,15 @@ module Buildr #:nodoc:
|
|
688
689
|
:dialect => 'TSQL',
|
689
690
|
:classpath => ['net.sourceforge.jtds:jtds:jar:1.2.7']
|
690
691
|
}.merge(options)
|
692
|
+
|
693
|
+
if params[:url]
|
694
|
+
if /jdbc\:jtds\:sqlserver\:\/\/[^:\\]+(\:\d+)?\/([^;]*)(\;.*)?/ =~ params[:url]
|
695
|
+
database_name = $2
|
696
|
+
params[:schema_pattern] = "#{database_name}.*"
|
697
|
+
params[:default_schemas] = "#{database_name}.*"
|
698
|
+
end
|
699
|
+
end
|
700
|
+
|
691
701
|
add_data_source(name, params)
|
692
702
|
end
|
693
703
|
|
@@ -705,6 +715,9 @@ module Buildr #:nodoc:
|
|
705
715
|
xml.tag!("jdbc-url", options[:url]) if options[:url]
|
706
716
|
xml.tag!("user-name", options[:username]) if options[:username]
|
707
717
|
xml.tag!("user-password", encrypt(options[:password])) if options[:password]
|
718
|
+
xml.tag!("schema-pattern", options[:schema_pattern]) if options[:schema_pattern]
|
719
|
+
xml.tag!("default-schemas", options[:default_schemas]) if options[:default_schemas]
|
720
|
+
xml.tag!("table-pattern", options[:table_pattern]) if options[:table_pattern]
|
708
721
|
xml.tag!("default-dialect", options[:dialect]) if options[:dialect]
|
709
722
|
|
710
723
|
xml.libraries do |xml|
|
@@ -1073,6 +1086,10 @@ module Buildr #:nodoc:
|
|
1073
1086
|
end
|
1074
1087
|
mv temp_filename, ideafile.filename
|
1075
1088
|
end
|
1089
|
+
if project.ipr?
|
1090
|
+
filename = project._("#{project.ipr.name}.ids")
|
1091
|
+
rm_rf filename if File.exists?(filename)
|
1092
|
+
end
|
1076
1093
|
end
|
1077
1094
|
|
1078
1095
|
project.task("idea:clean") do
|
data/lib/buildr/version.rb
CHANGED
data/rakelib/release.rake
CHANGED
@@ -76,19 +76,16 @@ task 'release' => %w{setup-local-site-svn} do
|
|
76
76
|
puts '[X] Pushed gems to Rubyforge.org'
|
77
77
|
end.call
|
78
78
|
|
79
|
-
# Create an
|
79
|
+
# Create an tag for this release.
|
80
80
|
lambda do
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
puts 'Could not create tag, please do it yourself!'
|
90
|
-
puts %{ svn copy #{url} #{new_url} -m "Release #{spec.version}"}
|
91
|
-
end
|
81
|
+
version = `git describe --tags --always`.strip
|
82
|
+
unless version == spec.version
|
83
|
+
sh 'git', 'tag', '-a', '-m', "Release #{spec.version}" do |ok, res|
|
84
|
+
if ok
|
85
|
+
puts "[X] Tagged this release as #{spec.version} ... "
|
86
|
+
else
|
87
|
+
puts 'Could not create tag, please do it yourself!'
|
88
|
+
puts %{ git tag -a -m "Release #{spec.version}" }
|
92
89
|
end
|
93
90
|
end
|
94
91
|
end
|
data/rakelib/stage.rake
CHANGED
@@ -42,12 +42,10 @@ task 'prepare' do |task, args|
|
|
42
42
|
# Make sure we're doing a release from checked code.
|
43
43
|
lambda do
|
44
44
|
puts 'Checking there are no local changes ... '
|
45
|
-
svn = `svn status`
|
46
|
-
fail "Cannot release unless all local changes are in SVN:\n#{svn}" unless svn.empty?
|
47
45
|
git = `git status -s`
|
48
|
-
fail "Cannot release unless all local changes are in Git:\n#{git}"
|
46
|
+
fail "Cannot release unless all local changes are in Git:\n#{git}" unless git.empty?
|
49
47
|
puts '[X] There are no local changes, everything is in source control'
|
50
|
-
end.call
|
48
|
+
end.call
|
51
49
|
|
52
50
|
# Make sure we have a valid CHANGELOG entry for this release.
|
53
51
|
lambda do
|
@@ -93,7 +91,7 @@ task 'prepare' do |task, args|
|
|
93
91
|
rubyforge = RubyForge.new.configure
|
94
92
|
rubyforge.login
|
95
93
|
rubyforge.scrape_project(spec.name)
|
96
|
-
end.call
|
94
|
+
end.call
|
97
95
|
|
98
96
|
raise "Can not run stage process under jruby" if RUBY_PLATFORM[/java/]
|
99
97
|
raise "Can not run staging process under older rubies" unless RUBY_VERSION >= '1.9'
|
data/spec/core/extension_spec.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buildr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.16
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Apache Buildr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -451,8 +451,6 @@ files:
|
|
451
451
|
- doc/projects.textile
|
452
452
|
- doc/quick_start.textile
|
453
453
|
- doc/releasing.textile
|
454
|
-
- doc/scripts/buildr-git.rb
|
455
|
-
- doc/scripts/gitflow.rb
|
456
454
|
- doc/scripts/install-jruby.sh
|
457
455
|
- doc/scripts/install-linux.sh
|
458
456
|
- doc/scripts/install-osx.sh
|
@@ -529,7 +527,6 @@ files:
|
|
529
527
|
- lib/buildr/scala/bdd.rb
|
530
528
|
- lib/buildr/scala/compiler.rb
|
531
529
|
- lib/buildr/scala/doc.rb
|
532
|
-
- lib/buildr/scala/org/apache/buildr/Specs2Runner.class
|
533
530
|
- lib/buildr/scala/org/apache/buildr/Specs2Runner.java
|
534
531
|
- lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.class
|
535
532
|
- lib/buildr/scala/org/apache/buildr/SpecsSingletonRunner.java
|
@@ -620,7 +617,7 @@ rdoc_options:
|
|
620
617
|
- --main
|
621
618
|
- README.rdoc
|
622
619
|
- --webcvs
|
623
|
-
-
|
620
|
+
- https://github.com/apache/buildr
|
624
621
|
require_paths:
|
625
622
|
- lib
|
626
623
|
- addon
|
data/doc/scripts/buildr-git.rb
DELETED
@@ -1,512 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# Licensed to the Apache Software Foundation (ASF) under one or more
|
3
|
-
# contributor license agreements. See the NOTICE file distributed with this
|
4
|
-
# work for additional information regarding copyright ownership. The ASF
|
5
|
-
# licenses this file to you under the Apache License, Version 2.0 (the
|
6
|
-
# "License"); you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
13
|
-
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
14
|
-
# License for the specific language governing permissions and limitations under
|
15
|
-
# the License.
|
16
|
-
|
17
|
-
|
18
|
-
# This script helps buildr developers to obtain their own git clone from
|
19
|
-
# github, and also provides GitFlow commands to keep the git mirror in sync
|
20
|
-
# with Apache SVN.
|
21
|
-
#
|
22
|
-
# If you already have a buildr clone, just do the following:
|
23
|
-
#
|
24
|
-
# git config alias.apache '!'"ruby $PWD/doc/scripts/buildr-git.rb"
|
25
|
-
#
|
26
|
-
# After this, you have a 'git apache' command and you can try (be sure to read the help)
|
27
|
-
#
|
28
|
-
# git apache help
|
29
|
-
# git apache setup svn --help
|
30
|
-
# git apache sync --help
|
31
|
-
#
|
32
|
-
# To configure your local repo for svn synchronization,
|
33
|
-
#
|
34
|
-
# git apache update-authors
|
35
|
-
# git remote add upstream git@github.com:buildr/buildr.git
|
36
|
-
# git apache setup svn --username apacheLogin --apache-git upstream
|
37
|
-
# git apache sync
|
38
|
-
#
|
39
|
-
# This script can also be run without having a local buildr clone:
|
40
|
-
#
|
41
|
-
# ruby -ropen-uri -e 'eval(open("http://svn.apache.org/viewvc/buildr/trunk/doc/scripts/buildr-git.rb?view=co").read)' help
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
require 'yaml'
|
46
|
-
require 'open-uri'
|
47
|
-
|
48
|
-
if $0 == '-e' # invoked from open-uri
|
49
|
-
gitflow = "http://svn.apache.org/viewvc/buildr/trunk/doc/scripts/gitflow.rb?view=co"
|
50
|
-
eval(open(gitflow).read)
|
51
|
-
else
|
52
|
-
require File.expand_path('gitflow', File.dirname(__FILE__))
|
53
|
-
end
|
54
|
-
|
55
|
-
GitFlow.program = 'buildr-git'
|
56
|
-
|
57
|
-
module BuildrGit
|
58
|
-
|
59
|
-
class UpdateUsersCommand < GitFlow/'update-users'
|
60
|
-
|
61
|
-
@help = "Update list of Apache SVN committers from Jukka's list."
|
62
|
-
@@url = 'http://people.apache.org/~jukka/authors.txt'
|
63
|
-
|
64
|
-
def self.authors_file
|
65
|
-
File.expand_path('.git/authors.txt', Dir.pwd)
|
66
|
-
end
|
67
|
-
|
68
|
-
def self.user_email(apache_login, authors_file = nil)
|
69
|
-
authors_file ||= self.authors_file
|
70
|
-
authors = YAML.load(File.read(authors_file).gsub!(/\s+=\s+/, ': '))
|
71
|
-
contact = authors[apache_login]
|
72
|
-
fail "You are not listed as apache commiter on #{authors_file}" unless contact
|
73
|
-
fail "Not a valid contact line: #{contact}" unless contact =~ /\s+<(.*)>/
|
74
|
-
[$`, $1]
|
75
|
-
end
|
76
|
-
|
77
|
-
def options(opts)
|
78
|
-
opts.url = @@url
|
79
|
-
opts.file = self.class.authors_file
|
80
|
-
[['-u', '--url URL',
|
81
|
-
"From URL. defaults to: #{opts.url}", lambda { |url|
|
82
|
-
opts.url = url
|
83
|
-
}],
|
84
|
-
['-f', '--file FILE',
|
85
|
-
"Write to FILE, defaults to #{opts.file}", lambda { |path|
|
86
|
-
opts.file = path
|
87
|
-
}]
|
88
|
-
]
|
89
|
-
end
|
90
|
-
|
91
|
-
def execute(opts, argv)
|
92
|
-
FileUtils.mkdir_p(File.dirname(opts.file))
|
93
|
-
content = open(opts.url).read
|
94
|
-
File.open(opts.file, "w") { |f| f.print content }
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
class CloneCommand < GitFlow/:clone
|
99
|
-
@help = "Create a clone from github.com/buildr repository."
|
100
|
-
|
101
|
-
def options(opts)
|
102
|
-
opts.origin = 'git://github.com/buildr/buildr.git'
|
103
|
-
opts.svn_prefix = 'apache'
|
104
|
-
opts.project = 'buildr'
|
105
|
-
opts.local = expand_path(opts.project)
|
106
|
-
[['--prefix SVN_PREFIX', opts.svn_prefix, lambda { |p|
|
107
|
-
opts.svn_prefix = p }],
|
108
|
-
['--origin GIT_ORIGIN', opts.origin, lambda { |o|
|
109
|
-
opts.origin = o }],
|
110
|
-
['-d', '--dir DIR', opts.local, lambda { |d| opts.local = d }]
|
111
|
-
]
|
112
|
-
end
|
113
|
-
|
114
|
-
def execute(opts, argv)
|
115
|
-
git 'clone', opts.origin, opts.local
|
116
|
-
Dir.chdir(opts.local) do
|
117
|
-
run 'update-users'
|
118
|
-
run 'setup'
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
class SetupCommand < GitFlow/:setup
|
124
|
-
@help = "Setup your buildr clone to be used with git mirror."
|
125
|
-
def options(opt)
|
126
|
-
[]
|
127
|
-
end
|
128
|
-
|
129
|
-
def execute(opt, argv)
|
130
|
-
run 'setup', 'alias'
|
131
|
-
run 'setup', 'svn'
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
135
|
-
class SetupAliasCommand < SetupCommand/:alias
|
136
|
-
def execute(opt, argv)
|
137
|
-
me = expand_path('doc/scripts/buildr-git.rb')
|
138
|
-
git 'config', 'alias.apache', "!ruby #{me}"
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
class SetupSvnCommand < SetupCommand/:svn
|
143
|
-
@help = "Setup for getting changes from Apache SVN."
|
144
|
-
|
145
|
-
def options(opt)
|
146
|
-
opt.svn_prefix = 'apache'
|
147
|
-
opt.svn_path = 'buildr'
|
148
|
-
opt.townhall = 'origin'
|
149
|
-
[['--username SVN_USER', 'Use Apache svn username for this svn remote',
|
150
|
-
lambda { |e| opt.apache_login = e }],
|
151
|
-
['--svn-prefix PREFIX', 'The name of svn remote to use for project.',
|
152
|
-
"Defaults to #{opt.svn_prefix}",
|
153
|
-
lambda{|p| opt.svn_prefix = p }],
|
154
|
-
['--svn-uri URI', lambda {|p| opt.svn_uri = p }],
|
155
|
-
['--svn-rev REVISION', lambda {|p| opt.svn_rev = p }],
|
156
|
-
['--svn-path PATH', 'The path to append to svn-uri.',
|
157
|
-
"Defaults to #{opt.svn_path}", lambda {|p| opt.svn_path = p }],
|
158
|
-
['--apache-git REMOTE', 'The name of remote you are using as town-hall git repo.',
|
159
|
-
"Defaults to #{opt.townhall}",
|
160
|
-
lambda {|p| opt.townhall = p }]
|
161
|
-
]
|
162
|
-
end
|
163
|
-
|
164
|
-
def execute(opt, argv)
|
165
|
-
authors_file = UpdateUsersCommand.authors_file
|
166
|
-
git 'config', 'svn.authorsfile', authors_file
|
167
|
-
git 'config', 'apache.svn', opt.svn_prefix
|
168
|
-
git 'config', 'apache.git', opt.townhall
|
169
|
-
|
170
|
-
if opt.apache_login
|
171
|
-
user, email = UpdateUsersCommand.user_email(opt.apache_login, authors_file)
|
172
|
-
puts "You claim to be #{user} <#{email}> with apache login: #{opt.apache_login}"
|
173
|
-
git('config', 'user.name', user)
|
174
|
-
git('config', 'user.email', email)
|
175
|
-
end
|
176
|
-
|
177
|
-
if opt.svn_rev
|
178
|
-
revision = opt.svn_rev
|
179
|
-
else
|
180
|
-
location, revision = svn_loc_rev
|
181
|
-
revision = opt.svn_rev || revision
|
182
|
-
end
|
183
|
-
|
184
|
-
if opt.svn_uri
|
185
|
-
repo = opt.svn_uri
|
186
|
-
else
|
187
|
-
fail "No #{opt.svn_path} directory on #{location}" unless
|
188
|
-
location =~ /\/#{opt.svn_path}/
|
189
|
-
repo = $`
|
190
|
-
end
|
191
|
-
|
192
|
-
# Tell git where the svn repository is
|
193
|
-
git('config', "svn-remote.#{opt.svn_prefix}.url", repo)
|
194
|
-
git('config', "svn-remote.#{opt.svn_prefix}.fetch",
|
195
|
-
"#{opt.svn_path}/trunk:refs/remotes/#{opt.svn_prefix}/trunk")
|
196
|
-
git('config', "svn-remote.#{opt.svn_prefix}.branches",
|
197
|
-
"#{opt.svn_path}/branches/*:refs/remotes/#{opt.svn_prefix}/*")
|
198
|
-
git('config', "svn-remote.#{opt.svn_prefix}.tags",
|
199
|
-
"#{opt.svn_path}/tags/*:refs/remotes/#{opt.svn_prefix}/tags/*")
|
200
|
-
|
201
|
-
# Store the user for svn dcommit
|
202
|
-
if opt.apache_login
|
203
|
-
git('config', "svn-remote.#{opt.svn_prefix}.username", opt.apache_login)
|
204
|
-
end
|
205
|
-
|
206
|
-
# Create the svn branch, do this instead of pulling the full svn history
|
207
|
-
git('update-ref', "refs/remotes/#{opt.svn_prefix}/trunk",
|
208
|
-
'refs/remotes/origin/master')
|
209
|
-
# create tags from git
|
210
|
-
git('tag').split.each do |tag|
|
211
|
-
git('update-ref', "refs/remotes/#{opt.svn_prefix}/tags/#{tag}",
|
212
|
-
"refs/tags/#{tag}")
|
213
|
-
end
|
214
|
-
# update svn metadata
|
215
|
-
mkdir_p(expand_path('.git/svn'))
|
216
|
-
svn_meta = expand_path('.git/svn/.metadata')
|
217
|
-
git('config', '--file', svn_meta,
|
218
|
-
"svn-remote.#{opt.svn_prefix}.branches-maxRev", revision)
|
219
|
-
git('config', '--file', svn_meta,
|
220
|
-
"svn-remote.#{opt.svn_prefix}.tags-maxRev", revision)
|
221
|
-
end
|
222
|
-
|
223
|
-
def svn_loc_rev
|
224
|
-
meta = sh('git log -n 10 | grep git-svn-id | head -n 1').chomp
|
225
|
-
fail "No svn metadata on last 10 commits" if meta.empty?
|
226
|
-
meta.split[1].split('@')
|
227
|
-
end
|
228
|
-
end
|
229
|
-
|
230
|
-
class FetchCommand < GitFlow/:fetch
|
231
|
-
@help = "Get changes from svn, creating tags, branches on townhall"
|
232
|
-
@documentation = <<-DOC
|
233
|
-
This command can be used to fetch changes from Apache\'s SVN repo.
|
234
|
-
|
235
|
-
GIT CONFIG VALUES:
|
236
|
-
|
237
|
-
apache.svn - The svn remote using to get changes from Apache SVN.
|
238
|
-
Set by setup-svn --svn-prefix.
|
239
|
-
DOC
|
240
|
-
|
241
|
-
def options(opt)
|
242
|
-
opt.apache_svn = git('config', '--get', 'apache.svn').chomp rescue nil
|
243
|
-
[['--apache-svn SVN_REMOTE', 'The SVN remote used to get changes from Apache',
|
244
|
-
"Current value: #{opt.apache_svn}",
|
245
|
-
lambda { |r| opt.apache_svn = r }]
|
246
|
-
]
|
247
|
-
end
|
248
|
-
|
249
|
-
def execute(opt, argv)
|
250
|
-
fail "Missing apache.svn config value" unless opt.apache_svn
|
251
|
-
git('svn', 'fetch', opt.apache_svn)
|
252
|
-
end
|
253
|
-
end
|
254
|
-
|
255
|
-
class SyncCommand < GitFlow/:sync
|
256
|
-
@help = "Synchronizes between Apache svn and git townhall."
|
257
|
-
@documentation = <<-DOC
|
258
|
-
This command will perform the following actions:
|
259
|
-
* fetch changes from apache svn.
|
260
|
-
* rebase them on the current branch or on the one specified with --onto
|
261
|
-
* dcommit (this will push your changes to Apache trunk)
|
262
|
-
|
263
|
-
GIT CONFIG VALUES:
|
264
|
-
|
265
|
-
apache.svn
|
266
|
-
The svn remote using to get changes from Apache SVN.
|
267
|
-
Set by setup-svn --svn-prefix.
|
268
|
-
|
269
|
-
apache.git
|
270
|
-
The git remote used as townhall repository.
|
271
|
-
Set by setup-svn --townhall.
|
272
|
-
|
273
|
-
svn-remote.APACHE_GIT.username
|
274
|
-
If configured, sync will use this svn username while dcommiting.
|
275
|
-
DOC
|
276
|
-
|
277
|
-
def options(opt)
|
278
|
-
git('branch').split.tap { |n| opt.current = n[n.index('*')+1] }
|
279
|
-
opt.branch = opt.current
|
280
|
-
opt.svn_branch = 'trunk'
|
281
|
-
opt.git_branch = 'master'
|
282
|
-
opt.apache_git = git('config', '--get', 'apache.git').chomp rescue nil
|
283
|
-
opt.apache_svn = git('config', '--get', 'apache.svn').chomp rescue nil
|
284
|
-
opt.svn_username = git('config', '--get',
|
285
|
-
"svn-remote.#{opt.apache_svn}.username").chomp rescue nil
|
286
|
-
[['--apache-svn SVN_REMOTE', 'The SVN remote used to get changes from Apache',
|
287
|
-
"Current value: #{opt.apache_svn}",
|
288
|
-
lambda { |r| opt.apache_svn = r }],
|
289
|
-
['--apache-git REMOTE', 'The git remote used as town-hall repository.',
|
290
|
-
"Current value: #{opt.apache_git}",
|
291
|
-
lambda { |r| opt.apache_git = r }],
|
292
|
-
['--username SVN_USER',
|
293
|
-
'Specify the SVN username for dcommit',
|
294
|
-
"Defaults to: #{opt.svn_username}",
|
295
|
-
lambda { |b| opt.svn_username = b }],
|
296
|
-
['--svn-branch SVN_BRANCH',
|
297
|
-
'Specify the SVN branch to rebase changes from, and where to dcommit',
|
298
|
-
"Defaults to: #{opt.svn_branch}",
|
299
|
-
lambda { |b| opt.svn_branch = b }],
|
300
|
-
['--git-branch REMOTE_BRANCH',
|
301
|
-
'Specify the remote town-hall branch (on apache.git) to update',
|
302
|
-
"Defaults to: #{opt.git_branch}",
|
303
|
-
lambda { |b| opt.git_branch = b }],
|
304
|
-
['--branch BRANCH', 'Specify the local branch to take changes from',
|
305
|
-
"Current branch: #{opt.branch}",
|
306
|
-
lambda { |b| opt.branch = b }]
|
307
|
-
]
|
308
|
-
end
|
309
|
-
|
310
|
-
def execute(opt, argv)
|
311
|
-
# obtain the svn url
|
312
|
-
url = git('config', '--get', "svn-remote.#{opt.apache_svn}.url").chomp
|
313
|
-
# obtain the path for project
|
314
|
-
path = git('config', '--get', "svn-remote.#{opt.apache_svn}.branches").
|
315
|
-
chomp.split('/branches').first
|
316
|
-
commit_url = "#{url}/#{path}/#{opt.svn_branch}"
|
317
|
-
|
318
|
-
# obtain latest changes from svn
|
319
|
-
git('svn', 'fetch', '--svn-remote', opt.apache_svn)
|
320
|
-
# obtain latest changes from git
|
321
|
-
git('fetch', opt.apache_git,
|
322
|
-
"#{opt.git_branch}:refs/remotes/#{opt.apache_git}/#{opt.git_branch}")
|
323
|
-
|
324
|
-
# rebase svn changes in the desired branch
|
325
|
-
git('rebase', "#{opt.apache_svn}/#{opt.svn_branch}", opt.branch)
|
326
|
-
git('rebase', "#{opt.apache_git}/#{opt.git_branch}", opt.branch)
|
327
|
-
|
328
|
-
# dcommit to the specific svn branch
|
329
|
-
['svn', 'dcommit',
|
330
|
-
'--svn-remote', opt.apache_svn, '--commit-url', commit_url].tap do |cmd|
|
331
|
-
if opt.svn_username
|
332
|
-
cmd << '--username' << opt.svn_username
|
333
|
-
end
|
334
|
-
git(*cmd)
|
335
|
-
end
|
336
|
-
|
337
|
-
# update townhall remote ref
|
338
|
-
git('update-ref',
|
339
|
-
"refs/remotes/#{opt.apache_git}/#{opt.git_branch}",
|
340
|
-
"refs/remotes/#{opt.apache_svn}/#{opt.svn_branch}")
|
341
|
-
|
342
|
-
# forward the remote townhall/master to apache/trunk
|
343
|
-
git('push', opt.apache_git,
|
344
|
-
"refs/remotes/#{opt.apache_git}/#{opt.git_branch}:#{opt.git_branch}")
|
345
|
-
|
346
|
-
# get back to the original branch
|
347
|
-
git('checkout', opt.current)
|
348
|
-
end
|
349
|
-
end
|
350
|
-
|
351
|
-
|
352
|
-
# This one is displayed when the user executes this script using
|
353
|
-
# open-uri -e
|
354
|
-
HEADER = <<HEADER
|
355
|
-
|
356
|
-
Buildr official commit channel is Apache's svn repository, however some
|
357
|
-
developers may prefer to use git while working on several features and
|
358
|
-
merging other's changes.
|
359
|
-
|
360
|
-
This script will configure a gitflow copy on so you can commit to svn.
|
361
|
-
|
362
|
-
Enter <-h> to see options, <-H> to see notes about configured aliases
|
363
|
-
and recommended workflow, or any other option.
|
364
|
-
|
365
|
-
Ctrl+D or an invalid option to abort
|
366
|
-
HEADER
|
367
|
-
|
368
|
-
# When fork is completed, we display the following notice on a
|
369
|
-
# pager, giving the user a brief overview of git aliases used
|
370
|
-
# to keep the mirror in sync.
|
371
|
-
NOTICE = <<NOTICE
|
372
|
-
ALIASES:
|
373
|
-
|
374
|
-
Some git aliases have been created for developer convenience:
|
375
|
-
|
376
|
-
git apache fetch # get changes from apache/trunk without merging them
|
377
|
-
# you can inspect what's happening on trunk without
|
378
|
-
# having to worry about merging conflicts.
|
379
|
-
# Inspect the remote branch with `git log apache/trunk`
|
380
|
-
# Or if you have a git-ui like `tig` you can use that.
|
381
|
-
|
382
|
-
git apache merge # Merge already fetched changes on the current branch
|
383
|
-
# Use this command to get up to date with trunk changes
|
384
|
-
# you can always cherry-pick from the apache/trunk
|
385
|
-
# branch.
|
386
|
-
|
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.
|
391
|
-
# You need not to be on the master branch.
|
392
|
-
# Actually you can work on a tiny-feature branch and
|
393
|
-
# commit directly from it.
|
394
|
-
#
|
395
|
-
# VERY IMPORTANT:
|
396
|
-
#
|
397
|
-
# Missing commits on Apache's SVN will be sent using
|
398
|
-
# your apache svn account. This means that you can
|
399
|
-
# make some commits on behalf of others (like patches
|
400
|
-
# comming from JIRA issues or casual contributors)
|
401
|
-
# Review the apache-push alias on .git/config if you
|
402
|
-
# want to change login-name used for commit to SVN.
|
403
|
-
#
|
404
|
-
# See the recommended workflow to avoid commiting
|
405
|
-
# other developers' changes and the following section.
|
406
|
-
|
407
|
-
THE GITHUB MIRROR:
|
408
|
-
|
409
|
-
Buildr has an unofficial git mirror on github, maintained by Apache committers:
|
410
|
-
|
411
|
-
http://github.com/buildr/buildr
|
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
|
415
|
-
contributions. This git mirror is provided only for developers convenience,
|
416
|
-
allowing them to easily create experimental branches or review code from
|
417
|
-
other committers.
|
418
|
-
|
419
|
-
All code that wants to make it to the official Apache Buildr repository needs
|
420
|
-
to be committed to the Apache SVN repository by using the command:
|
421
|
-
|
422
|
-
git synchronize
|
423
|
-
|
424
|
-
This command will synchronize both ways svn<->git to keep trunk upto date.
|
425
|
-
You need to be an Apache committer and have permissions on the SVN repo.
|
426
|
-
|
427
|
-
It's VERY IMPORTANT for Buildr committers to remember that contributions from
|
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
|
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,
|
432
|
-
just like any other contribution following Apache's guidelines.
|
433
|
-
|
434
|
-
So, it's very important - if you care about meritocracy - to follow or at
|
435
|
-
least that you get an idea of the recommended workflow.
|
436
|
-
|
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.
|
441
|
-
|
442
|
-
They may seem lots of things to consider, but it's all for Buildr's healt.
|
443
|
-
As all things git, you can always follow your own workflow and even create
|
444
|
-
aliases on you .git/config file to avoid typing much. So, here they are:
|
445
|
-
|
446
|
-
1) get your gitflow configured
|
447
|
-
(you have already do so, this was the most difficult part)
|
448
|
-
|
449
|
-
2) create a topic branch to work on, say.. you want to add cool-feature:
|
450
|
-
|
451
|
-
git checkout -b cool-feature master
|
452
|
-
# now on branch cool-feature
|
453
|
-
|
454
|
-
3) hack hack hack.. use the source luke.
|
455
|
-
every time you feel you have something important like added failing
|
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
|
-
|
459
|
-
git commit --interactive
|
460
|
-
|
461
|
-
3) review your changes, get ALL specs passing, repeat step 3 as needed
|
462
|
-
|
463
|
-
4) let's see what are they doing on trunk
|
464
|
-
|
465
|
-
git apache-fetch
|
466
|
-
# You can inspect the upstream changes without having to merge them
|
467
|
-
git log apache/trunk # what are they doing!!
|
468
|
-
|
469
|
-
5) integrate mainstream changes to your cool-feature branch, you can always
|
470
|
-
use `git cherry-pick` to select only some commits.
|
471
|
-
|
472
|
-
git merge apache/trunk cool-feature
|
473
|
-
|
474
|
-
6) Go to 3 unless ALL specs are passing.
|
475
|
-
|
476
|
-
7.a) (Skip to 7.b you have commit bit on Apache's SVN)
|
477
|
-
Create a patch using `git format-patch`
|
478
|
-
Promote your changes, create a JIRA issue and upload it granting Apache
|
479
|
-
license to include your code:
|
480
|
-
|
481
|
-
https://issues.apache.org/jira/browse/BUILDR
|
482
|
-
dev@buildr.apache.org
|
483
|
-
|
484
|
-
7.b) Now you have everyhing on staging area and merged important changes
|
485
|
-
from apache/trunk, it's time to commit them to Apache's SVN.
|
486
|
-
|
487
|
-
git apache-push
|
488
|
-
|
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
|
491
|
-
wait on Victor's cronjob to run every hour (useful for urgent changes).
|
492
|
-
|
493
|
-
git synchronize
|
494
|
-
|
495
|
-
9) Pull changes from origin frequently.
|
496
|
-
|
497
|
-
git fetch origin
|
498
|
-
git rebase --onto origin/master master master
|
499
|
-
|
500
|
-
10) Unconditionally, Go to step 2 ;)
|
501
|
-
Share your gitflow workflow, git tips, etc.
|
502
|
-
|
503
|
-
RESOURCES:
|
504
|
-
|
505
|
-
http://github.com/buildr/buildr/tree/master
|
506
|
-
http://git.or.cz/gitwiki/GitCheatSheet
|
507
|
-
http://groups.google.com/group/git-users/web/git-references
|
508
|
-
|
509
|
-
NOTICE
|
510
|
-
#' for emacs
|
511
|
-
|
512
|
-
end
|