Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 79 lines (64 sloc) 2.65 kB
e2d34f3 @dlackty [Rakefile] fix uninitialized constant Pathname error.
dlackty authored
1 require 'pathname'
2
1de6c5c @alloy Need to fix RVM on 1.8.7
alloy authored
3 def rvm_ruby_dir
4 @rvm_ruby_dir ||= File.expand_path('../..', `which ruby`.strip)
5 end
6
960620a @alloy Add Gemfile and Travis config and make sending SIGINT during the lint…
alloy authored
7 namespace :travis do
8 task :install_opencflite_debs do
9 sh "mkdir -p .debs"
10 Dir.chdir(".debs") do
c60ef55 @fabiopelosin [Rakefile] Attempt to fix Travis.
fabiopelosin authored
11 sh "wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu44_4.4.2-2ubuntu0.11.04.1_i386.deb" unless File.exist?("libicu44_4.4.2-2ubuntu0.11.04.1_i386.deb")
960620a @alloy Add Gemfile and Travis config and make sending SIGINT during the lint…
alloy authored
12 base_url = "https://github.com/downloads/CocoaPods/OpenCFLite"
13 %w{ opencflite1_248-1_i386.deb opencflite-dev_248-1_i386.deb }.each do |deb|
14 sh "wget #{File.join(base_url, deb)}" unless File.exist?(deb)
15 end
16 sh "sudo dpkg -i *.deb"
17 end
1999de5 @alloy Add Rakefile which runs `spec lint` against all specs. And fix a few …
alloy authored
18 end
1de6c5c @alloy Need to fix RVM on 1.8.7
alloy authored
19
20 task :fix_rvm_include_dir do
21 unless File.exist?(File.join(rvm_ruby_dir, 'include'))
22 # Make Ruby headers available, RVM seems to do not create a include dir on 1.8.7, but it does on 1.9.3.
23 sh "mkdir '#{rvm_ruby_dir}/include'"
24 sh "ln -s '#{rvm_ruby_dir}/lib/ruby/1.8/i686-linux' '#{rvm_ruby_dir}/include/ruby'"
25 end
26 end
27
fe9f9bb @alloy Aaand also set the CFLAGS env var when bundling.
alloy authored
28 task :setup => [:install_opencflite_debs, :fix_rvm_include_dir] do
29 sh "CFLAGS='-I#{rvm_ruby_dir}/include' bundle install"
30 end
1999de5 @alloy Add Rakefile which runs `spec lint` against all specs. And fix a few …
alloy authored
31 end
32
33 desc "Run `pod spec lint` on all specs"
8cd8885 @alloy Make the lint task use locally installed gems only if they exist and …
alloy authored
34 task :lint do
a59bfaf @alloy Properly select modified podspecs.
alloy authored
35 exit if ENV['skip-lint']
36
39b1a6b @fabiopelosin [Rakefile] disabled full lint.
fabiopelosin authored
37 ENV['SKIP_SETUP']='1'
38 ENV['CP_REPOS_DIR']= Pathname.new(Dir.pwd).dirname.to_s
39
a59bfaf @alloy Properly select modified podspecs.
alloy authored
40 specs = `git diff-index --name-only HEAD | grep '.podspec$'`.strip.split("\n")
439e76c @fabiopelosin [Rakefile] Made lint faster.
fabiopelosin authored
41 specs = ['.'] if specs.empty?
32c5102 @fabiopelosin [Rakefile] Improved tests.
fabiopelosin authored
42 last_commit_podspecs = `git diff --diff-filter=ACMRTUXB --name-only HEAD~1..HEAD | grep '.podspec$'`.strip.split("\n")
43 last_commit_specs = last_commit_podspecs.map {|p| p.gsub(/(.*)\/.*\/.*/,'\1')}.uniq
44
45 failures = 0
46
39b1a6b @fabiopelosin [Rakefile] disabled full lint.
fabiopelosin authored
47 # unless last_commit_podspecs.empty?
48 # puts "\n>>> last commit podspecs (full lint) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"
49 # command = "pod spec lint '#{last_commit_podspecs.join("' '")}' "
50 # failures += 1 unless excute_command(command)
51 # end
4c4519a @fabiopelosin [Rakefile] Strict lint for new podspecs.
fabiopelosin authored
52
53 unless last_commit_specs.empty?
32c5102 @fabiopelosin [Rakefile] Improved tests.
fabiopelosin authored
54 puts "\n>>> last commit pods (quick lint with warnings) <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"
1451807 @fabiopelosin [Rakefile] Forgot development paht.
fabiopelosin authored
55 command = "pod spec lint --quick '#{last_commit_specs.join("' '")}' "
32c5102 @fabiopelosin [Rakefile] Improved tests.
fabiopelosin authored
56 failures += 1 unless excute_command(command)
4c4519a @fabiopelosin [Rakefile] Strict lint for new podspecs.
fabiopelosin authored
57 end
8cd8885 @alloy Make the lint task use locally installed gems only if they exist and …
alloy authored
58
32c5102 @fabiopelosin [Rakefile] Improved tests.
fabiopelosin authored
59 puts "\n>>> Repo <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"
1451807 @fabiopelosin [Rakefile] Forgot development paht.
fabiopelosin authored
60 command = "pod repo lint ."
32c5102 @fabiopelosin [Rakefile] Improved tests.
fabiopelosin authored
61 failures += 1 unless excute_command(command)
62
63 unless failures.zero?
4c4519a @fabiopelosin [Rakefile] Strict lint for new podspecs.
fabiopelosin authored
64 exit 1
65 end
66 end
67
32c5102 @fabiopelosin [Rakefile] Improved tests.
fabiopelosin authored
68 def excute_command(command)
69 # begin
70 puts command
71 # do it this way so we can trap Interrupt, doesn't work well with Kernel::system and Rake's sh
72 system command
73 # rescue Interrupt
74 # break
75 # false
1999de5 @alloy Add Rakefile which runs `spec lint` against all specs. And fix a few …
alloy authored
76 end
77
78 task :default => :lint
Something went wrong with that request. Please try again.