xcodebuild-helper 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- metadata +4 -220
- data/.codeclimate.yml +0 -20
- data/.gitignore +0 -1
- data/.rspec +0 -2
- data/.travis.yml +0 -7
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -114
- data/Guardfile +0 -18
- data/README.md +0 -7
- data/Rakefile +0 -7
- data/assets/style.css +0 -110
- data/bin/oclint +0 -5
- data/bin/oclint-0.8 +0 -5
- data/bin/oclint-json-compilation-database +0 -5
- data/bin/oclint-xcodebuild +0 -5
- data/externals/oclint/LICENSE +0 -69
- data/externals/oclint/bin/oclint +0 -0
- data/externals/oclint/bin/oclint-0.10.2 +0 -0
- data/externals/oclint/bin/oclint-json-compilation-database +0 -88
- data/externals/oclint/bin/oclint-xcodebuild +0 -218
- data/externals/oclint/lib/clang/3.7.0/asan_blacklist.txt +0 -13
- data/externals/oclint/lib/clang/3.7.0/include/Intrin.h +0 -958
- data/externals/oclint/lib/clang/3.7.0/include/__stddef_max_align_t.h +0 -43
- data/externals/oclint/lib/clang/3.7.0/include/__wmmintrin_aes.h +0 -72
- data/externals/oclint/lib/clang/3.7.0/include/__wmmintrin_pclmul.h +0 -34
- data/externals/oclint/lib/clang/3.7.0/include/adxintrin.h +0 -88
- data/externals/oclint/lib/clang/3.7.0/include/altivec.h +0 -13528
- data/externals/oclint/lib/clang/3.7.0/include/ammintrin.h +0 -215
- data/externals/oclint/lib/clang/3.7.0/include/arm_acle.h +0 -304
- data/externals/oclint/lib/clang/3.7.0/include/arm_neon.h +0 -68419
- data/externals/oclint/lib/clang/3.7.0/include/avx2intrin.h +0 -1256
- data/externals/oclint/lib/clang/3.7.0/include/avx512bwintrin.h +0 -1250
- data/externals/oclint/lib/clang/3.7.0/include/avx512cdintrin.h +0 -131
- data/externals/oclint/lib/clang/3.7.0/include/avx512dqintrin.h +0 -242
- data/externals/oclint/lib/clang/3.7.0/include/avx512erintrin.h +0 -285
- data/externals/oclint/lib/clang/3.7.0/include/avx512fintrin.h +0 -2457
- data/externals/oclint/lib/clang/3.7.0/include/avx512vlbwintrin.h +0 -1907
- data/externals/oclint/lib/clang/3.7.0/include/avx512vldqintrin.h +0 -353
- data/externals/oclint/lib/clang/3.7.0/include/avx512vlintrin.h +0 -1982
- data/externals/oclint/lib/clang/3.7.0/include/avxintrin.h +0 -1308
- data/externals/oclint/lib/clang/3.7.0/include/bmi2intrin.h +0 -99
- data/externals/oclint/lib/clang/3.7.0/include/bmiintrin.h +0 -153
- data/externals/oclint/lib/clang/3.7.0/include/cpuid.h +0 -209
- data/externals/oclint/lib/clang/3.7.0/include/cuda_builtin_vars.h +0 -110
- data/externals/oclint/lib/clang/3.7.0/include/emmintrin.h +0 -1480
- data/externals/oclint/lib/clang/3.7.0/include/f16cintrin.h +0 -63
- data/externals/oclint/lib/clang/3.7.0/include/float.h +0 -124
- data/externals/oclint/lib/clang/3.7.0/include/fma4intrin.h +0 -236
- data/externals/oclint/lib/clang/3.7.0/include/fmaintrin.h +0 -234
- data/externals/oclint/lib/clang/3.7.0/include/fxsrintrin.h +0 -55
- data/externals/oclint/lib/clang/3.7.0/include/htmintrin.h +0 -226
- data/externals/oclint/lib/clang/3.7.0/include/htmxlintrin.h +0 -363
- data/externals/oclint/lib/clang/3.7.0/include/ia32intrin.h +0 -101
- data/externals/oclint/lib/clang/3.7.0/include/immintrin.h +0 -203
- data/externals/oclint/lib/clang/3.7.0/include/inttypes.h +0 -102
- data/externals/oclint/lib/clang/3.7.0/include/iso646.h +0 -43
- data/externals/oclint/lib/clang/3.7.0/include/limits.h +0 -118
- data/externals/oclint/lib/clang/3.7.0/include/lzcntintrin.h +0 -72
- data/externals/oclint/lib/clang/3.7.0/include/mm3dnow.h +0 -167
- data/externals/oclint/lib/clang/3.7.0/include/mm_malloc.h +0 -75
- data/externals/oclint/lib/clang/3.7.0/include/mmintrin.h +0 -507
- data/externals/oclint/lib/clang/3.7.0/include/module.modulemap +0 -196
- data/externals/oclint/lib/clang/3.7.0/include/nmmintrin.h +0 -35
- data/externals/oclint/lib/clang/3.7.0/include/pmmintrin.h +0 -122
- data/externals/oclint/lib/clang/3.7.0/include/popcntintrin.h +0 -50
- data/externals/oclint/lib/clang/3.7.0/include/prfchwintrin.h +0 -39
- data/externals/oclint/lib/clang/3.7.0/include/rdseedintrin.h +0 -59
- data/externals/oclint/lib/clang/3.7.0/include/rtmintrin.h +0 -59
- data/externals/oclint/lib/clang/3.7.0/include/s390intrin.h +0 -39
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/allocator_interface.h +0 -66
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/asan_interface.h +0 -155
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/common_interface_defs.h +0 -118
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/coverage_interface.h +0 -63
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/dfsan_interface.h +0 -114
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/linux_syscall_hooks.h +0 -3070
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/lsan_interface.h +0 -84
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/msan_interface.h +0 -107
- data/externals/oclint/lib/clang/3.7.0/include/sanitizer/tsan_interface_atomic.h +0 -222
- data/externals/oclint/lib/clang/3.7.0/include/shaintrin.h +0 -79
- data/externals/oclint/lib/clang/3.7.0/include/smmintrin.h +0 -487
- data/externals/oclint/lib/clang/3.7.0/include/stdalign.h +0 -35
- data/externals/oclint/lib/clang/3.7.0/include/stdarg.h +0 -52
- data/externals/oclint/lib/clang/3.7.0/include/stdatomic.h +0 -190
- data/externals/oclint/lib/clang/3.7.0/include/stdbool.h +0 -44
- data/externals/oclint/lib/clang/3.7.0/include/stddef.h +0 -137
- data/externals/oclint/lib/clang/3.7.0/include/stdint.h +0 -707
- data/externals/oclint/lib/clang/3.7.0/include/stdnoreturn.h +0 -30
- data/externals/oclint/lib/clang/3.7.0/include/tbmintrin.h +0 -154
- data/externals/oclint/lib/clang/3.7.0/include/tgmath.h +0 -1374
- data/externals/oclint/lib/clang/3.7.0/include/tmmintrin.h +0 -230
- data/externals/oclint/lib/clang/3.7.0/include/unwind.h +0 -282
- data/externals/oclint/lib/clang/3.7.0/include/vadefs.h +0 -65
- data/externals/oclint/lib/clang/3.7.0/include/varargs.h +0 -26
- data/externals/oclint/lib/clang/3.7.0/include/vecintrin.h +0 -8946
- data/externals/oclint/lib/clang/3.7.0/include/wmmintrin.h +0 -42
- data/externals/oclint/lib/clang/3.7.0/include/x86intrin.h +0 -81
- data/externals/oclint/lib/clang/3.7.0/include/xmmintrin.h +0 -1008
- data/externals/oclint/lib/clang/3.7.0/include/xopintrin.h +0 -809
- data/externals/oclint/lib/clang/3.7.0/include/xtestintrin.h +0 -41
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.builtins-i386.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.builtins-x86_64.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.profile_osx.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.safestack_osx.a +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.ubsan_iossim_dynamic.dylib +0 -0
- data/externals/oclint/lib/clang/3.7.0/lib/darwin/libclang_rt.ubsan_osx_dynamic.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libHTMLReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libJSONReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libPMDReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libTextReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libXMLReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/reporters/libXcodeReporter.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libAvoidBranchingStatementAsLastInLoopRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libAvoidDefaultArgumentsOnVirtualMethodsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libAvoidPrivateStaticMembersRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBaseClassDestructorShouldBeVirtualOrProtectedRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBitwiseOperatorInConditionalRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBrokenNullCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libBrokenOddnessCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libCollapsibleIfStatementsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libConstantConditionalOperatorRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libConstantIfExpressionRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libCoveredSwitchStatementsDontNeedDefaultRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libCyclomaticComplexityRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDeadCodeRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDefaultLabelNotLastInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDestructorOfVirtualClassRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libDoubleNegativeRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyCatchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyDoWhileStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyElseBlockRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyFinallyStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyForStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyIfStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptySwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyTryStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libEmptyWhileStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libForLoopShouldBeWhileLoopRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libGotoStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libInvertedLogicRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libJumbledIncrementerRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongClassRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongLineRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongMethodRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libLongVariableNameRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libMisplacedNullCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libMissingBreakInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libMultipleUnaryOperatorRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNPathComplexityRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNcssMethodCountRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNestedBlockDepthRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libNonCaseLabelInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCAssignIvarOutsideAccessorsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCBoxedExpressionsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCContainerLiteralsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCNSNumberLiteralsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCObjectSubscriptingRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyIsEqualHashRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyMustCallSuperRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyProhibitedCallRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifyProtectedMethodRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libObjCVerifySubclassMustImplementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libParameterReassignmentRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libPreferEarlyExitRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantConditionalOperatorRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantIfStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantLocalVariableRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libRedundantNilCheckRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libReturnFromFinallyBlockRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libShortVariableNameRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libSwitchStatementsShouldHaveDefaultRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libThrowExceptionFromFinallyBlockRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooFewBranchesInSwitchStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooManyFieldsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooManyMethodsRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libTooManyParametersRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnnecessaryElseStatementRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnnecessaryNullCheckForCXXDeallocRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnusedLocalVariableRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUnusedMethodParameterRule.dylib +0 -0
- data/externals/oclint/lib/oclint/rules/libUselessParenthesesRule.dylib +0 -0
- data/lib/coverage_html_converter.rb +0 -141
- data/lib/coverage_plan.rb +0 -27
- data/lib/device.rb +0 -27
- data/lib/execute.rb +0 -7
- data/lib/lint_plan.rb +0 -41
- data/lib/rules.rb +0 -23
- data/lib/test_plan.rb +0 -11
- data/lib/version.rb +0 -3
- data/lib/xcode.rb +0 -128
- data/lib/xcodebuild-helper.rb +0 -135
- data/spec/coverage_html_coverter_spec.rb +0 -55
- data/spec/coverage_plan_spec.rb +0 -23
- data/spec/device_spec.rb +0 -24
- data/spec/lint_plan_spec.rb +0 -35
- data/spec/rule_spec.rb +0 -37
- data/spec/spec_helper.rb +0 -17
- data/spec/test_plan_spec.rb +0 -11
- data/spec/xcode_dsl_actions_spec.rb +0 -227
- data/spec/xcode_dsl_spec.rb +0 -176
- data/spec/xcode_spec.rb +0 -85
- data/xcodebuild-helper.gemspec +0 -27
data/lib/xcode.rb
DELETED
@@ -1,128 +0,0 @@
|
|
1
|
-
require 'execute'
|
2
|
-
require 'device'
|
3
|
-
require 'test_plan'
|
4
|
-
require 'coverage_plan'
|
5
|
-
require 'lint_plan'
|
6
|
-
|
7
|
-
module XCodeBuildHelper
|
8
|
-
class XCode
|
9
|
-
def initialize
|
10
|
-
@device_registry = {}
|
11
|
-
@tp_registry = {}
|
12
|
-
@coverage_registry = {}
|
13
|
-
@lint_registry = {}
|
14
|
-
end
|
15
|
-
|
16
|
-
def workspace(name)
|
17
|
-
@workspace = name
|
18
|
-
end
|
19
|
-
|
20
|
-
def get_workspace
|
21
|
-
@workspace
|
22
|
-
end
|
23
|
-
|
24
|
-
def scheme(name)
|
25
|
-
@scheme = name
|
26
|
-
end
|
27
|
-
|
28
|
-
def get_scheme
|
29
|
-
@scheme
|
30
|
-
end
|
31
|
-
|
32
|
-
def sdk(name)
|
33
|
-
@sdk = name
|
34
|
-
end
|
35
|
-
|
36
|
-
def get_sdk
|
37
|
-
@sdk
|
38
|
-
end
|
39
|
-
|
40
|
-
def config(name)
|
41
|
-
@config = name
|
42
|
-
end
|
43
|
-
|
44
|
-
def get_config
|
45
|
-
@config
|
46
|
-
end
|
47
|
-
|
48
|
-
def device(name, device = nil, &block)
|
49
|
-
if device == nil
|
50
|
-
if @device_registry[name] == nil
|
51
|
-
device = XCodeBuildHelper::Device.new
|
52
|
-
else
|
53
|
-
device = @device_registry[name]
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
if block_given?
|
58
|
-
device.instance_eval(&block)
|
59
|
-
end
|
60
|
-
|
61
|
-
@device_registry[name] = device
|
62
|
-
end
|
63
|
-
|
64
|
-
def get_device(name)
|
65
|
-
@device_registry[name]
|
66
|
-
end
|
67
|
-
|
68
|
-
def test_plan(name, test_plan = nil, &block)
|
69
|
-
if test_plan == nil
|
70
|
-
if @tp_registry[name] == nil
|
71
|
-
test_plan = XCodeBuildHelper::TestPlan.new
|
72
|
-
else
|
73
|
-
test_plan = @tp_registry[name]
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
if block_given?
|
78
|
-
test_plan.instance_eval(&block)
|
79
|
-
end
|
80
|
-
|
81
|
-
@tp_registry[name] = test_plan
|
82
|
-
end
|
83
|
-
|
84
|
-
def get_test_plan(name)
|
85
|
-
@tp_registry[name]
|
86
|
-
end
|
87
|
-
|
88
|
-
def coverage_plan(name, coverage_plan = nil, &block)
|
89
|
-
if coverage_plan == nil
|
90
|
-
if @coverage_registry[name] == nil
|
91
|
-
coverage_plan = XCodeBuildHelper::CoveragePlan.new
|
92
|
-
else
|
93
|
-
coverage_plan = @coverage_registry[name]
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
if block_given?
|
98
|
-
coverage_plan.instance_eval(&block)
|
99
|
-
end
|
100
|
-
|
101
|
-
@coverage_registry[name] = coverage_plan
|
102
|
-
end
|
103
|
-
|
104
|
-
def get_coverage_plan(name)
|
105
|
-
@coverage_registry[name]
|
106
|
-
end
|
107
|
-
|
108
|
-
def lint_plan(name, lint_plan = nil, &block)
|
109
|
-
if lint_plan == nil
|
110
|
-
if @lint_registry[name] == nil
|
111
|
-
lint_plan = XCodeBuildHelper::LintPlan.new
|
112
|
-
else
|
113
|
-
lint_plan = @lint_registry[name]
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
if block_given?
|
118
|
-
lint_plan.instance_eval(&block)
|
119
|
-
end
|
120
|
-
|
121
|
-
@lint_registry[name] = lint_plan
|
122
|
-
end
|
123
|
-
|
124
|
-
def get_lint_plan(name)
|
125
|
-
@lint_registry[name]
|
126
|
-
end
|
127
|
-
end
|
128
|
-
end
|
data/lib/xcodebuild-helper.rb
DELETED
@@ -1,135 +0,0 @@
|
|
1
|
-
require 'xcode'
|
2
|
-
require 'execute'
|
3
|
-
require 'coverage_html_converter'
|
4
|
-
require 'fileutils'
|
5
|
-
|
6
|
-
module XCodeBuildHelper
|
7
|
-
@registry = {}
|
8
|
-
def self.[](name)
|
9
|
-
@registry[name]
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.gem_location
|
13
|
-
File.expand_path(File.dirname(__dir__))
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.define(name, &block)
|
17
|
-
xcode = @registry[name]
|
18
|
-
if xcode == nil
|
19
|
-
xcode = XCodeBuildHelper::XCode.new
|
20
|
-
end
|
21
|
-
xcode.instance_eval(&block)
|
22
|
-
@registry[name] = xcode
|
23
|
-
end
|
24
|
-
|
25
|
-
def self.build(name, device = nil)
|
26
|
-
xcode = @registry[name]
|
27
|
-
|
28
|
-
unless xcode == nil
|
29
|
-
cmd = create_base_cmd(xcode)
|
30
|
-
if device != nil
|
31
|
-
cmd += parse_destination(xcode.get_device(device))
|
32
|
-
end
|
33
|
-
XCodeBuildHelper::Execute.call(cmd + "clean build | bundle exec xcpretty --color --report json-compilation-database")
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def self.test_suite(name, plan, device = nil)
|
38
|
-
xcode = @registry[name]
|
39
|
-
|
40
|
-
unless xcode == nil
|
41
|
-
cmd = create_base_cmd(xcode)
|
42
|
-
if device != nil
|
43
|
-
cmd += parse_destination(xcode.get_device(device))
|
44
|
-
end
|
45
|
-
XCodeBuildHelper::Execute.call(cmd + "test | bundle exec xcpretty --color --report #{xcode.get_test_plan(plan).get_report_type}")
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def self.create_base_cmd(project)
|
50
|
-
"xcodebuild -workspace \"#{project.get_workspace}.xcworkspace\" -scheme #{project.get_scheme} -sdk #{project.get_sdk} -config #{project.get_config} "
|
51
|
-
end
|
52
|
-
|
53
|
-
def self.parse_destination(device)
|
54
|
-
if device == nil
|
55
|
-
""
|
56
|
-
else
|
57
|
-
"-destination 'platform=#{device.get_platform},name=#{device.get_name},OS=#{device.get_os}' "
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
def self.base_app_location(xcode)
|
62
|
-
unless xcode == nil
|
63
|
-
cmd = create_base_cmd(xcode)
|
64
|
-
result = XCodeBuildHelper::Execute.call(cmd + "-showBuildSettings")
|
65
|
-
parse_app_settings(result)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
def self.parse_app_settings(settings)
|
70
|
-
result = /OBJROOT = ([a-zA-Z0-9\/ _\-]+)/.match(settings)
|
71
|
-
if result != nil
|
72
|
-
result[1]
|
73
|
-
else
|
74
|
-
""
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def self.app_binary_location(project)
|
79
|
-
Dir.glob(base_app_location(project) + "/CodeCoverage/#{project.get_scheme}/Products/#{project.get_config}-#{project.get_sdk}/#{project.get_workspace.gsub(/\s+/, '\\ ')}.app/#{project.get_workspace.gsub(/\s+/,"\\ ")}").first
|
80
|
-
end
|
81
|
-
|
82
|
-
def self.profdata_location(project)
|
83
|
-
Dir.glob(base_app_location(project) + "/CodeCoverage/#{project.get_scheme}/Coverage.profdata").first
|
84
|
-
end
|
85
|
-
|
86
|
-
def self.generate_coverage(name, plan)
|
87
|
-
xcode = @registry[name]
|
88
|
-
unless xcode == nil
|
89
|
-
coverage_plan = xcode.get_coverage_plan(plan)
|
90
|
-
src_files = Dir.glob(coverage_plan.get_source_files.first).map{|file| file.gsub(/ /, "\\ ") }.join(' ')
|
91
|
-
result = XCodeBuildHelper::Execute.call("xcrun llvm-cov show -instr-profile \"#{profdata_location(xcode)}\" \"#{app_binary_location(xcode)}\" #{src_files}")
|
92
|
-
result = result.gsub(/^warning:.*\n/, '')
|
93
|
-
all_results = []
|
94
|
-
result.split("\n\n").each do |file|
|
95
|
-
converted_result = XCodeBuildHelper::CoverageHtmlConverter.convert_file file
|
96
|
-
all_results << converted_result
|
97
|
-
if converted_result
|
98
|
-
FileUtils::mkdir_p coverage_plan.get_output
|
99
|
-
basename = File.basename(converted_result[:title])
|
100
|
-
File.write(File.join(coverage_plan.get_output, basename + '.html'), converted_result[:content].to_html)
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
unless all_results.empty?
|
105
|
-
index_file = XCodeBuildHelper::CoverageHtmlConverter.create_index all_results
|
106
|
-
File.write(File.join(coverage_plan.get_output, 'index.html'), index_file.to_html)
|
107
|
-
end
|
108
|
-
|
109
|
-
FileUtils::cp(File.join(gem_location, 'assets/style.css'), coverage_plan.get_output)
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
def self.lint(name, plan)
|
114
|
-
xcode = @registry[name]
|
115
|
-
lint_plan = xcode.get_lint_plan(plan)
|
116
|
-
|
117
|
-
cmd = "bundle exec oclint-json-compilation-database"
|
118
|
-
if(lint_plan.get_ignore)
|
119
|
-
cmd += " -e \"#{lint_plan.get_ignore}\""
|
120
|
-
end
|
121
|
-
cmd += " --"
|
122
|
-
if(lint_plan.get_report_type && lint_plan.get_output)
|
123
|
-
cmd += " -report-type #{lint_plan.get_report_type} -o #{lint_plan.get_output}"
|
124
|
-
end
|
125
|
-
|
126
|
-
rules = lint_plan.get_rules
|
127
|
-
rules.get_attribute_list.each do |key|
|
128
|
-
u_key = rules.send("key_" + key.to_s)
|
129
|
-
value = rules.send("get_" + key.to_s)
|
130
|
-
cmd += " -rc #{u_key}=#{value}"
|
131
|
-
end
|
132
|
-
|
133
|
-
XCodeBuildHelper::Execute.call(cmd)
|
134
|
-
end
|
135
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require 'coverage_html_converter'
|
2
|
-
require 'nokogiri'
|
3
|
-
|
4
|
-
RSpec.describe XCodeBuildHelper::CoverageHtmlConverter do
|
5
|
-
context "#convert_file" do
|
6
|
-
it "should return a table element" do
|
7
|
-
input = "TITLE:\n1 | 12|# some random code\n0 | 13|# other random code"
|
8
|
-
output = XCodeBuildHelper::CoverageHtmlConverter.convert_file input
|
9
|
-
document = Nokogiri::HTML(output[:content].to_html)
|
10
|
-
|
11
|
-
expect(output[:title]).to eq "TITLE"
|
12
|
-
expect(output[:coverage]).to eq 0.5
|
13
|
-
# assert the look of the document
|
14
|
-
expect(document.xpath('//html/head/link[@href]').first[:href]).to eq 'style.css'
|
15
|
-
expect(document.css('body h1').first.to_html).to eq "<h1>TITLE</h1>"
|
16
|
-
expect(document.css('body div.total_coverage').first.to_html).to eq "<div class=\"total_coverage low\">50.0%</div>"
|
17
|
-
expect(document.css('body table tr').length).to eq 2
|
18
|
-
expect(document.css('body table tr').first.to_html.gsub("\n", "")).to eq "<tr class=\"covered\"><td class=\"num\">12</td><td class=\"src\"><pre><code># some random code</code></pre></td><td class=\"coverage\">1x</td></tr>"
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should handle rows without coverage" do
|
22
|
-
input = "TITLE\n | 12|# some random code\n 1| 13|# other random code"
|
23
|
-
output = XCodeBuildHelper::CoverageHtmlConverter.convert_file input
|
24
|
-
document = Nokogiri::HTML(output[:content].to_html)
|
25
|
-
|
26
|
-
# assert the look of the document
|
27
|
-
expect(output[:coverage]).to eq 1.0
|
28
|
-
expect(document.css('body table tr').first.to_html.gsub("\n", "")).to eq "<tr class=\"irrelevant\"><td class=\"num\">12</td><td class=\"src\"><pre><code># some random code</code></pre></td><td class=\"coverage\"></td></tr>"
|
29
|
-
end
|
30
|
-
|
31
|
-
it "should handle rows without coverage" do
|
32
|
-
input = "TITLE\n 0| 12|# some random code\n 0| 13|# other random code"
|
33
|
-
output = XCodeBuildHelper::CoverageHtmlConverter.convert_file input
|
34
|
-
document = Nokogiri::HTML(output[:content].to_html)
|
35
|
-
|
36
|
-
# assert the look of the document
|
37
|
-
expect(output[:coverage]).to eq 0.0
|
38
|
-
expect(document.css('body table tr').first.to_html.gsub("\n", "")).to eq "<tr class=\"uncovered\"><td class=\"num\">12</td><td class=\"src\"><pre><code># some random code</code></pre></td><td class=\"coverage\">!</td></tr>"
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
context "#create_index" do
|
43
|
-
it "should create a table of all the files" do
|
44
|
-
input = [{:content => double(Nokogiri::HTML::Builder), :title => 'FILE_A', :coverage => 1.0}, {:content => double(Nokogiri::HTML::Builder), :title => 'FILE_B', :coverage => 0.5}]
|
45
|
-
|
46
|
-
output = XCodeBuildHelper::CoverageHtmlConverter.create_index input
|
47
|
-
document = Nokogiri::HTML(output.to_html)
|
48
|
-
expect(document.xpath('//html/head/link[@href]').first[:href]).to eq 'style.css'
|
49
|
-
expect(document.css('body h1').first.to_html).to eq "<h1>Code Coverage</h1>"
|
50
|
-
expect(document.css('body div.total_coverage').first.to_html).to eq "<div class=\"total_coverage mid\">75.0%</div>"
|
51
|
-
expect(document.css('body table.main tr').length).to eq 2
|
52
|
-
expect(document.css('body table.main tr').first.to_html.gsub("\n", "")).to eq "<tr class=\"file\"><td class=\"name\"><a href=\"FILE_A.html\">FILE_A</a></td><td class=\"coverage high\">100.0%</td></tr>"
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
data/spec/coverage_plan_spec.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'coverage_plan'
|
2
|
-
|
3
|
-
RSpec.describe XCodeBuildHelper::CoveragePlan do
|
4
|
-
context "Setter methods" do
|
5
|
-
before(:each) do
|
6
|
-
@coverage_plan = XCodeBuildHelper::CoveragePlan.new
|
7
|
-
end
|
8
|
-
it "should set the report type" do
|
9
|
-
@coverage_plan.report_type "REPORT_TYPE"
|
10
|
-
expect(@coverage_plan.get_report_type).to eq "REPORT_TYPE"
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should set the source files" do
|
14
|
-
@coverage_plan.source_files ["path/tofiles/*.m"]
|
15
|
-
expect(@coverage_plan.get_source_files).to eq ["path/tofiles/*.m"]
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should set the output location" do
|
19
|
-
@coverage_plan.output "/path/to/output"
|
20
|
-
expect(@coverage_plan.get_output).to eq "/path/to/output"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
data/spec/device_spec.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'device'
|
2
|
-
|
3
|
-
RSpec.describe XCodeBuildHelper::Device do
|
4
|
-
context "Setter methods" do
|
5
|
-
before(:each) do
|
6
|
-
@device = XCodeBuildHelper::Device.new
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should set the platform name" do
|
10
|
-
@device.platform "PLATFORM"
|
11
|
-
expect(@device.get_platform).to eq "PLATFORM"
|
12
|
-
end
|
13
|
-
|
14
|
-
it "should set the name" do
|
15
|
-
@device.name "NAME"
|
16
|
-
expect(@device.get_name).to eq "NAME"
|
17
|
-
end
|
18
|
-
|
19
|
-
it "should set the name" do
|
20
|
-
@device.os "9.2"
|
21
|
-
expect(@device.get_os).to eq "9.2"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/spec/lint_plan_spec.rb
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'lint_plan'
|
2
|
-
require 'rules'
|
3
|
-
|
4
|
-
RSpec.describe XCodeBuildHelper::LintPlan do
|
5
|
-
before(:each) do
|
6
|
-
@lint_plan = XCodeBuildHelper::LintPlan.new
|
7
|
-
end
|
8
|
-
|
9
|
-
context "Setter methods" do
|
10
|
-
it "should set the report type" do
|
11
|
-
@lint_plan.report_type "REPORT_TYPE"
|
12
|
-
expect(@lint_plan.get_report_type).to eq "REPORT_TYPE"
|
13
|
-
end
|
14
|
-
it "should set the output type" do
|
15
|
-
@lint_plan.output "OUTPUT_LOCATION"
|
16
|
-
expect(@lint_plan.get_output).to eq "OUTPUT_LOCATION"
|
17
|
-
end
|
18
|
-
it "should set the ignore type" do
|
19
|
-
@lint_plan.ignore "IGNORE"
|
20
|
-
expect(@lint_plan.get_ignore).to eq "IGNORE"
|
21
|
-
end
|
22
|
-
context "setting rules" do
|
23
|
-
before(:each) do
|
24
|
-
@rules = XCodeBuildHelper::Rules.new
|
25
|
-
@rules.long_line 120
|
26
|
-
@rules.short_variable_name 3
|
27
|
-
end
|
28
|
-
it "should set the rule list" do
|
29
|
-
@lint_plan.rules @rules
|
30
|
-
expect(@lint_plan.get_rules.get_long_line).to eq 120
|
31
|
-
expect(@lint_plan.get_rules.get_short_variable_name).to eq 3
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
data/spec/rule_spec.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
require 'rules'
|
2
|
-
|
3
|
-
RSpec.describe XCodeBuildHelper::Rules do
|
4
|
-
before(:each) do
|
5
|
-
@rules = XCodeBuildHelper::Rules.new
|
6
|
-
end
|
7
|
-
context "Setter methods" do
|
8
|
-
it "should set the long line rule" do
|
9
|
-
@rules.long_line 120
|
10
|
-
expect(@rules.get_long_line).to eq 120
|
11
|
-
end
|
12
|
-
|
13
|
-
it "should set the shor variable name rule" do
|
14
|
-
@rules.short_variable_name 3
|
15
|
-
expect(@rules.get_short_variable_name).to eq 3
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
context "key methods" do
|
20
|
-
it "should return the uppercase version of the method" do
|
21
|
-
@rules.long_line 120
|
22
|
-
expect(@rules.key_long_line).to eq "LONG_LINE"
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should return the uppercase version of the method" do
|
26
|
-
expect(@rules.key_long_line).to eq nil
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
context "get list of attributes" do
|
31
|
-
it "should return a list of attributes" do
|
32
|
-
@rules.long_line 120
|
33
|
-
@rules.short_variable_name 3
|
34
|
-
expect(@rules.get_attribute_list).to eq [:long_line, :short_variable_name]
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'coveralls'
|
2
|
-
Coveralls.wear!
|
3
|
-
|
4
|
-
RSpec.configure do |config|
|
5
|
-
config.expect_with :rspec do |expectations|
|
6
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
7
|
-
end
|
8
|
-
|
9
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
10
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
11
|
-
config.mock_with :rspec do |mocks|
|
12
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
13
|
-
# a real object. This is generally recommended, and will default to
|
14
|
-
# `true` in RSpec 4.
|
15
|
-
mocks.verify_partial_doubles = true
|
16
|
-
end
|
17
|
-
end
|
data/spec/test_plan_spec.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require 'test_plan'
|
2
|
-
|
3
|
-
RSpec.describe XCodeBuildHelper::TestPlan do
|
4
|
-
context "setter methods" do
|
5
|
-
it "should set the report type" do
|
6
|
-
@test_plan = XCodeBuildHelper::TestPlan.new
|
7
|
-
@test_plan.report_type "REPORT_TYPE"
|
8
|
-
expect(@test_plan.get_report_type).to eq "REPORT_TYPE"
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|