Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Specification::DSL] Introduce default_subspecs
Closes CocoaPods#2099
- Loading branch information
Showing
7 changed files
with
52 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,23 +214,25 @@ def subspec_by_name(relative_name) | |
end | ||
end | ||
|
||
# @return [String] the name of the default subspec if provided. | ||
# @return [Array] the name of the default subspecs if provided. | ||
# | ||
def default_subspec | ||
This comment has been minimized.
Sorry, something went wrong. |
||
attributes_hash['default_subspec'] | ||
def default_subspecs | ||
attributes_hash['default_subspecs'] | ||
end | ||
|
||
# Returns the dependencies on subspecs. | ||
# | ||
# @note A specification has a dependency on either the | ||
# {#default_subspec} or each of its children subspecs that are | ||
# {#default_subspecs} or each of its children subspecs that are | ||
# compatible with its platform. | ||
# | ||
# @return [Array<Dependency>] the dependencies on subspecs. | ||
# | ||
def subspec_dependencies(platform = nil) | ||
if default_subspec | ||
specs = [root.subspec_by_name("#{name}/#{default_subspec}")] | ||
if default_subspecs | ||
This comment has been minimized.
Sorry, something went wrong.
fabiopelosin
Member
|
||
specs = default_subspecs.map do |subspec_name| | ||
root.subspec_by_name("#{name}/#{subspec_name}") | ||
end | ||
else | ||
specs = subspecs.compact | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This method should go, and should be replaced by the consumer one.