-
Notifications
You must be signed in to change notification settings - Fork 371
+ 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
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
📝 Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here with @googlebot I signed it!
and we'll verify it.
What to do if you already signed the CLA
Individual signers
- It's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data and verify that your email is set on your git commits.
Corporate signers
- Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the Google project maintainer to go/cla#troubleshoot (Public version).
- The email used to register you as an authorized contributor must be the email used for the Git commit. Check your existing CLA data and verify that your email is set on your git commits.
- The email used to register you as an authorized contributor must also be attached to your GitHub account.
i️ Googlers: Go here for more info.
@googlebot I signed it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for contribute to this open-source repo!
I added a comment in your PR.
Please make sure this change works for your by building it first using
./gradlew buildplugin
And then install the local build to your project.
Shawn
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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"
* Rename podspec parameter to podspecPath to avoid conflicts *Support http for podspecPath
- Update comments for podspecPath
@chkuang-g Hi, I have updated the changes:
- Rename "podspec" to "podspecPath" to avoid conflicts if any
- Support http for "podspecPath"
I have built the plugin and tested. It is working fine locally with this format in Dependencies.xml:
<iosPods>
<iosPod name="IronSourceFyberAdapter" podspecPath="Assets/Plugins/ThirdParties/IronSource/Editor/LocalPod/IronSourceFyberAdapter.podspec.json">
</iosPod>
</iosPods>
Still I haven't managed to compile the source into a .tgz for use in Unity Package Manager. I will try again later.
Please let me know if you need any other changes then.
Thanks
Phong
Thanks for the update. I will take a look today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, could you also help to add the documentation here about the new properties?
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned. It is better to have two different properties for path
and podspecPath
, and handle them separately later.
private string GetPathFromProperties(string name) {
string path;
if (!propertiesByName.TryGetValue(name, out path)) return "";
if (path.StartsWith("'") && path.EndsWith("'")) {
path = path.Substring(1, path.Length - 2);
}
return path;
}
public string LocalPath {
get {
return GetPathFromProperties("path");
}
}
public string PodSpecPath {
get {
return GetPathFromProperties("podspec");
}
}
See the next comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to be just podspec
to reduce confusion, since podspec
is a real podfile properties like the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is really nice to check redundancy here but I will leave that responsibility to the person who author Dependencies.xml
, unless you are adding additional warning here when both properties exist.
I think it is much cleaner for you and your case now to just treat them as separate properties, like this
var podSpecPath = PodSpecPath;
if (!String.IsNullOrEmpty(podSpecPath)) {
if(Uri.IsWellFormedUriString(podSpecPath, UriKind.Absolute)) {
outputPropertiesByName.Add("podspec", String.Format("'{0}'", podSpecPath));
}
else {
outputPropertiesByName.Add("podspec", String.Format("'{0}'", Path.GetFullPath(podSpecPath)));
}
}
var localPath = LocalPath;
if (!String.IsNullOrEmpty(localPath)) {
outputPropertiesByName["path"] = String.Format("'{0}'", Path.GetFullPath(localPath));
}
46ea826
to
c599ab3
Compare
883eedd
to
5c6f23b
Compare
Add support to "podspec" parameter. If both "podspec" and "path" is present, it will prefer "podspec" over "path" for that specific pod.