Sha256: 76530bdaa0052a7a308463324396a1c50d73f53278b676c7c4c681bd4b084293

Contents?: true

Size: 1.48 KB

Versions: 3

Compression:

Stored size: 1.48 KB

Contents

# frozen_string_literal: true

# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'bundler/gem_tasks'

desc "Compile the necessary protobuf files."
task :compile_protos do
  Rake::Task[:clean_protos].invoke
  FileUtils.mkdir 'lib'

  protos = [
    "../googleapis/google/api/*.proto",
    "../googleapis/google/logging/type/*.proto",
    "../googleapis/google/longrunning/*.proto",
    "../googleapis/google/rpc/*.proto",
    "../googleapis/google/type/*.proto",
  ]

  command = []
  command << "grpc_tools_ruby_protoc"
  command << "--ruby_out=lib"
  command << "-I ../googleapis"
  command += protos
  full_command = command.join " "

  puts full_command
  system full_command
end

desc "Remove the compiled protos."
task :clean_protos do
  FileUtils.rm_rf "lib"
end

desc "Run the CI build"
task :ci do
  puts "\nCompiling Protos\n"
  Rake::Task[:compile_protos].invoke
end

Rake::Task[:build].enhance [:compile_protos]
Rake::Task[:clean].enhance [:clean_protos]

task default: :ci

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
googleapis-common-protos-types-1.0.5 Rakefile
googleapis-common-protos-types-1.0.4 Rakefile
googleapis-common-protos-types-1.0.3 Rakefile