Sha256: d991c22f27ca630039e9a4d03f0b1c71d93f25ebbe5ebda8202532f331ed4b15
Contents?: true
Size: 1.67 KB
Versions: 4
Compression:
Stored size: 1.67 KB
Contents
# -*- ruby -*- require 'bundler/gem_tasks' require 'rake/testtask' Rake::TestTask.new do |t| t.test_files = FileList['test/**/test_*.rb'] end def apply_patches clean = system(<<~EOD) bash -c 'if [ -z "$(git status --porcelain)" ]; then exit 0; else exit 1; fi' EOD raise "Working directory is not clean" unless clean patches = Dir["patches/*.patch"] patches.each do |patch| puts "PATCH #{patch}" res = system("git apply #{patch}") if res `git add -u` `git commit -m 'Applying #{patch} for v#{Google::Ads::GoogleAds::CLIENT_LIB_VERSION} release'` else puts "FAIL #{patch}: may not be a big deal because already applied or no longer needed" end end end task :validate_protos do res = system("./scripts/validate_protos.rb") if !res raise "Couldn't load all protos" end end task :apply_patches do |t| apply_patches end def proto_files Dir["lib/google/ads/google_ads/v1/**/*.rb"] end def newest_of(files) files.map { |fn| File.mtime(fn) }.max end def newest_proto_file newest_of(proto_files) end def factory_files ["lib/google/ads/google_ads/factories.rb"] + Dir["lib/google/ads/google_ads/factories/**/*.rb"] end def newest_factory_file newest_of(factory_files) end def factories_are_recent? return false unless File.exist?(factory_files.first) newest_factory_file > newest_proto_file end task :codegen do |t| `./scripts/codegen.sh` unless factories_are_recent? end task :copy_third_party_code do |t| `cp third_party/rspec/caller_filter.rb lib/google/ads/google_ads/deprecation.rb` end task :build => [:apply_patches, :copy_third_party_code, :codegen, :validate_protos] task :test => [:copy_third_party_code, :codegen]
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
google-ads-googleads-3.1.0 | Rakefile |
google-ads-googleads-3.0.1 | Rakefile |
google-ads-googleads-3.0.0 | Rakefile |
google-ads-googleads-2.4.1 | Rakefile |