Skip to content

+ Add support to "podspec" parameter for #452 #453

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions source/IOSResolver/src/IOSResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,15 @@ public static string PropertyDictionaryToString(
/// <summary>
/// Get the path of a pod without quotes. If the path isn't present, returns an empty
/// string.
/// This also support podspec parameters. It will prefer podspec parameter over path
/// if present.
/// </summary>
public string LocalPath {
get {
string path;
if (!propertiesByName.TryGetValue("path", out path)) return "";
if (!propertiesByName.TryGetValue("podspec", out path)){
Copy link
Collaborator

@chkuang-g chkuang-g Jul 14, 2021

Choose a reason for hiding this comment

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

It is better to use a different property for "podspec".

Also, do similar override in PodFilePodLine
camphongdinh@a97b71d#diff-4e150db5d98cbbe99ab461893cc478b33377658b810b34ebc72f7549670ef482R154-R157

Note that from the Cocoapod doc, :podspec can point to an "http" url. So perhaps only expand the path only if it does not start with "http".

if (!propertiesByName.TryGetValue("path", out path)) return "";
}
if (path.StartsWith("'") && path.EndsWith("'")) {
path = path.Substring(1, path.Length - 2);
}
Expand Down Expand Up @@ -276,7 +280,8 @@ private class IOSXmlDependencies : XmlDependencies {
"modular_headers",
"source",
"subspecs",
"path"
"path",
"podspec"
};

public IOSXmlDependencies() {
Expand All @@ -295,6 +300,7 @@ public IOSXmlDependencies() {
/// <iosPods>
/// <iosPod name="name"
/// path="pathToLocal"
/// podspec="pathToLocalPodSpecJSON"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can specify a url here as well
https://guides.cocoapods.org/syntax/podfile.html#pod

Perhaps use

/// podspec="pathToPodSpec"

/// version="versionSpec"
/// bitcodeEnabled="enabled"
/// minTargetSdk="sdk">
Expand Down