@@ -767,6 +767,22 @@ namespace :java do
767767 desc 'Generate Java documentation'
768768 task docs : :javadocs
769769
770+ desc 'Update Maven dependencies'
771+ task :dependencies do
772+ file_path = 'java/maven_deps.bzl'
773+ content = File . read ( file_path )
774+
775+ Bazel . execute ( 'run' , [ ] , '@maven//:outdated' ) do |output |
776+ versions = output . scan ( /(\S +) \[ \S + -> (\S +)\] / ) . to_h
777+ versions . each do |artifact , version |
778+ next if artifact . match? ( 'graphql' )
779+ content . gsub! ( /#{ artifact } :\d +\. \d +[^\\ "]+/ , "#{ artifact } :#{ version } " )
780+ end
781+ end
782+
783+ File . write ( file_path , content )
784+ end
785+
770786 desc 'Update Java version'
771787 task :version , [ :version ] do |_task , arguments |
772788 old_version = java_version
@@ -847,6 +863,7 @@ namespace :all do
847863 args = arguments [ :channel ] ? [ '--' , "--chrome_channel=#{ arguments [ :channel ] . capitalize } " ] : [ ]
848864 Bazel . execute ( 'run' , args , '//scripts:pinned_browsers' )
849865 Bazel . execute ( 'run' , args , '//scripts:update_cdp' )
866+ Rake ::Task [ 'java:dependencies' ] . invoke
850867 Rake ::Task [ 'authors' ] . invoke
851868 Rake ::Task [ 'copyright:update' ] . invoke
852869 end
0 commit comments