Open zasadnyy opened 8 years ago
Temporary solution was to add postprocessing of generated podspec's to build.gradle
in shared project:
j2objcPodspec.doLast {
println('Modifying generated podspecs to be able to run pod install')
[getPodspecDebug(), getPodspecRelease()].asList().each {
File podspec = it
String text = podspec.text.replace(
"spec.resources = 'src/main/resources/**/*'",
"# spec.resources = 'src/main/resources/**/*' <-- commented due to issue with pod install")
podspec.write(text)
}
}
I'm not sure what's going on here. I'm happily installing this with Cocoapods 0.39.0, the latest non-beta version (command line shown below). Are you using the same version?
I suspect that this is some kind of issue with Cocoapods, though I don't know what exactly. I would try the cd Xcode && pod install
command directly on the command line and try debugging it from there. If there is a legitimate reason to modify the Podfile, then we can provide that as an option in the plugin. Indeed, some users may want to use different resources for example. I would like to build a better justification for what changes to be made before accepting that but I'm open to talking about it.
Verify that my podspec contains the resources path:
$ grep resources base/build/j2objcOutputs/j2objc-base-release.podspec
spec.resources = 'src/main/resources/**/*'
Show that may Podspec install works (also works through plugin):
$ (cd Xcode && pod install)
Updating local specs repositories
CocoaPods 1.0.0.beta.3 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
Fetching podspec for `j2objc-base-debug` from `../base/build/j2objcOutputs`
Fetching podspec for `j2objc-base-release` from `../base/build/j2objcOutputs`
Downloading dependencies
Using j2objc-base-debug (1.0)
Using j2objc-base-release (1.0)
Generating Pods project
Integrating client project
Sending stats
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.
Are you using the same version?
Yup, 0.39.0, I've tried with older versions and result was the same.
If there is a legitimate reason to modify the Podfile, then we can provide that as an option in the plugin.
No, it's not a case, I added the comment with a temporary solution, just in case someone will face the same issue.
I'll try to dig into the problem deeper in coming days and post my findings here. In any case, thanks for the reply.
@zasadnyy - that's a creative workaround on your part. I'm interested in what else you learn on this.
Or to be more precise
pod install
fails (see gradle output at the end).The problem is in podspec file, if I'll comment out line
spec.resources = 'src/main/resources/**/*'
inj2objc-shared-debug.podspec
j2objcXcode task finishes just fine.The strange thing is that spec.resources is defined according to documentation.
Tested with plugin version
0.5.0-alpha
and0.6.0-alpha
.Output from gradle: