chore: Add synth scripts for client generation (#912)
This commit is contained in:
1 parent
586c96fc01
commit
b7e5fad8c1
6 files changed
+151
-22
No files matched your search
+1
-7
@@ -4,10 +4,4 @@
|
||||
|
||||
DIR=$(dirname $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ))
|
||||
|
||||
URLS=(https://content.googleapis.com/discovery/v1/apis/appsmarket/v2/rest \
|
||||
https://content.googleapis.com/discovery/v1/apis/youtubePartner/v1/rest \
|
||||
https://content.googleapis.com/discovery/v1/apis/compute/beta/rest \
|
||||
https://monitoring.googleapis.com/\$discovery/rest?version=v3
|
||||
)
|
||||
|
||||
echo 'a' | bundle exec bin/generate-api gen generated --from-discovery --no-preferred-only --names-out=$DIR/api_names_out.yaml --url=${URLS[*]}
|
||||
echo 'a' | bundle exec bin/generate-api gen generated --from-discovery --no-preferred-only --names-out=$DIR/api_names_out.yaml
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
require "fileutils"
|
||||
|
||||
DIR = File.dirname __dir__
|
||||
|
||||
def execute cmd
|
||||
puts cmd
|
||||
abort unless system cmd
|
||||
end
|
||||
|
||||
execute "bundle install"
|
||||
|
||||
if ARGV.empty?
|
||||
execute "echo a | bundle exec bin/generate-api gen generated --from-discovery --no-preferred-only --names-out=#{DIR}/api_names_out.yaml"
|
||||
elsif ARGV == ["--clean"]
|
||||
execute "bundle exec bin/generate-api gen generated --clean"
|
||||
elsif ARGV.size == 2
|
||||
api, version = ARGV
|
||||
execute "echo a | bundle exec bin/generate-api gen generated --api=#{api}.#{version} --names-out=#{DIR}/api_names_out.yaml"
|
||||
else
|
||||
abort "Bad arguments: #{ARGV}"
|
||||
end
|
||||
Reference in new issue
Block a user