From e59497dee5d63c6cd65341b3f15d965f205cee0b Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 10:48:48 +0200 Subject: [PATCH 01/11] Added files for Travis+Coveralls --- .travis.yml | 11 ++ Test/Resources/Multiple_Tables.txt | 13 ++ build.sh | 4 + coveralls.rb | 136 ++++++++++++++++++ .../xcschemes/Static Library.xcscheme | 69 +++++++++ 5 files changed, 233 insertions(+) create mode 100644 .travis.yml create mode 100644 Test/Resources/Multiple_Tables.txt create mode 100755 build.sh create mode 100755 coveralls.rb create mode 100644 genstrings2.xcodeproj/xcshareddata/xcschemes/Static Library.xcscheme diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b0629c1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +--- +language: objective-c + +before_script: + - sudo easy_install cpp-coveralls + +script: + - ./build.sh + +after_success: + - ./coveralls.rb --extension m --exclude-folder Demo --exclude-folder Test --exclude-folder Externals diff --git a/Test/Resources/Multiple_Tables.txt b/Test/Resources/Multiple_Tables.txt new file mode 100644 index 0000000..037d58a --- /dev/null +++ b/Test/Resources/Multiple_Tables.txt @@ -0,0 +1,13 @@ +/* Tests if tokens properly end up in multiple strings tables */ + +#define CONTACT_NAME_MENU_TITLE NSLocalizedString(@"Contact Name Format",nil) + + + + + if ([[menuItem title] isEqualToString:NSLocalizedStringFromTableInBundle(@"Open Link", @"Third Table", [NSBundle bundleForClass:[WebView class]], nil)]) + [webViewMenuItems removeObjectIdenticalTo:menuItem]; + } + + + diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..a39edcf --- /dev/null +++ b/build.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -e +xctool -project genstrings2.xcodeproj -scheme "Static Library" test -arch x86_64 ONLY_ACTIVE_ARCH=NO +xctool -project genstrings2.xcodeproj -scheme "Documentation" diff --git a/coveralls.rb b/coveralls.rb new file mode 100755 index 0000000..e182aab --- /dev/null +++ b/coveralls.rb @@ -0,0 +1,136 @@ +#!/usr/bin/env ruby + +require 'etc' +require 'fileutils' +require 'find' +require 'optparse' + +# arraw of source subfolders to exclude +excludedFolders = [] +extensionsToProcess = [] +coveralls_cmd = "coveralls" + +excludeHeaders = false + +# create option parser +opts = OptionParser.new +opts.banner = "Usage: coveralls.rb [options]" + +opts.on('-e', '--exclude-folder FOLDER', 'Folder to exclude') do |v| + excludedFolders << v + coveralls_cmd.concat(" -e #{v}") +end + +opts.on('-h', '--exclude-headers', 'Ignores headers') do |v| + excludeHeaders = true +end + +opts.on('-x', '--extension EXT', 'Source file extension to process') do |v| + extensionsToProcess << v + coveralls_cmd.concat(" -x #{v}") +end + +opts.on_tail("-?", "--help", "Show this message") do + puts opts + exit +end + +# parse the options +begin + opts.parse!(ARGV) +rescue OptionParser::InvalidOption => e + puts e + puts opts + exit(1) +end + +# the folders +workingDir = Dir.getwd +derivedDataDir = "#{Etc.getpwuid.dir}/Library/Developer/Xcode/DerivedData/" +outputDir = workingDir + "/gcov" + +# create gcov output folder +FileUtils.mkdir outputDir + +# pattern to get source file from first line of gcov file +GCOV_SOURCE_PATTERN = Regexp.new(/Source:(.*)/) + +# enumerate all gcda files underneath derivedData +Find.find(derivedDataDir) do |gcda_file| + + if gcda_file.match(/\.gcda\Z/) + + #get just the folder name + gcov_dir = File.dirname(gcda_file) + + # cut off absolute working dir to get relative source path + relative_input_path = gcda_file.slice(derivedDataDir.length, gcda_file.length) + puts "\nINPUT: #{relative_input_path}" + + #process the file + result = %x( gcov '#{gcda_file}' -o '#{gcov_dir}' ) + + # filter the resulting output + Dir.glob("*.gcov") do |gcov_file| + + firstLine = File.open(gcov_file).readline + match = GCOV_SOURCE_PATTERN.match(firstLine) + + if (match) + + source_path = match[1] + + puts "source: #{source_path} - #{workingDir}" + + if (source_path.start_with? workingDir) + + # cut off absolute working dir to get relative source path + relative_path = source_path.slice(workingDir.length+1, source_path.length) + + extension = File.extname(relative_path) + extension = extension.slice(1, extension.length-1) + + puts "#{extension}" + + # get the path components + path_comps = relative_path.split(File::SEPARATOR) + + shouldProcess = false + exclusionMsg ="" + + if (excludedFolders.include?(path_comps[0])) + exclusionMsg = "excluded via option" + else + if (excludeHeaders == true && extension == 'h') + exclusionMsg = "excluded header" + else + if (extensionsToProcess.count == 0 || extensionsToProcess.include?(extension)) + shouldProcess = true + else + exclusionMsg = "excluded extension" + shouldProcess = false + end + end + end + + if (shouldProcess) + puts " - process: #{relative_path}" + FileUtils.mv(gcov_file, outputDir) + else + puts " - ignore: #{relative_path} (#{exclusionMsg})" + FileUtils.rm gcov_file + end + else + puts " - ignore: #{gcov_file} (outside source folder)" + FileUtils.rm gcov_file + end + end + end + end +end + +#call the coveralls, exclude some files +system coveralls_cmd + +#clean up +FileUtils.rm_rf outputDir diff --git a/genstrings2.xcodeproj/xcshareddata/xcschemes/Static Library.xcscheme b/genstrings2.xcodeproj/xcshareddata/xcschemes/Static Library.xcscheme new file mode 100644 index 0000000..9701ddb --- /dev/null +++ b/genstrings2.xcodeproj/xcshareddata/xcschemes/Static Library.xcscheme @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0460" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "A79AC08714B1A51800489FA3" + BuildableName = "libDTLocalizableStringScanner.a" + BlueprintName = "Static Library" + ReferencedContainer = "container:genstrings2.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> + <Testables> + <TestableReference + skipped = "NO"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "A7F65DBD14C03E980092E2EE" + BuildableName = "UnitTest.octest" + BlueprintName = "UnitTest" + ReferencedContainer = "container:genstrings2.xcodeproj"> + </BuildableReference> + </TestableReference> + </Testables> + </TestAction> + <LaunchAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Debug" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + allowLocationSimulation = "YES"> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Release" + debugDocumentVersioning = "YES"> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> From 08b1e0303b23933ab3e4c99e477bad33a67cbfe5 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 10:49:54 +0200 Subject: [PATCH 02/11] Made documentation scheme shared too --- .../xcschemes/Documentation.xcscheme | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 genstrings2.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme diff --git a/genstrings2.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme b/genstrings2.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme new file mode 100644 index 0000000..63eab4d --- /dev/null +++ b/genstrings2.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Scheme + LastUpgradeVersion = "0510" + version = "1.3"> + <BuildAction + parallelizeBuildables = "YES" + buildImplicitDependencies = "YES"> + <BuildActionEntries> + <BuildActionEntry + buildForTesting = "YES" + buildForRunning = "YES" + buildForProfiling = "YES" + buildForArchiving = "YES" + buildForAnalyzing = "YES"> + <BuildableReference + BuildableIdentifier = "primary" + BlueprintIdentifier = "A79D903416F7491B009D8A46" + BuildableName = "Documentation" + BlueprintName = "Documentation" + ReferencedContainer = "container:genstrings2.xcodeproj"> + </BuildableReference> + </BuildActionEntry> + </BuildActionEntries> + </BuildAction> + <TestAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + shouldUseLaunchSchemeArgsEnv = "YES" + buildConfiguration = "Debug"> + <Testables> + </Testables> + </TestAction> + <LaunchAction + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + launchStyle = "0" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Debug" + ignoresPersistentStateOnLaunch = "NO" + debugDocumentVersioning = "YES" + allowLocationSimulation = "YES"> + <AdditionalOptions> + </AdditionalOptions> + </LaunchAction> + <ProfileAction + shouldUseLaunchSchemeArgsEnv = "YES" + savedToolIdentifier = "" + useCustomWorkingDirectory = "NO" + buildConfiguration = "Release" + debugDocumentVersioning = "YES"> + </ProfileAction> + <AnalyzeAction + buildConfiguration = "Debug"> + </AnalyzeAction> + <ArchiveAction + buildConfiguration = "Release" + revealArchiveInOrganizer = "YES"> + </ArchiveAction> +</Scheme> From 936c6204abd28b0e1639bdeec426dfad2e43faf0 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 10:54:10 +0200 Subject: [PATCH 03/11] copied doc building script phase from DTCoreText --- genstrings2.xcodeproj/project.pbxproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genstrings2.xcodeproj/project.pbxproj b/genstrings2.xcodeproj/project.pbxproj index cbe0774..5cda680 100644 --- a/genstrings2.xcodeproj/project.pbxproj +++ b/genstrings2.xcodeproj/project.pbxproj @@ -428,7 +428,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/usr/local/bin/appledoc --print-settings --output \"${BUILD_DIR}/Documentation/\" \"${PROJECT_DIR}\"\necho \"Documentation Output directory: ${BUILD_DIR}/Documentation/\""; + shellScript = "echo \"Documentation Output directory: ${BUILD_DIR}/Documentation/\"\n/usr/local/bin/appledoc --print-settings --output \"${BUILD_DIR}/Documentation/\" \"${PROJECT_DIR}\"\nexit $?"; showEnvVarsInLog = 0; }; A7F65DBC14C03E980092E2EE /* ShellScript */ = { From 9e1a24ecd3b09943744e6e9c5ce677e96ab9076a Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 10:59:58 +0200 Subject: [PATCH 04/11] Fixed doc building --- build.sh | 2 +- .../xcschemes/Documentation.xcscheme | 59 ------------------- 2 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 genstrings2.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme diff --git a/build.sh b/build.sh index a39edcf..d78bae9 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ #!/bin/sh set -e xctool -project genstrings2.xcodeproj -scheme "Static Library" test -arch x86_64 ONLY_ACTIVE_ARCH=NO -xctool -project genstrings2.xcodeproj -scheme "Documentation" +appledoc -o /tmp . diff --git a/genstrings2.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme b/genstrings2.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme deleted file mode 100644 index 63eab4d..0000000 --- a/genstrings2.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<Scheme - LastUpgradeVersion = "0510" - version = "1.3"> - <BuildAction - parallelizeBuildables = "YES" - buildImplicitDependencies = "YES"> - <BuildActionEntries> - <BuildActionEntry - buildForTesting = "YES" - buildForRunning = "YES" - buildForProfiling = "YES" - buildForArchiving = "YES" - buildForAnalyzing = "YES"> - <BuildableReference - BuildableIdentifier = "primary" - BlueprintIdentifier = "A79D903416F7491B009D8A46" - BuildableName = "Documentation" - BlueprintName = "Documentation" - ReferencedContainer = "container:genstrings2.xcodeproj"> - </BuildableReference> - </BuildActionEntry> - </BuildActionEntries> - </BuildAction> - <TestAction - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES" - buildConfiguration = "Debug"> - <Testables> - </Testables> - </TestAction> - <LaunchAction - selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" - selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - launchStyle = "0" - useCustomWorkingDirectory = "NO" - buildConfiguration = "Debug" - ignoresPersistentStateOnLaunch = "NO" - debugDocumentVersioning = "YES" - allowLocationSimulation = "YES"> - <AdditionalOptions> - </AdditionalOptions> - </LaunchAction> - <ProfileAction - shouldUseLaunchSchemeArgsEnv = "YES" - savedToolIdentifier = "" - useCustomWorkingDirectory = "NO" - buildConfiguration = "Release" - debugDocumentVersioning = "YES"> - </ProfileAction> - <AnalyzeAction - buildConfiguration = "Debug"> - </AnalyzeAction> - <ArchiveAction - buildConfiguration = "Release" - revealArchiveInOrganizer = "YES"> - </ArchiveAction> -</Scheme> From c4c77853667766b4fa39d1b31430aed2b6e18877 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 11:03:39 +0200 Subject: [PATCH 05/11] Trying to fix appledoc test by moving it to travis file --- .travis.yml | 3 ++- build.sh | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100755 build.sh diff --git a/.travis.yml b/.travis.yml index b0629c1..3ad36f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,8 @@ before_script: - sudo easy_install cpp-coveralls script: - - ./build.sh + - xctool -project genstrings2.xcodeproj -scheme "Static Library" test -arch x86_64 ONLY_ACTIVE_ARCH=NO + - appledoc -o /tmp . after_success: - ./coveralls.rb --extension m --exclude-folder Demo --exclude-folder Test --exclude-folder Externals diff --git a/build.sh b/build.sh deleted file mode 100755 index d78bae9..0000000 --- a/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -set -e -xctool -project genstrings2.xcodeproj -scheme "Static Library" test -arch x86_64 ONLY_ACTIVE_ARCH=NO -appledoc -o /tmp . From 6d933da8ad37bab1b988d874e4df9ba6b38712fe Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 11:17:49 +0200 Subject: [PATCH 06/11] Disable doc test until Travis provides appledoc --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3ad36f4..88986c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ before_script: script: - xctool -project genstrings2.xcodeproj -scheme "Static Library" test -arch x86_64 ONLY_ACTIVE_ARCH=NO - - appledoc -o /tmp . +# - appledoc -o /tmp . after_success: - ./coveralls.rb --extension m --exclude-folder Demo --exclude-folder Test --exclude-folder Externals From 1efb43a3bab9658a1da6fb9574a3f123ba46e9df Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 11:21:14 +0200 Subject: [PATCH 07/11] Try manual appledoc install via brew --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 88986c4..dd5f701 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,10 +3,11 @@ language: objective-c before_script: - sudo easy_install cpp-coveralls + - brew install appledoc script: - xctool -project genstrings2.xcodeproj -scheme "Static Library" test -arch x86_64 ONLY_ACTIVE_ARCH=NO -# - appledoc -o /tmp . + - appledoc -o /tmp . after_success: - ./coveralls.rb --extension m --exclude-folder Demo --exclude-folder Test --exclude-folder Externals From e497b3e6fcc3e31b4ca2a56a0b2e4791a9f83bc6 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 11:24:33 +0200 Subject: [PATCH 08/11] brew install of appledoc failed, reverted to disabling it for now --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index dd5f701..720d18b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,11 @@ language: objective-c before_script: - sudo easy_install cpp-coveralls - - brew install appledoc script: - xctool -project genstrings2.xcodeproj -scheme "Static Library" test -arch x86_64 ONLY_ACTIVE_ARCH=NO - - appledoc -o /tmp . +### disabled until Travis-CI fixes missing appledoc install on 10.9 machines +# - appledoc -o /tmp . after_success: - ./coveralls.rb --extension m --exclude-folder Demo --exclude-folder Test --exclude-folder Externals From bb0d9cc7d33b7566fb36cb948f16ebe9254baa1b Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 11:28:17 +0200 Subject: [PATCH 09/11] Enabled coverage generation --- genstrings2.xcodeproj/project.pbxproj | 91 +++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/genstrings2.xcodeproj/project.pbxproj b/genstrings2.xcodeproj/project.pbxproj index 5cda680..a28b86c 100644 --- a/genstrings2.xcodeproj/project.pbxproj +++ b/genstrings2.xcodeproj/project.pbxproj @@ -488,6 +488,92 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + A7313BDA190A619A007E130F /* Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "COVERAGE=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.7; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Coverage; + }; + A7313BDB190A619A007E130F /* Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Demo/genstrings2-Prefix.pch"; + OTHER_LDFLAGS = ( + "-ObjC", + "-all_load", + ); + PRODUCT_NAME = genstrings2; + }; + name = Coverage; + }; + A7313BDC190A619A007E130F /* Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ENABLE_OBJC_ARC = YES; + COMBINE_HIDPI_IMAGES = YES; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Core/DTLocalizableStringScanner-Prefix.pch"; + PRODUCT_NAME = DTLocalizableStringScanner; + SKIP_INSTALL = YES; + }; + name = Coverage; + }; + A7313BDD190A619A007E130F /* Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; + GCC_GENERATE_TEST_COVERAGE_FILES = YES; + GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Test/UnitTest-Prefix.pch"; + INFOPLIST_FILE = "Test/UnitTest-Info.plist"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = octest; + }; + name = Coverage; + }; + A7313BDE190A619A007E130F /* Coverage */ = { + isa = XCBuildConfiguration; + buildSettings = { + COMBINE_HIDPI_IMAGES = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Coverage; + }; A775234A14ACEF7A0035CDCA /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -652,6 +738,7 @@ isa = XCConfigurationList; buildConfigurations = ( A775234A14ACEF7A0035CDCA /* Debug */, + A7313BDA190A619A007E130F /* Coverage */, A775234B14ACEF7A0035CDCA /* Release */, ); defaultConfigurationIsVisible = 0; @@ -661,6 +748,7 @@ isa = XCConfigurationList; buildConfigurations = ( A775234D14ACEF7A0035CDCA /* Debug */, + A7313BDB190A619A007E130F /* Coverage */, A775234E14ACEF7A0035CDCA /* Release */, ); defaultConfigurationIsVisible = 0; @@ -670,6 +758,7 @@ isa = XCConfigurationList; buildConfigurations = ( A79AC09614B1A51800489FA3 /* Debug */, + A7313BDC190A619A007E130F /* Coverage */, A79AC09714B1A51800489FA3 /* Release */, ); defaultConfigurationIsVisible = 0; @@ -679,6 +768,7 @@ isa = XCConfigurationList; buildConfigurations = ( A79D903616F7491B009D8A46 /* Debug */, + A7313BDE190A619A007E130F /* Coverage */, A79D903716F7491B009D8A46 /* Release */, ); defaultConfigurationIsVisible = 0; @@ -688,6 +778,7 @@ isa = XCConfigurationList; buildConfigurations = ( A7F65DCC14C03E990092E2EE /* Debug */, + A7313BDD190A619A007E130F /* Coverage */, A7F65DCD14C03E990092E2EE /* Release */, ); defaultConfigurationIsVisible = 0; From 7ebdaefc6b9d26a4651782272799b130b100ceb3 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 11:31:10 +0200 Subject: [PATCH 10/11] Enabled coverage in shared scheme --- .../xcshareddata/xcschemes/Static Library.xcscheme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/genstrings2.xcodeproj/xcshareddata/xcschemes/Static Library.xcscheme b/genstrings2.xcodeproj/xcshareddata/xcschemes/Static Library.xcscheme index 9701ddb..e120a35 100644 --- a/genstrings2.xcodeproj/xcshareddata/xcschemes/Static Library.xcscheme +++ b/genstrings2.xcodeproj/xcshareddata/xcschemes/Static Library.xcscheme @@ -26,7 +26,7 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES" - buildConfiguration = "Debug"> + buildConfiguration = "Coverage"> <Testables> <TestableReference skipped = "NO"> From 0419085c7ae51fd835c804c059a10325b98fe046 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik <oliver@cocoanetics.com> Date: Fri, 25 Apr 2014 11:37:25 +0200 Subject: [PATCH 11/11] Added Travis and Coveralls links to readme --- Readme.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Readme.markdown b/Readme.markdown index 215c3ec..2046eee 100644 --- a/Readme.markdown +++ b/Readme.markdown @@ -1,6 +1,8 @@ DTLocalizableStringScanner ========================== +[![Build Status](https://travis-ci.org/Cocoanetics/DTLocalizableStringScanner.png?branch=develop)](https://travis-ci.org/Cocoanetics/DTLocalizableStringScanner) [![Coverage Status](https://coveralls.io/repos/Cocoanetics/DTLocalizableStringScanner/badge.png?branch=develop)](https://coveralls.io/r/Cocoanetics/DTLocalizableStringScanner?branch=develop) + This project aims to duplicate and enhance the functionality found in the `genstrings` utility provided by Apple. The Demo builds a command line utility `genstrings2` which works like the original but using more modern techniques. The Core contains classes and categories to add this scanning functionality to [Linguan](http://www.cocoanetics.com/apps/linguan/). Documentation