Created
September 30, 2013 15:54
-
-
Save odrobnik/6765896 to your computer and use it in GitHub Desktop.
A shorter version that doesn't depend on the build settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'etc' | |
require 'fileutils' | |
require 'find' | |
workingDir = Dir.getwd | |
derivedDataDir = "#{Etc.getpwuid.dir}/Library/Developer/Xcode/DerivedData/" | |
outputDir = workingDir + "/gcov" | |
FileUtils.mkdir outputDir | |
Find.find(derivedDataDir) do |file| | |
if file.match(/\.gcda\Z/) | |
#get just the folder name | |
gcov_dir = File.dirname(file) | |
#chdir because gcov cannot work with absolute path | |
Dir.chdir gcov_dir | |
#process the file | |
system("gcov '#{file}' -o '#{gcov_dir}'") | |
Dir.glob("*.gcov") do |file| | |
FileUtils.mv(file, outputDir) | |
end | |
end | |
end | |
#change back to working directory | |
Dir.chdir workingDir | |
#call the coveralls | |
system 'coveralls', '--verbose' | |
#clean up | |
FileUtils.rm_rf outputDir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment