Sha256: 01106e58a22ddcff0e98ae22437c3941d876d1313ef38b63dc3942f5d8001e5e

Contents?: true

Size: 1.53 KB

Versions: 11

Compression:

Stored size: 1.53 KB

Contents

# Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
# frozen_string_literal: true

$stdout.sync = true

require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'rake/extensiontask'
load 'protobuf/tasks/compile.rake'
require 'fileutils'

CLOBBER << 'shared_libraries/*'

Dir['ext/cs__*'].each do |extension|
  name = extension.split('/')[1]
  Rake::ExtensionTask.new name do |ext|
    ext.lib_dir = "lib/#{ name }"
  end
end

desc 'compile the protobuf files for the agent, translating them to .rb classes'
task :contrast_pb_compile do
  # do some stuff before compile

  # Invoke the protobuf compile task with your sensible defaults
  ::Rake::Task['protobuf:compile'].invoke('lib', './agent-service-api/protobuf ./agent-service-api/protobuf/dtm.proto',
                                          'lib/contrast/api',
                                          nil)

  ::Rake::Task['protobuf:compile'].reenable

  ::Rake::Task['protobuf:compile'].invoke('lib',
                                          './agent-service-api/protobuf ./agent-service-api/protobuf/settings.proto',
                                          'lib/contrast/api',
                                          nil)

  ['dtm.pb.rb', 'settings.pb.rb'].each do |target_file|
    target_path = File.absolute_path(File.join(__dir__, "./lib/contrast/api/#{ target_file }"))
    unless File.exist?(target_path)
      puts "File not found #{ target_path }"
      exit 1
    end
  end

  puts 'Protobuf copied successfully'
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
contrast-agent-4.14.1 Rakefile
contrast-agent-4.14.0 Rakefile
contrast-agent-4.13.1 Rakefile
contrast-agent-4.13.0 Rakefile
contrast-agent-4.12.0 Rakefile
contrast-agent-4.11.0 Rakefile
contrast-agent-4.10.0 Rakefile
contrast-agent-4.9.1 Rakefile
contrast-agent-4.9.0 Rakefile
contrast-agent-4.8.0 Rakefile
contrast-agent-4.7.0 Rakefile