Skip to content

Commit

Permalink
[build] create command to update maven dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Dec 22, 2023
1 parent 5792d4e commit 6b9dfec
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,22 @@ namespace :java do
desc 'Generate Java documentation'
task docs: :javadocs

desc 'Update Maven dependencies'
task :dependencies do
file_path = 'java/maven_deps.bzl'
content = File.read(file_path)

Bazel.execute('run', [], '@maven//:outdated') do |output|
versions = output.scan(/(\S+) \[\S+ -> (\S+)\]/).to_h
versions.each do |artifact, version|
next if artifact.match?('graphql')
content.gsub!(/#{artifact}:\d+\.\d+[^\\"]+/, "#{artifact}:#{version}")
end
end

File.write(file_path, content)
end

desc 'Update Java version'
task :version, [:version] do |_task, arguments|
old_version = java_version
Expand Down Expand Up @@ -847,6 +863,7 @@ namespace :all do
args = arguments[:channel] ? ['--', "--chrome_channel=#{arguments[:channel].capitalize}"] : []
Bazel.execute('run', args, '//scripts:pinned_browsers')
Bazel.execute('run', args, '//scripts:update_cdp')
Rake::Task['java:dependencies'].invoke
Rake::Task['authors'].invoke
Rake::Task['copyright:update'].invoke
end
Expand Down

0 comments on commit 6b9dfec

Please sign in to comment.