Skip to content

Commit

Permalink
Fix generation of javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Mar 24, 2020
1 parent 1b28709 commit 2fc5a59
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 28 deletions.
31 changes: 8 additions & 23 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -292,35 +292,20 @@ ie_generator.generate_type_mapping(
out: 'cpp/iedriver/IEReturnTypes.h'
)

task javadocs: [
:"selenium-java",
:"_javadocs"
]

task _javadocs: %i[common firefox ie remote support chrome selenium] do
task javadocs: %i[//java/server/src/org/openqa/selenium/grid:all-javadocs] do
rm_rf 'build/javadoc'
mkdir_p 'build/javadoc'
sourcepath = ''
classpath = '.'
Dir['bazel-bin/external/maven/v1/https/repo1.maven.org/maven2/**/*.jar'].each do |jar|
classpath << ':' + jar unless jar.to_s =~ /.*-src.*\.jar/
end
classpath << ':bazel-bin/java/client/src/org/openqa/selenium/devtools/libcdp.jar'
[File.join(%w[java client src])].each do |m|
sourcepath += File::PATH_SEPARATOR + m
end
[File.join(%w[java server src])].each do |m|
sourcepath += File::PATH_SEPARATOR + m
end

p sourcepath
cmd = "javadoc -notimestamp -d build/javadoc -sourcepath #{sourcepath} -classpath #{classpath} -subpackages org.openqa.selenium -subpackages com.thoughtworks "
cmd << ' -exclude org.openqa.selenium.tools.modules'
out = Rake::Task['//java/server/src/org/openqa/selenium/grid:all-javadocs'].out

cmd = %{cd build/javadoc && jar xf "../../#{out}" 2>&1}
if SeleniumRake::Checks.windows?
cmd = cmd.gsub(/\//, '\\').gsub(/:/, ';')
end
sh cmd


ok = system(cmd)
ok or raise "could not unpack javadocs"

File.open('build/javadoc/stylesheet.css', 'a') { |file|
file.write(<<~EOF
Expand All @@ -336,7 +321,7 @@ task _javadocs: %i[common firefox ie remote support chrome selenium] do
}
EOF
)
)
}
end

Expand Down
2 changes: 1 addition & 1 deletion rake_tasks/bazel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ def self.execute(kind, args, target, &block)
puts "#{target} -> #{out_artifact}" if out_artifact
out_artifact
end
end
end
12 changes: 8 additions & 4 deletions rake_tasks/rake/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ class Task
attr_accessor :deps

def out
puts "We are reading the @out value currently!!! It is currently set to #{@out}"
puts self.inspect
if @debug
puts "We are reading the @out value currently!!! It is currently set to #{@out}"
puts self.inspect
end
@out
end

def out=(value)
puts "We are WRITING the @out value currently!!! WE ARE WRITING IT TO #{value}"
puts self.inspect
if @debug
puts "We are WRITING the @out value currently!!! WE ARE WRITING IT TO #{value}"
puts self.inspect
end
@out = value
end
end
Expand Down

0 comments on commit 2fc5a59

Please sign in to comment.