Not all targets respond to test_target_type
In https://github.com/fastlane/fastlane/pull/12212, @joshdholtz had to do the following because aggregate targets don't respond to test_target_type?:
- non_test_targets = targets.reject(&:test_target_type?)
+ non_test_targets = targets.reject do |t|
+ # Not all targets respond to `test_target_type?`
+ t.respond_to?(:test_target_type?) && t.test_target_type?
+ end
It would be nice if aggregate targets (and others?) would respond to test_target_type? by returning false instead of throwing an exception
Right now, that's only defined on PBXNativeTarget since that's the only type of target that has product types
What do you think about adding
def test_target_type?
false
end
to AbstractTarget? We could do the same with extension_target_type?. This would improve support for heterogeneous collections of targets at the cost of a (IMO) minor increase in API complexity. I can open a PR if there are no concerns about the design decision.