xcodebuild-helper 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. checksums.yaml +7 -0
  2. data/.codeclimate.yml +20 -0
  3. data/.gitignore +1 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +7 -0
  6. data/Gemfile +6 -0
  7. data/Gemfile.lock +110 -0
  8. data/Guardfile +18 -0
  9. data/README.md +7 -0
  10. data/Rakefile +7 -0
  11. data/TODO.md +3 -0
  12. data/bin/oclint +5 -0
  13. data/bin/oclint-0.8 +5 -0
  14. data/bin/oclint-json-compilation-database +5 -0
  15. data/bin/oclint-xcodebuild +5 -0
  16. data/externals/oclint/LICENSE +69 -0
  17. data/externals/oclint/bin/oclint +0 -0
  18. data/externals/oclint/bin/oclint-0.10.2 +0 -0
  19. data/externals/oclint/bin/oclint-json-compilation-database +88 -0
  20. data/externals/oclint/bin/oclint-xcodebuild +218 -0
  21. data/externals/oclint/lib/clang/3.7.0/asan_blacklist.txt +13 -0
  22. data/externals/oclint/lib/clang/3.7.0/include/Intrin.h +958 -0
  23. data/externals/oclint/lib/clang/3.7.0/include/__stddef_max_align_t.h +43 -0
  24. data/externals/oclint/lib/clang/3.7.0/include/__wmmintrin_aes.h +72 -0
  25. data/externals/oclint/lib/clang/3.7.0/include/__wmmintrin_pclmul.h +34 -0
  26. data/externals/oclint/lib/clang/3.7.0/include/adxintrin.h +88 -0
  27. data/externals/oclint/lib/clang/3.7.0/include/altivec.h +13528 -0
  28. data/externals/oclint/lib/clang/3.7.0/include/ammintrin.h +215 -0
  29. data/externals/oclint/lib/clang/3.7.0/include/arm_acle.h +304 -0
  30. data/externals/oclint/lib/clang/3.7.0/include/arm_neon.h +68419 -0
  31. data/externals/oclint/lib/clang/3.7.0/include/avx2intrin.h +1256 -0
  32. data/externals/oclint/lib/clang/3.7.0/include/avx512bwintrin.h +1250 -0
  33. data/externals/oclint/lib/clang/3.7.0/include/avx512cdintrin.h +131 -0
  34. data/externals/oclint/lib/clang/3.7.0/include/avx512dqintrin.h +242 -0
  35. data/externals/oclint/lib/clang/3.7.0/include/avx512erintrin.h +285 -0
  36. data/externals/oclint/lib/clang/3.7.0/include/avx512fintrin.h +2457 -0
  37. data/externals/oclint/lib/clang/3.7.0/include/avx512vlbwintrin.h +1907 -0
  38. data/externals/oclint/lib/clang/3.7.0/include/avx512vldqintrin.h +353 -0
  39. data/externals/oclint/lib/clang/3.7.0/include/avx512vlintrin.h +1982 -0
  40. data/externals/oclint/lib/clang/3.7.0/include/avxintrin.h +1308 -0
  41. data/externals/oclint/lib/clang/3.7.0/include/bmi2intrin.h +99 -0
  42. data/externals/oclint/lib/clang/3.7.0/include/bmiintrin.h +153 -0
  43. data/externals/oclint/lib/clang/3.7.0/include/cpuid.h +209 -0
  44. data/externals/oclint/lib/clang/3.7.0/include/cuda_builtin_vars.h +110 -0
  45. data/externals/oclint/lib/clang/3.7.0/include/emmintrin.h +1480 -0
  46. data/externals/oclint/lib/clang/3.7.0/include/f16cintrin.h +63 -0
  47. data/externals/oclint/lib/clang/3.7.0/include/float.h +124 -0
  48. data/externals/oclint/lib/clang/3.7.0/include/fma4intrin.h +236 -0
  49. data/externals/oclint/lib/clang/3.7.0/include/fmaintrin.h +234 -0
  50. data/externals/oclint/lib/clang/3.7.0/include/fxsrintrin.h +55 -0
  51. data/externals/oclint/lib/clang/3.7.0/include/htmintrin.h +226 -0
  52. data/externals/oclint/lib/clang/3.7.0/include/htmxlintrin.h +363 -0
  53. data/externals/oclint/lib/clang/3.7.0/include/ia32intrin.h +101 -0
  54. data/externals/oclint/lib/clang/3.7.0/include/immintrin.h +203 -0
  55. data/externals/oclint/lib/clang/3.7.0/include/inttypes.h +102 -0
  56. data/externals/oclint/lib/clang/3.7.0/include/iso646.h +43 -0
  57. data/externals/oclint/lib/clang/3.7.0/include/limits.h +118 -0
  58. data/externals/oclint/lib/clang/3.7.0/include/lzcntintrin.h +72 -0
  59. data/externals/oclint/lib/clang/3.7.0/include/mm3dnow.h +167 -0
  60. data/externals/oclint/lib/clang/3.7.0/include/mm_malloc.h +75 -0
  61. data/externals/oclint/lib/clang/3.7.0/include/mmintrin.h +507 -0
  62. data/externals/oclint/lib/clang/3.7.0/include/module.modulemap +196 -0
  63. data/externals/oclint/lib/clang/3.7.0/include/nmmintrin.h +35 -0
  64. data/externals/oclint/lib/clang/3.7.0/include/pmmintrin.h +122 -0
  65. data/externals/oclint/lib/clang/3.7.0/include/popcntintrin.h +50 -0
  66. data/externals/oclint/lib/clang/3.7.0/include/prfchwintrin.h +39 -0
  67. data/externals/oclint/lib/clang/3.7.0/include/rdseedintrin.h +59 -0
  68. data/externals/oclint/lib/clang/3.7.0/include/rtmintrin.h +59 -0
  69. data/externals/oclint/lib/clang/3.7.0/include/s390intrin.h +39 -0
  70. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/allocator_interface.h +66 -0
  71. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/asan_interface.h +155 -0
  72. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/common_interface_defs.h +118 -0
  73. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/coverage_interface.h +63 -0
  74. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/dfsan_interface.h +114 -0
  75. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/linux_syscall_hooks.h +3070 -0
  76. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/lsan_interface.h +84 -0
  77. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/msan_interface.h +107 -0
  78. data/externals/oclint/lib/clang/3.7.0/include/sanitizer/tsan_interface_atomic.h +222 -0
  79. data/externals/oclint/lib/clang/3.7.0/include/shaintrin.h +79 -0
  80. data/externals/oclint/lib/clang/3.7.0/include/smmintrin.h +487 -0
  81. data/externals/oclint/lib/clang/3.7.0/include/stdalign.h +35 -0
  82. data/externals/oclint/lib/clang/3.7.0/include/stdarg.h +52 -0
  83. data/externals/oclint/lib/clang/3.7.0/include/stdatomic.h +190 -0
  84. data/externals/oclint/lib/clang/3.7.0/include/stdbool.h +44 -0
  85. data/externals/oclint/lib/clang/3.7.0/include/stddef.h +137 -0
  86. data/externals/oclint/lib/clang/3.7.0/include/stdint.h +707 -0
  87. data/externals/oclint/lib/clang/3.7.0/include/stdnoreturn.h +30 -0
  88. data/externals/oclint/lib/clang/3.7.0/include/tbmintrin.h +154 -0
  89. data/externals/oclint/lib/clang/3.7.0/include/tgmath.h +1374 -0
  90. data/externals/oclint/lib/clang/3.7.0/include/tmmintrin.h +230 -0
  91. data/externals/oclint/lib/clang/3.7.0/include/unwind.h +282 -0
  92. data/externals/oclint/lib/clang/3.7.0/include/vadefs.h +65 -0
  93. data/externals/oclint/lib/clang/3.7.0/include/varargs.h +26 -0
  94. data/externals/oclint/lib/clang/3.7.0/include/vecintrin.h +8946 -0
  95. data/externals/oclint/lib/clang/3.7.0/include/wmmintrin.h +42 -0
  96. data/externals/oclint/lib/clang/3.7.0/include/x86intrin.h +81 -0
  97. data/externals/oclint/lib/clang/3.7.0/include/xmmintrin.h +1008 -0
  98. data/externals/oclint/lib/clang/3.7.0/include/xopintrin.h +809 -0
  99. data/externals/oclint/lib/clang/3.7.0/include/xtestintrin.h +41 -0
  100. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
  101. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
  102. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.builtins-i386.a +0 -0
  103. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.builtins-x86_64.a +0 -0
  104. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.profile_osx.a +0 -0
  105. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.safestack_osx.a +0 -0
  106. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
  107. data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
  108. data/externals/oclint/lib/oclint/reporters/libHTMLReporter.dylib +0 -0
  109. data/externals/oclint/lib/oclint/reporters/libJSONReporter.dylib +0 -0
  110. data/externals/oclint/lib/oclint/reporters/libPMDReporter.dylib +0 -0
  111. data/externals/oclint/lib/oclint/reporters/libTextReporter.dylib +0 -0
  112. data/externals/oclint/lib/oclint/reporters/libXMLReporter.dylib +0 -0
  113. data/externals/oclint/lib/oclint/reporters/libXcodeReporter.dylib +0 -0
  114. data/externals/oclint/lib/oclint/rules/libAvoidBranchingStatementAsLastInLoopRule.dylib +0 -0
  115. data/externals/oclint/lib/oclint/rules/libAvoidDefaultArgumentsOnVirtualMethodsRule.dylib +0 -0
  116. data/externals/oclint/lib/oclint/rules/libAvoidPrivateStaticMembersRule.dylib +0 -0
  117. data/externals/oclint/lib/oclint/rules/libBaseClassDestructorShouldBeVirtualOrProtectedRule.dylib +0 -0
  118. data/externals/oclint/lib/oclint/rules/libBitwiseOperatorInConditionalRule.dylib +0 -0
  119. data/externals/oclint/lib/oclint/rules/libBrokenNullCheckRule.dylib +0 -0
  120. data/externals/oclint/lib/oclint/rules/libBrokenOddnessCheckRule.dylib +0 -0
  121. data/externals/oclint/lib/oclint/rules/libCollapsibleIfStatementsRule.dylib +0 -0
  122. data/externals/oclint/lib/oclint/rules/libConstantConditionalOperatorRule.dylib +0 -0
  123. data/externals/oclint/lib/oclint/rules/libConstantIfExpressionRule.dylib +0 -0
  124. data/externals/oclint/lib/oclint/rules/libCoveredSwitchStatementsDontNeedDefaultRule.dylib +0 -0
  125. data/externals/oclint/lib/oclint/rules/libCyclomaticComplexityRule.dylib +0 -0
  126. data/externals/oclint/lib/oclint/rules/libDeadCodeRule.dylib +0 -0
  127. data/externals/oclint/lib/oclint/rules/libDefaultLabelNotLastInSwitchStatementRule.dylib +0 -0
  128. data/externals/oclint/lib/oclint/rules/libDestructorOfVirtualClassRule.dylib +0 -0
  129. data/externals/oclint/lib/oclint/rules/libDoubleNegativeRule.dylib +0 -0
  130. data/externals/oclint/lib/oclint/rules/libEmptyCatchStatementRule.dylib +0 -0
  131. data/externals/oclint/lib/oclint/rules/libEmptyDoWhileStatementRule.dylib +0 -0
  132. data/externals/oclint/lib/oclint/rules/libEmptyElseBlockRule.dylib +0 -0
  133. data/externals/oclint/lib/oclint/rules/libEmptyFinallyStatementRule.dylib +0 -0
  134. data/externals/oclint/lib/oclint/rules/libEmptyForStatementRule.dylib +0 -0
  135. data/externals/oclint/lib/oclint/rules/libEmptyIfStatementRule.dylib +0 -0
  136. data/externals/oclint/lib/oclint/rules/libEmptySwitchStatementRule.dylib +0 -0
  137. data/externals/oclint/lib/oclint/rules/libEmptyTryStatementRule.dylib +0 -0
  138. data/externals/oclint/lib/oclint/rules/libEmptyWhileStatementRule.dylib +0 -0
  139. data/externals/oclint/lib/oclint/rules/libForLoopShouldBeWhileLoopRule.dylib +0 -0
  140. data/externals/oclint/lib/oclint/rules/libGotoStatementRule.dylib +0 -0
  141. data/externals/oclint/lib/oclint/rules/libInvertedLogicRule.dylib +0 -0
  142. data/externals/oclint/lib/oclint/rules/libJumbledIncrementerRule.dylib +0 -0
  143. data/externals/oclint/lib/oclint/rules/libLongClassRule.dylib +0 -0
  144. data/externals/oclint/lib/oclint/rules/libLongLineRule.dylib +0 -0
  145. data/externals/oclint/lib/oclint/rules/libLongMethodRule.dylib +0 -0
  146. data/externals/oclint/lib/oclint/rules/libLongVariableNameRule.dylib +0 -0
  147. data/externals/oclint/lib/oclint/rules/libMisplacedNullCheckRule.dylib +0 -0
  148. data/externals/oclint/lib/oclint/rules/libMissingBreakInSwitchStatementRule.dylib +0 -0
  149. data/externals/oclint/lib/oclint/rules/libMultipleUnaryOperatorRule.dylib +0 -0
  150. data/externals/oclint/lib/oclint/rules/libNPathComplexityRule.dylib +0 -0
  151. data/externals/oclint/lib/oclint/rules/libNcssMethodCountRule.dylib +0 -0
  152. data/externals/oclint/lib/oclint/rules/libNestedBlockDepthRule.dylib +0 -0
  153. data/externals/oclint/lib/oclint/rules/libNonCaseLabelInSwitchStatementRule.dylib +0 -0
  154. data/externals/oclint/lib/oclint/rules/libObjCAssignIvarOutsideAccessorsRule.dylib +0 -0
  155. data/externals/oclint/lib/oclint/rules/libObjCBoxedExpressionsRule.dylib +0 -0
  156. data/externals/oclint/lib/oclint/rules/libObjCContainerLiteralsRule.dylib +0 -0
  157. data/externals/oclint/lib/oclint/rules/libObjCNSNumberLiteralsRule.dylib +0 -0
  158. data/externals/oclint/lib/oclint/rules/libObjCObjectSubscriptingRule.dylib +0 -0
  159. data/externals/oclint/lib/oclint/rules/libObjCVerifyIsEqualHashRule.dylib +0 -0
  160. data/externals/oclint/lib/oclint/rules/libObjCVerifyMustCallSuperRule.dylib +0 -0
  161. data/externals/oclint/lib/oclint/rules/libObjCVerifyProhibitedCallRule.dylib +0 -0
  162. data/externals/oclint/lib/oclint/rules/libObjCVerifyProtectedMethodRule.dylib +0 -0
  163. data/externals/oclint/lib/oclint/rules/libObjCVerifySubclassMustImplementRule.dylib +0 -0
  164. data/externals/oclint/lib/oclint/rules/libParameterReassignmentRule.dylib +0 -0
  165. data/externals/oclint/lib/oclint/rules/libPreferEarlyExitRule.dylib +0 -0
  166. data/externals/oclint/lib/oclint/rules/libRedundantConditionalOperatorRule.dylib +0 -0
  167. data/externals/oclint/lib/oclint/rules/libRedundantIfStatementRule.dylib +0 -0
  168. data/externals/oclint/lib/oclint/rules/libRedundantLocalVariableRule.dylib +0 -0
  169. data/externals/oclint/lib/oclint/rules/libRedundantNilCheckRule.dylib +0 -0
  170. data/externals/oclint/lib/oclint/rules/libReturnFromFinallyBlockRule.dylib +0 -0
  171. data/externals/oclint/lib/oclint/rules/libShortVariableNameRule.dylib +0 -0
  172. data/externals/oclint/lib/oclint/rules/libSwitchStatementsShouldHaveDefaultRule.dylib +0 -0
  173. data/externals/oclint/lib/oclint/rules/libThrowExceptionFromFinallyBlockRule.dylib +0 -0
  174. data/externals/oclint/lib/oclint/rules/libTooFewBranchesInSwitchStatementRule.dylib +0 -0
  175. data/externals/oclint/lib/oclint/rules/libTooManyFieldsRule.dylib +0 -0
  176. data/externals/oclint/lib/oclint/rules/libTooManyMethodsRule.dylib +0 -0
  177. data/externals/oclint/lib/oclint/rules/libTooManyParametersRule.dylib +0 -0
  178. data/externals/oclint/lib/oclint/rules/libUnnecessaryElseStatementRule.dylib +0 -0
  179. data/externals/oclint/lib/oclint/rules/libUnnecessaryNullCheckForCXXDeallocRule.dylib +0 -0
  180. data/externals/oclint/lib/oclint/rules/libUnusedLocalVariableRule.dylib +0 -0
  181. data/externals/oclint/lib/oclint/rules/libUnusedMethodParameterRule.dylib +0 -0
  182. data/externals/oclint/lib/oclint/rules/libUselessParenthesesRule.dylib +0 -0
  183. data/lib/coverage_plan.rb +19 -0
  184. data/lib/device.rb +27 -0
  185. data/lib/execute.rb +7 -0
  186. data/lib/lint_plan.rb +41 -0
  187. data/lib/rules.rb +23 -0
  188. data/lib/test_plan.rb +11 -0
  189. data/lib/version.rb +3 -0
  190. data/lib/xcode.rb +128 -0
  191. data/lib/xcodebuild-helper.rb +110 -0
  192. data/spec/coverage_plan_spec.rb +18 -0
  193. data/spec/device_spec.rb +24 -0
  194. data/spec/lint_plan_spec.rb +35 -0
  195. data/spec/rule_spec.rb +37 -0
  196. data/spec/spec_helper.rb +17 -0
  197. data/spec/test_plan_spec.rb +11 -0
  198. data/spec/xcode_dsl_actions_spec.rb +136 -0
  199. data/spec/xcode_dsl_spec.rb +176 -0
  200. data/spec/xcode_spec.rb +79 -0
  201. data/xcodebuild-helper.gemspec +26 -0
  202. metadata +327 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b3b4c4f399d788c87a4552d3cfb24e8dc0df5bb0
