Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subspecs support on the MergeFile #22

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Vkt0r
Copy link
Contributor

@Vkt0r Vkt0r commented Apr 6, 2021

Hey 👋 ! This PR is focused on add support for Subspecs in the MergeFile.

The issue was the Subspecs were treated as they were by the plugin. If AppAuth/Core was added to the MergeFile the plugin was expecting a folder called AppAuth/Core would exist and this is not how this is handled. Two specific changes were made to support this:

  1. Remove the subspecies from the original list of Pods to verify with folders, for example AppAuth/Core will be AppAuth only.
  2. When the the Podspecs are extracted the Subspecs names are AppAuth_Core so it's necessary to keep control of the original list to replace it and add the corresponding Podspecs.

This PR can be resumed in the following:

  • Add support for Subspecs on the MergeFile.
  • Add a new Subspecs group to the MergeFile to test the functionality,
  • Add a new code to test the Subspecs group.

Closes #11

@Vkt0r
Copy link
Contributor Author

Vkt0r commented Apr 13, 2021

@biocross Any change you can take a look into the 3 PRs solving issues in the project ??

@Vkt0r
Copy link
Contributor Author

Vkt0r commented Apr 13, 2021

@biocross Any chance you can take a look into the 3 PRs solving issues in the project ??

@biocross
Copy link

Hello @Vkt0r, really appreciate the PRs! I'll take a look this weekend and sometime next week. Thanks again!

@Vkt0r
Copy link
Contributor Author

Vkt0r commented Apr 15, 2021

@biocross Great !! Thank you!!! I do have more PRs to fix more issues with the import XX resolutions etc. But let's work with these first.

@@ -188,7 +188,8 @@ def parse_mergefile
def merge(merged_framework_name, group_contents, podfile_info)
Pod::UI.puts "Preparing to Merge: #{merged_framework_name}"

pods_to_merge = group_contents['titles']
# Replace the Subspecs notation (e.g AppAuth/Core) for `AppAuth` only as the folder AppAuth/Core would not exist
pods_to_merge = group_contents['titles'].map { |pod_name| pod_name.sub /(\/[a-zA-Z]+)/,''}.uniq

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can elaborate exactly what this regex does? Will it remove any other symbols from a Pod name except /? Asking because I've come across pod names with symbols like _ , -

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure the purpose of the regex is to replace subspecs like AppAuth/Core for AppAuth as the folder AppAuth/Core would not exist. Do you have any names of pods with the _, - in mind we can test ? Maybe I missed those cases 😞.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That one doesn't have sub-specs so it doesn't affect anything related to the changes. Also that one is a vendor framework so it would fail. For example I added this youtube-ios-player-helper to the MergedSwiftPods and it works successfully.

Nevertheless I detected an error that could be worth to fix later and it's related to the dashes in the module map. If I add the youtube-ios-player-helper to the Subspecs group it would fail because the module.modulemap doesn't like dashes in the definition of modules

explicit module youtube-ios-player-helper {
     header "YTPlayerView.h"
}

And I think that's why most of the pods using dashes they also define module_name (I have a PR coming soon to fix an issue related to this with lottie-ios as pods with module_name defined should use the module_name instead of the name of the pod specification for imports)

PodMergeExample/MergeFile Outdated Show resolved Hide resolved
@dwirandyh
Copy link

any update for this PR? @Vkt0r @biocross

@M4kxjci M4kxjci linked an issue May 7, 2022 that may be closed by this pull request
@ShenYj
Copy link

ShenYj commented Mar 27, 2024

is it on going?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

int How to merge pod that contains subspec?
4 participants