Skip to content

Commit

Permalink
./go release now builds the maven artifacts for release
Browse files Browse the repository at this point in the history
Well, almost all of them. Not the standalone server.

For some reason, `buck publish` hangs indefinitely, which is
less than ideal. For now we use `buck build` to allow the
process of migration to continue. Interesting, when run out
of the ./go command, `buck publish` works exactly as it
should, so I suspect the problem is somewhere in how we
hooked up the execution of Buck. *sigh*
  • Loading branch information
shs96c committed May 12, 2016
1 parent 26eca99 commit 3735661
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 46 deletions.
99 changes: 54 additions & 45 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -480,53 +480,62 @@ file "build/third_party/java/jetty/jetty-repacked.jar" => [
cp "build/third_party/java/jetty/jetty-repacked.jar", "third_party/java/jetty/jetty-repacked.jar"
end

task "release" => [
#task "release" => [
# :clean,
:build,
'//java/server/src/org/openqa/selenium/remote/server:server:zip',
'//java/server/src/org/openqa/grid/selenium:selenium:zip',
'//java/client/src/org/openqa/selenium:client-combined-v3:zip',
] do |t|
# Unzip each of the deps and rename the pieces that need renaming
renames = {
"client-combined-v3-nodeps-srcs.jar" => "selenium-java-#{version}-srcs.jar",
"client-combined-v3-nodeps.jar" => "selenium-java-#{version}.jar",
"selenium-nodeps-srcs.jar" => "selenium-server-#{version}-srcs.jar",
"selenium-nodeps.jar" => "selenium-server-#{version}.jar",
"selenium-standalone.jar" => "selenium-server-standalone-#{version}.jar",
}

t.prerequisites.each do |pre|
zip = Rake::Task[pre].out

next unless zip =~ /\.zip$/

temp = zip + "rename"
rm_rf temp
deep = File.join(temp, "/selenium-#{version}")
mkdir_p deep
cp "java/CHANGELOG", deep
cp "NOTICE", deep
cp "LICENSE", deep

sh "cd #{deep} && jar xf ../../#{File.basename(zip)}"
renames.each do |from, to|
src = File.join(deep, from)
next unless File.exists?(src)

mv src, File.join(deep, to)
end
rm_f File.join(deep, "client-combined-v3-standalone.jar")
rm zip
sh "cd #{temp} && jar cMf ../#{File.basename(zip)} *"

rm_rf temp
# :build,
# '//java/server/src/org/openqa/selenium/remote/server:server:zip',
# '//java/server/src/org/openqa/grid/selenium:selenium:zip',
# '//java/client/src/org/openqa/selenium:client-combined-v3:zip',
# ] do |t|
# # Unzip each of the deps and rename the pieces that need renaming
# renames = {
# "client-combined-v3-nodeps-srcs.jar" => "selenium-java-#{version}-srcs.jar",
# "client-combined-v3-nodeps.jar" => "selenium-java-#{version}.jar",
# "selenium-nodeps-srcs.jar" => "selenium-server-#{version}-srcs.jar",
# "selenium-nodeps.jar" => "selenium-server-#{version}.jar",
# "selenium-standalone.jar" => "selenium-server-standalone-#{version}.jar",
# }
#
# t.prerequisites.each do |pre|
# zip = Rake::Task[pre].out
#
# next unless zip =~ /\.zip$/
#
# temp = zip + "rename"
# rm_rf temp
# deep = File.join(temp, "/selenium-#{version}")
# mkdir_p deep
# cp "java/CHANGELOG", deep
# cp "NOTICE", deep
# cp "LICENSE", deep
#
# sh "cd #{deep} && jar xf ../../#{File.basename(zip)}"
# renames.each do |from, to|
# src = File.join(deep, from)
# next unless File.exists?(src)
#
# mv src, File.join(deep, to)
# end
# rm_f File.join(deep, "client-combined-v3-standalone.jar")
# rm zip
# sh "cd #{temp} && jar cMf ../#{File.basename(zip)} *"
#
# rm_rf temp
# end
#
# mkdir_p "build/dist"
# cp "build/java/server/src/org/openqa/grid/selenium/selenium-standalone.jar", "build/dist/selenium-server-standalone-#{version}.jar"
# cp "build/java/server/src/org/openqa/grid/selenium/selenium.zip", "build/dist/selenium-server-#{version}.zip"
# cp "build/java/client/src/org/openqa/selenium/client-combined-v3.zip", "build/dist/selenium-java-#{version}.zip"
#end

task :release => JAVA_RELEASE_TARGETS do |t|
puts t.prerequisites.join(', ')

t.prerequisites.each do |p|
# Buck::buck_cmd.call('publish', "--dry-run --to-maven-central #{p}")
Buck::buck_cmd.call('build', "#{p}")
end

mkdir_p "build/dist"
cp "build/java/server/src/org/openqa/grid/selenium/selenium-standalone.jar", "build/dist/selenium-server-standalone-#{version}.jar"
cp "build/java/server/src/org/openqa/grid/selenium/selenium.zip", "build/dist/selenium-server-#{version}.zip"
cp "build/java/client/src/org/openqa/selenium/client-combined-v3.zip", "build/dist/selenium-java-#{version}.zip"
end

task :push_release => [:release] do
Expand Down
2 changes: 1 addition & 1 deletion rake-tasks/buck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def self.buck_cmd
stdin.close

while line = stderr.gets
if command == 'build' || command == 'test'
if command == 'build' || command == 'publish' || command == 'test'
puts line
end
err += line
Expand Down

0 comments on commit 3735661

Please sign in to comment.