Skip to content

Commit 40c8bc0

Browse files
committed
[build] regenerate the BiDi schema and Ruby protocol as part of update_cddl task
1 parent 0bd65b3 commit 40c8bc0

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎Rakefile‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,19 @@ task :update_multitool do |_task, _arguments|
7070
Bazel.execute('run', [], '//scripts:update_multitool_binaries')
7171
end
7272

73-
desc 'Update pinned CDDL spec files from w3c/webref'
73+
desc 'Update pinned CDDL spec files from w3c/webref and regenerate what they feed'
7474
task :update_cddl do |_task, _arguments|
7575
puts 'Updating pinned CDDL spec references'
7676
Bazel.execute('run', [], '//scripts:update_cddl')
77+
78+
if SeleniumRake.git.diff('HEAD').path('common/webref_cddl.bzl').none?
79+
puts 'Pins unchanged; skipping regeneration'
80+
next
81+
end
82+
83+
puts 'Updating the checked-in BiDi schema'
84+
Bazel.execute('run', [], '//common/bidi:update-schema')
85+
Rake::Task['rb:update_cddl'].invoke
7786
end
7887

7988
desc 'Update Chrome DevTools support'

‎rake_tasks/ruby.rake‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ task :install do
155155
end
156156
end
157157

158+
desc 'Regenerate the BiDi protocol classes from the pinned CDDL schema'
159+
task :update_cddl do
160+
puts 'Regenerating Ruby BiDi protocol'
161+
Bazel.execute('run', [], '//rb/lib/selenium/webdriver:bidi-generate')
162+
end
163+
158164
desc 'Update Ruby changelog'
159165
task :changelogs do
160166
header = "#{ruby_version} (#{Time.now.strftime('%Y-%m-%d')})\n========================="

0 commit comments

Comments
 (0)