4
+ data.tar.gz: 7907489264e4bc9785be226e892b360c8f9e65fa
5
+ SHA512:
6
+ metadata.gz: 38122ba3e34aa153b25bd6736b4abef0d5f1914413e173a600cb8c976a83986b64501075e59d61bebeb9076662de79ad72fa1abc7bc4f892cd9da2ac30b3103a
7
+ data.tar.gz: c541b7505510cdc456336532a6252dbc91269f0a6c9b7bcd4d9b2349946eaf6da0661cf63be4f3d8ac226816c7c1335ddfb837aa655a5714422be0d15a81746f
data/.codeclimate.yml ADDED
@@ -0,0 +1,20 @@
1
+ engines:
2
+ fixme:
3
+ enabled: true
4
+ bundler-audit:
5
+ enabled: true
6
+ duplication:
7
+ enabled: true
8
+ config:
9
+ languages:
10
+ - ruby
11
+ rubocop:
12
+ enabled: true
13
+ ratings:
14
+ paths:
15
+ - lib/**
16
+ - "**.rb"
17
+ exclude_paths:
18
+ - externals/**/*
19
+ - bin/**/*
20
+ - spec/**/*
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ coverage
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.1
4
+ install:
5
+ - bundle install
6
+ script:
7
+ - bundle exec rake
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+ ruby '2.2.1'
3
+
4
+ gem 'coveralls', require: false
5
+
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,110 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ xcodebuild-helper (1.0.0)
5
+ xcodeproj (~> 0.28)
6
+ xcpretty (~> 0.2)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ activesupport (4.2.6)
12
+ i18n (~> 0.7)
13
+ json (~> 1.7, >= 1.7.7)
14
+ minitest (~> 5.1)
15
+ thread_safe (~> 0.3, >= 0.3.4)
16
+ tzinfo (~> 1.1)
17
+ claide (0.9.1)
18
+ coderay (1.1.1)
19
+ colored (1.2)
20
+ coveralls (0.8.13)
21
+ json (~> 1.8)
22
+ simplecov (~> 0.11.0)
23
+ term-ansicolor (~> 1.3)
24
+ thor (~> 0.19.1)
25
+ tins (~> 1.6.0)
26
+ diff-lcs (1.2.5)
27
+ docile (1.1.5)
28
+ ffi (1.9.10)
29
+ formatador (0.2.5)
30
+ guard (2.13.0)
31
+ formatador (>= 0.2.4)
32
+ listen (>= 2.7, <= 4.0)
33
+ lumberjack (~> 1.0)
34
+ nenv (~> 0.1)
35
+ notiffany (~> 0.0)
36
+ pry (>= 0.9.12)
37
+ shellany (~> 0.0)
38
+ thor (>= 0.18.1)
39
+ guard-compat (1.2.1)
40
+ guard-rspec (4.6.4)
41
+ guard (~> 2.1)
42
+ guard-compat (~> 1.1)
43
+ rspec (>= 2.99.0, < 4.0)
44
+ i18n (0.7.0)
45
+ json (1.8.3)
46
+ listen (3.0.6)
47
+ rb-fsevent (>= 0.9.3)
48
+ rb-inotify (>= 0.9.7)
49
+ lumberjack (1.0.10)
50
+ method_source (0.8.2)
51
+ minitest (5.8.4)
52
+ nenv (0.3.0)
53
+ notiffany (0.0.8)
54
+ nenv (~> 0.1)
55
+ shellany (~> 0.0)
56
+ pry (0.10.3)
57
+ coderay (~> 1.1.0)
58
+ method_source (~> 0.8.1)
59
+ slop (~> 3.4)
60
+ rake (11.1.2)
61
+ rb-fsevent (0.9.7)
62
+ rb-inotify (0.9.7)
63
+ ffi (>= 0.5.0)
64
+ rouge (1.10.1)
65
+ rspec (3.4.0)
66
+ rspec-core (~> 3.4.0)
67
+ rspec-expectations (~> 3.4.0)
68
+ rspec-mocks (~> 3.4.0)
69
+ rspec-core (3.4.4)
70
+ rspec-support (~> 3.4.0)
71
+ rspec-expectations (3.4.0)
72
+ diff-lcs (>= 1.2.0, < 2.0)
73
+ rspec-support (~> 3.4.0)
74
+ rspec-mocks (3.4.1)
75
+ diff-lcs (>= 1.2.0, < 2.0)
76
+ rspec-support (~> 3.4.0)
77
+ rspec-support (3.4.1)
78
+ shellany (0.0.1)
79
+ simplecov (0.11.2)
80
+ docile (~> 1.1.0)
81
+ json (~> 1.8)
82
+ simplecov-html (~> 0.10.0)
83
+ simplecov-html (0.10.0)
84
+ slop (3.6.0)
85
+ term-ansicolor (1.3.2)
86
+ tins (~> 1.0)
87
+ thor (0.19.1)
88
+ thread_safe (0.3.5)
89
+ tins (1.6.0)
90
+ tzinfo (1.2.2)
91
+ thread_safe (~> 0.1)
92
+ xcodeproj (0.28.2)
93
+ activesupport (>= 3)
94
+ claide (~> 0.9.1)
95
+ colored (~> 1.2)
96
+ xcpretty (0.2.2)
97
+ rouge (~> 1.8)
98
+
99
+ PLATFORMS
100
+ ruby
101
+
102
+ DEPENDENCIES
103
+ coveralls
104
+ guard-rspec (~> 4.6)
105
+ rake (~> 11.1)
106
+ rspec (~> 3.4)
107
+ xcodebuild-helper!
108
+
109
+ BUNDLED WITH
110
+ 1.11.2
data/Guardfile ADDED
@@ -0,0 +1,18 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+ guard :rspec, cmd: "bundle exec rspec" do
4
+ require "guard/rspec/dsl"
5
+ dsl = Guard::RSpec::Dsl.new(self)
6
+
7
+ # Feel free to open issues for suggestions and improvements
8
+
9
+ # RSpec files
10
+ rspec = dsl.rspec
11
+ watch(rspec.spec_helper) { rspec.spec_dir }
12
+ watch(rspec.spec_support) { rspec.spec_dir }
13
+ watch(rspec.spec_files)
14
+
15
+ # Ruby files
16
+ ruby = dsl.ruby
17
+ dsl.watch_spec_files_for(ruby.lib_files)
18
+ end
data/README.md ADDED
@@ -0,0 +1,7 @@
1
+ [![Build Status](https://travis-ci.org/xlr8runner/xcodebuild-helper.svg?branch=master)](https://travis-ci.org/xlr8runner/xcodebuild-helper)
2
+ [![Coverage Status](https://coveralls.io/repos/github/xlr8runner/xcodebuild-helper/badge.svg?branch=master)](https://coveralls.io/github/xlr8runner/xcodebuild-helper?branch=master)
3
+ [![Code Climate](https://codeclimate.com/github/xlr8runner/xcodebuild-helper/badges/gpa.svg)](https://codeclimate.com/github/xlr8runner/xcodebuild-helper)
4
+
5
+ # XCode Build Helper
6
+ DSL to help call xcode CLI more easily
7
+
data/Rakefile ADDED
@@ -0,0 +1,7 @@
1
+ task :default => [:spec]
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ rescue LoadError
7
+ end
data/TODO.md ADDED
@@ -0,0 +1,3 @@
1
+ ### Things that need to get done ###
2
+ * Configure the XCode DSL
3
+ * Create a code coverage parser that creates XML
data/bin/oclint ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ pn = Pathname.new(__FILE__)
4
+ opts = ARGV.join(" ")
5
+ puts `"#{pn.dirname}/.././externals/oclint/bin/#{pn.basename}" #{opts}`
data/bin/oclint-0.8 ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ pn = Pathname.new(__FILE__)
4
+ opts = ARGV.join(" ")
5
+ puts `"#{pn.dirname}/.././externals/oclint/bin/#{pn.basename}" #{opts}`
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ pn = Pathname.new(__FILE__)
4
+ opts = ARGV.join(" ")
5
+ puts `"#{pn.dirname}/.././externals/oclint/bin/#{pn.basename}" #{opts}`
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ pn = Pathname.new(__FILE__)
4
+ opts = ARGV.join(" ")
5
+ puts `"#{pn.dirname}/.././externals/oclint/bin/#{pn.basename}" #{opts}`
@@ -0,0 +1,69 @@
1
+ Copyright (C) 2010-2014 Longyi Qi, 2015 Ryuichi Saito, LLC. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are met:
5
+
6
+ * Redistributions of source code must retain the above copyright notice, this
7
+ list of conditions and the following disclaimer.
8
+ * Redistributions in binary form must reproduce the above copyright notice,
9
+ this list of conditions and the following disclaimer in the documentation
10
+ and/or other materials provided with the distribution.
11
+ * Neither the name of the author nor the names of its contributors may be used
12
+ to endorse or promote products derived from this software without specific
13
+ prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+
26
+ ==============================================================================
27
+ LLVM Release License
28
+ ==============================================================================
29
+ University of Illinois/NCSA
30
+ Open Source License
31
+
32
+ Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign.
33
+ All rights reserved.
34
+
35
+ Developed by:
36
+
37
+ LLVM Team
38
+
39
+ University of Illinois at Urbana-Champaign
40
+
41
+ http://llvm.org
42
+
43
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
44
+ this software and associated documentation files (the "Software"), to deal with
45
+ the Software without restriction, including without limitation the rights to
46
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
47
+ of the Software, and to permit persons to whom the Software is furnished to do
48
+ so, subject to the following conditions:
49
+
50
+ * Redistributions of source code must retain the above copyright notice,
51
+ this list of conditions and the following disclaimers.
52
+
53
+ * Redistributions in binary form must reproduce the above copyright notice,
54
+ this list of conditions and the following disclaimers in the
55
+ documentation and/or other materials provided with the distribution.
56
+
57
+ * Neither the names of the LLVM Team, University of Illinois at
58
+ Urbana-Champaign, nor the names of its contributors may be used to
59
+ endorse or promote products derived from this Software without specific
60
+ prior written permission.
61
+
62
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
63
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
64
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65
+ CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
66
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
67
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
68
+ SOFTWARE.
69
+
Binary file
Binary file
@@ -0,0 +1,88 @@
1
+ #!/usr/bin/env python
2
+
3
+ import os
4
+ import platform
5
+ import json
6
+ import argparse
7
+ import re
8
+ import subprocess
9
+ import sys
10
+
11
+ OCLINT_BIN_FOLDER = os.path.dirname(os.path.abspath(__file__))
12
+ OCLINT_BIN = OCLINT_BIN_FOLDER + os.sep + "oclint"
13
+ if platform.system() == "Windows":
14
+ OCLINT_BIN += ".exe"
15
+ CURRENT_WORKING_DIRECTORY = os.getcwd()
16
+ JSON_COMPILATION_DATABASE = CURRENT_WORKING_DIRECTORY + os.sep + "compile_commands.json"
17
+
18
+ arg_parser = argparse.ArgumentParser(description='OCLint for JSON Compilation Database (compile_commands.json)')
19
+ arg_parser.add_argument("-v", action="store_true", dest="invocation", help="show invocation command with arguments")
20
+ arg_parser.add_argument('-debug', '--debug', action="store_true", dest="debug", help="invoke OCLint in debug mode")
21
+ arg_parser.add_argument('-i', '-include', '--include', action='append', dest='includes', help="extract files matching pattern")
22
+ arg_parser.add_argument('-e', '-exclude', '--exclude', action='append', dest='excludes', help="remove files matching pattern")
23
+ arg_parser.add_argument('oclint_args', nargs='*', help="arguments that are passed to OCLint invocation")
24
+ args = arg_parser.parse_args()
25
+
26
+ def get_source_path(file_attr, dir_attr):
27
+ if file_attr.startswith(os.sep):
28
+ return file_attr
29
+ elif dir_attr.endswith(os.sep):
30
+ return dir_attr + file_attr
31
+ else:
32
+ return dir_attr + os.sep + file_attr
33
+
34
+ def source_exist_at(path):
35
+ return os.path.isfile(path)
36
+
37
+ def source_list_inclusion_filter(source_list, inclusion_filter):
38
+ filtered_list = []
39
+ for path in source_list:
40
+ if re.search(inclusion_filter, path):
41
+ filtered_list.append(path)
42
+ return filtered_list
43
+
44
+ def source_list_exclusion_filter(source_list, exclusion_filter):
45
+ filtered_list = []
46
+ for path in source_list:
47
+ if not re.search(exclusion_filter, path):
48
+ filtered_list.append(path)
49
+ return filtered_list
50
+
51
+ if not source_exist_at(OCLINT_BIN):
52
+ print "Error: OCLint executable file not found."
53
+ sys.exit(99)
54
+
55
+ if not source_exist_at(JSON_COMPILATION_DATABASE):
56
+ print "Error: compile_commands.json not found at current location."
57
+ sys.exit(98)
58
+
59
+ compilation_database = json.load(open(JSON_COMPILATION_DATABASE))
60
+ source_list = []
61
+ for file_item in compilation_database:
62
+ file_path = file_item["file"]
63
+ if not platform.system() == "Windows":
64
+ file_path = get_source_path(file_item["file"], file_item["directory"])
65
+ if source_exist_at(file_path) and not file_path in source_list:
66
+ source_list.append(file_path)
67
+ if args.includes:
68
+ matched_list = []
69
+ for inclusion_filter in args.includes:
70
+ matched_list.extend( source_list_inclusion_filter(source_list, inclusion_filter) )
71
+ source_list = matched_list
72
+ if args.excludes:
73
+ for exclusion_filter in args.excludes:
74
+ source_list = source_list_exclusion_filter(source_list, exclusion_filter)
75
+ source_paths = '"' + '" "'.join(source_list) + '"'
76
+ oclint_arguments = ''
77
+ if args.oclint_args:
78
+ oclint_arguments = ' ' + ' '.join(args.oclint_args)
79
+ debug_argument = ''
80
+ if args.debug:
81
+ debug_argument = ' -debug'
82
+ oclint_invocation = OCLINT_BIN + debug_argument + oclint_arguments + ' ' + source_paths
83
+ if args.invocation:
84
+ print '------------------------------ OCLint ------------------------------'
85
+ print oclint_invocation
86
+ print '--------------------------------------------------------------------'
87
+ exit_code = subprocess.call(oclint_invocation, shell=True)
88
+ sys.exit(exit_code)
@@ -0,0 +1,218 @@
1
+ #!/usr/bin/env python
2
+
3
+ import os
4
+ import sys
5
+ import json
6
+ import argparse
7
+ import re
8
+ import shlex
9
+ import StringIO
10
+ import glob
11
+ import itertools
12
+
13
+
14
+ SUPPORTED_COMPILERS = [
15
+ "clang",
16
+ "clang\+\+",
17
+ "llvm-cpp-4.2",
18
+ "llvm-g\+\+",
19
+ "llvm-g\+\+-4.2",
20
+ "llvm-gcc",
21
+ "llvm-gcc-4.2",
22
+ "arm-apple-darwin10-llvm-g\+\+-4.2",
23
+ "arm-apple-darwin10-llvm-gcc-4.2",
24
+ "i686-apple-darwin10-llvm-g\+\+-4.2",
25
+ "i686-apple-darwin10-llvm-gcc-4.2",
26
+ "gcc",
27
+ "g\+\+",
28
+ "c\+\+",
29
+ "cc"
30
+ ]
31
+
32
+ DEFAULT_INPUT_FILE = "xcodebuild.log"
33
+
34
+ JSON_COMPILATION_DATABASE = "compile_commands.json"
35
+
36
+
37
+ _find_unsafe = re.compile('[ "\\\\]').search
38
+
39
+ def clang_quote(s):
40
+ """
41
+ Return a minimally-escaped version of the string *s* that clang-based tools understand.
42
+ (See http://clang.llvm.org/docs/JSONCompilationDatabase.html)
43
+ ex:
44
+ clang_quote('aa') == r'aa'
45
+ clang_quote('a"a') == r'"a\"a"'
46
+ clang_quote('--my-option=a"a') == r'"--my-option=a\"a"'
47
+ """
48
+ if not s:
49
+ return '""'
50
+
51
+ if _find_unsafe(s) is None:
52
+ return s
53
+
54
+ return '"' + s.replace('\\', '\\\\').replace('"', '\\"') + '"'
55
+
56
+
57
+ _find_quoting = re.compile('[\'"\\\\]').search
58
+
59
+ def tokenize_command(c):
60
+ """Compute the list of shell arguments in *c* using shlex.split (note: make an explicit call to StringIO for compatibility with Python 2)."""
61
+ if _find_quoting(c) is None:
62
+ return map(str.strip, c.strip().split(' '))
63
+ else:
64
+ return shlex.split(StringIO.StringIO(c))
65
+
66
+ # global table to map pth files to (source) pch files
67
+ _pch_dictionary = {}
68
+
69
+ def register_source_for_pth_file(clang_command, directory):
70
+ tokens = iter(tokenize_command(clang_command))
71
+ src_file = ""
72
+ pth_file = ""
73
+ try:
74
+ while 1:
75
+ tok = tokens.next()
76
+ if tok == '-c':
77
+ file = tokens.next()
78
+ src_file = file
79
+ elif tok == '-o':
80
+ file = tokens.next()
81
+ if file.endswith('.pch.pth') or file.endswith('.pch.pch') or file.endswith('.h.pch'):
82
+ pth_file = file
83
+ except StopIteration:
84
+ if src_file and pth_file:
85
+ _pch_dictionary[pth_file] = src_file
86
+
87
+ def get_source_for_pth_file(file):
88
+ src_file = _pch_dictionary.get(file + '.pth')
89
+ if src_file is not None:
90
+ return src_file
91
+ return _pch_dictionary.get(file + '.pch')
92
+
93
+ def process_clang_command(clang_command, directory):
94
+ tokens = iter(tokenize_command(clang_command))
95
+ command = []
96
+ source_file = None
97
+
98
+ try:
99
+ while 1:
100
+ tok = tokens.next()
101
+ if tok == '-include':
102
+ include_file = tokens.next()
103
+ if not os.path.isfile(include_file):
104
+ src_file = get_source_for_pth_file(include_file)
105
+ if src_file is not None:
106
+ include_file = src_file
107
+ else:
108
+ print "cannot find original pch source file for %s" % include_file
109
+ exit(3)
110
+ command.append(tok)
111
+ command.append(clang_quote(include_file))
112
+
113
+ elif tok == '-c':
114
+ source_file = tokens.next()
115
+ command.append(tok)
116
+ command.append(clang_quote(source_file))
117
+
118
+ else:
119
+ command.append(clang_quote(tok))
120
+
121
+ except StopIteration:
122
+ return {"directory": directory, "command": " ".join(command), "file": os.path.normpath(source_file)}
123
+
124
+
125
+ def read_directory(line):
126
+ tokens = tokenize_command(line)
127
+ if tokens[0] == "cd":
128
+ return tokens[1]
129
+ else:
130
+ return ""
131
+
132
+ def convert(input_file, output_file, is_excluded=None):
133
+ json_input_mode = input_file.endswith('.json')
134
+
135
+ find_compileC = re.compile("CompileC").search
136
+
137
+ find_processPCH = re.compile("ProcessPCH").search
138
+
139
+ find_clang_command = re.compile("(" + "|".join(SUPPORTED_COMPILERS) + ") .* -c .* -o ").search
140
+
141
+ if is_excluded is None:
142
+ is_excluded = (lambda x: False)
143
+
144
+ with open(output_file, "w") as output:
145
+ with open(input_file, "r") as input:
146
+ if json_input_mode:
147
+ lines = itertools.chain(*(json.loads(line).get('command', '').encode("utf8").splitlines(True) for line in input))
148
+ else:
149
+ lines = input
150
+ try:
151
+ output.write("[")
152
+ cr = "\n"
153
+ while 1:
154
+ log_line = lines.next()
155
+ compilation_section_re = find_compileC(log_line)
156
+ if compilation_section_re:
157
+ directory = read_directory(lines.next())
158
+ if is_excluded(directory):
159
+ continue
160
+ while 1:
161
+ log_line = lines.next()
162
+ if not find_clang_command(log_line):
163
+ continue
164
+ output_record = process_clang_command(log_line, directory)
165
+ output.write(cr)
166
+ output.write(json.dumps(output_record, indent=2))
167
+ cr = ",\n"
168
+ break
169
+ continue
170
+ compilation_section_re = find_processPCH(log_line)
171
+ if compilation_section_re:
172
+ directory = read_directory(lines.next())
173
+ if is_excluded(directory):
174
+ continue
175
+ while 1:
176
+ log_line = lines.next()
177
+ if not find_clang_command(log_line):
178
+ continue
179
+ register_source_for_pth_file(log_line, directory)
180
+ break
181
+ continue
182
+ except StopIteration:
183
+ output.write("\n]\n");
184
+
185
+ def main():
186
+ arg_parser = argparse.ArgumentParser(description='Converts xcodebuild logs or xctool-json-reporter logs to compile_commands.json')
187
+ arg_parser.add_argument("-e", "-exclude", dest="exclusion", help="Directory exclusion pattern (regular expression)")
188
+ arg_parser.add_argument("-o", "-output", dest="output_file", help="Output json file (default: ./%s)" % JSON_COMPILATION_DATABASE)
189
+ arg_parser.add_argument(metavar="FILE", nargs='?', dest="input_file", help="Input log file (default: ./%s)" % DEFAULT_INPUT_FILE)
190
+
191
+ args = arg_parser.parse_args()
192
+
193
+ if args.input_file:
194
+ input_file = args.input_file
195
+ else:
196
+ input_file = DEFAULT_INPUT_FILE
197
+
198
+ if args.output_file:
199
+ output_file = args.output_file
200
+ else:
201
+ output_file = JSON_COMPILATION_DATABASE
202
+
203
+ if not os.path.isfile(input_file):
204
+ print "Error: %s not found." % input_file
205
+ exit(1)
206
+
207
+ if args.exclusion:
208
+ is_excluded = re.compile(args.exclusion).match
209
+ else:
210
+ is_excluded = None
211
+
212
+ convert(input_file, output_file, is_excluded)
213
+
214
+
215
+ if __name__ == '__main__':
216
+ print "This binary is no longer under maintenance by OCLint team."
217
+ print "Please consider using xcpretty (https://github.com/supermarin/xcpretty) instead!"
218
+ main()