Skip to content

Commit d84dafd

Browse files
authored
Add testonly to libraries that link XCTest (#82)
1 parent 6479dbd commit d84dafd

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

lib/cocoapods/bazel/target.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,10 @@ def to_rule_kwargs
374374
kwargs[:runtime_deps] = []
375375
kwargs[:sdk_dylibs] = file_accessors.flat_map { |fa| fa.spec_consumer.libraries }.sort.uniq
376376
kwargs[:sdk_frameworks] = file_accessors.flat_map { |fa| fa.spec_consumer.frameworks }.sort.uniq
377+
kwargs[:testonly] = true if kwargs[:sdk_frameworks].include? 'XCTest'
377378
kwargs[:sdk_includes] = []
378379
kwargs[:weak_sdk_frameworks] = file_accessors.flat_map { |fa| fa.spec_consumer.weak_frameworks }.sort.uniq
380+
kwargs[:testonly] = true if kwargs[:weak_sdk_frameworks].include? 'XCTest'
379381

380382
kwargs[:vendored_static_frameworks] = glob(attr: :vendored_static_frameworks, return_files: true)
381383
kwargs[:vendored_dynamic_frameworks] = glob(attr: :vendored_dynamic_frameworks, return_files: true)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.0
1+
5.3.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.0
1+
5.3.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.0
1+
5.3.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.0
1+
5.3.2

0 commit comments

Comments
 (0)