Skip to content

Commit

Permalink
Package Grid TNG as a java release
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Apr 24, 2019
1 parent 8d4be12 commit 05c74ce
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ task :tests => [
"//java/client/test/org/openqa/selenium/ie:ie",
"//java/client/test/org/openqa/selenium/chrome:chrome",
"//java/client/test/org/openqa/selenium/opera:opera",
# "//java/client/test/org/openqa/selenium/lift:test",
"//java/client/test/org/openqa/selenium/support:small-tests",
"//java/client/test/org/openqa/selenium/support:large-tests",
"//java/client/test/org/openqa/selenium/remote:common-tests",
Expand Down Expand Up @@ -450,15 +449,19 @@ end


task :'prep-release-zip' => [
'//java/server/src/org/openqa/grid/selenium:selenium',
'//java/client/src/org/openqa/selenium:client-combined-zip',
'//java/server/src/org/openqa/grid/selenium:selenium',
'//java/server/src/org/openqa/grid/selenium:selenium-zip',
'//java/server/src/org/openqa/selenium/grid:selenium',
'//java/server/src/org/openqa/selenium/grid:selenium-zip',
'//java/server/src/org/openqa/selenium/server/htmlrunner:selenium-runner'] do

mkdir_p "build/dist"
cp Rake::Task['//java/server/src/org/openqa/grid/selenium:selenium'].out, "build/dist/selenium-server-standalone-#{version}.jar"
cp Rake::Task['//java/server/src/org/openqa/grid/selenium:selenium-zip'].out, "build/dist/selenium-server-#{version}.zip"
cp Rake::Task['//java/server/src/org/openqa/grid/selenium:selenium-zip'].out, "build/dist/selenium-server-standalone-#{version}.zip"
cp Rake::Task['//java/client/src/org/openqa/selenium:client-combined-zip'].out, "build/dist/selenium-java-#{version}.zip"
cp Rake::Task['//java/server/src/org/openqa/selenium/grid:selenium'].out, "build/dist/selenium-server-#{version}.jar"
cp Rake::Task['//java/server/src/org/openqa/selenium/grid:selenium-zip'].out, "build/dist/selenium-server-#{version}.zip"
cp Rake::Task['//java/server/src/org/openqa/selenium/server/htmlrunner:selenium-runner'].out, "build/dist/selenium-html-runner-#{version}.jar"
end

Expand Down Expand Up @@ -511,7 +514,7 @@ task :'push-release' => [:'prep-release-zip'] do
py = "python"
end

sh "#{py} third_party/py/googlestorage/publish_release.py --project_id google.com:webdriver --bucket selenium-release --acl public-read --publish_version #{release_version} --publish build/dist/selenium-server-standalone-#{version}.jar --publish build/dist/selenium-server-#{version}.zip --publish build/dist/selenium-java-#{version}.zip --publish build/dist/selenium-html-runner-#{version}.jar"
sh "#{py} third_party/py/googlestorage/publish_release.py --project_id google.com:webdriver --bucket selenium-release --acl public-read --publish_version #{release_version} --publish build/dist/selenium-server-#{version}.jar --publish build/dist/selenium-server-#{version}.zip --publish build/dist/selenium-server-standalone-#{version}.jar --publish build/dist/selenium-server-standalone-#{version}.zip --publish build/dist/selenium-java-#{version}.zip --publish build/dist/selenium-html-runner-#{version}.jar"
end

desc 'Build the selenium client jars'
Expand Down
1 change: 1 addition & 0 deletions java/client/src/org/openqa/selenium/tools/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ java_binary(
visibility = [
"//java/client/src/org/openqa/selenium:client-combined-sources",
"//java/server/src/org/openqa/grid/selenium:selenium-server-sources",
"//java/server/src/org/openqa/selenium/grid:selenium-server-sources",
],
)

Expand Down
43 changes: 43 additions & 0 deletions java/server/src/org/openqa/selenium/grid/BUCK
Original file line number Diff line number Diff line change
@@ -1,6 +1,49 @@
load("//java:version.bzl", "SE_VERSION")
load("//java:rules.bzl", "java_library")

zip_file(
name = "selenium-zip",
out = "selenium-server-" + SE_VERSION + ".zip",
srcs = [
":selenium-server-%s" % SE_VERSION,
":selenium-server-source-zip",
"//java:changelog",
"//:notice",
"//:license",
],
)

# So we hide it in another zip file, which will be merged. Zip file merging isn't recursive.
zip_file(
name = "selenium-server-source-zip",
out = "selenium-server-sources.jar",
merge_source_zips = False,
srcs = [
":selenium-server-sources",
],
)

# The third party libraries we depend on, as a source jar for merging
genrule(
name = "server-libs",
out = "server-libs-sources.jar",
bash = 'mkdir libs && python -c "import sys,shutil;map(lambda f:shutil.copy(f,\'libs\'),[l for l in open(sys.argv[1][1:]).read().strip(\'\\\'\').split(\':\') if l.endswith(\'.jar\') and \'third_party/java\' in l])" $(@classpath :selenium) && jar cMf $OUT libs/*',
cmd_exe = 'mkdir libs && python -c "import sys,shutil;map(lambda f:shutil.copy(f,\'libs\'),[l for l in open(sys.argv[1][1:]).read().strip(\'\\\'\').split(\';\') if l.endswith(\'.jar\') and \'third_party\\java\' in l])" $(@classpath :selenium) && jar cMf $OUT libs/*',
)

# The first party source, as a source jar which we don't want merged
genrule(
name = "selenium-server-sources",
out = "selenium-server-%s-sources.jar" % SE_VERSION,
cmd = 'mkdir temp && $(exe //java/client/src/org/openqa/selenium/tools:package) $OUT $(@query_paths "inputs(kind(java_library, deps(:selenium)))")',
)

export_file(
name = "selenium-server-%s" % SE_VERSION,
src = ":selenium",
out = "selenium-server-%s.jar" % SE_VERSION,
)

java_binary(
name = "selenium",
main_class = "org.openqa.selenium.grid.Main",
Expand Down

1 comment on commit 05c74ce

@LIHTU
Copy link

@LIHTU LIHTU commented on 05c74ce Apr 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some folks (myself included) started hitting an

... Invalid or corrupt jarfile ...

error as seen in this so post (https://stackoverflow.com/questions/55835805/invalid-or-corrupt-jar-file-when-trying-to-start-selenium-server-from-intellij) this morning. I'm wondering if it has something to do with this commit.

Please sign in to comment.