0.20.1: Xcode 8.2.1: --no-build? NO--no-use-binaries? NO--use-submodules? NO--cache-builds? NOCartfile
binary "myFolder/Library1.json" ~> 1.2
binary "myFolder/Framework1.json" ~> 1.1
Carthage Output
Parse error: non-https URL found for dependency type `binary` in line: Optional("binary \"myFolder/Library1.json\" ~> 1.2")
Is it possible to refer json file in local path?
I am referring https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md.
That is not currently possible. Do you have a use case in mind?
@mdiep: So right now, we have ready binaries placed on our internal artifact server. Till now we were using Cocoapods to resolve dependency. So we were placing podspec files in our local project directory.
Say if I have to use that library from artifact server which does not contain the json files, then I can create on my own in local machine and I can resolve the dependency. I may not be having permission to upload my json to Artifact server or any other server. (Also this is time consuming process.)
I think it makes sense to relax the requirement to allow local file URLs alongside HTTPS URLs. 👍
How long will it take to release with that feature? For now, I have to remove Carthage for my dependency.
That depends… How soon can you open a pull request to enable it? ☺️
Hi, Im working on a PR for this now, what should the checks for a valid url be? I could make it so that if the first character is "/" then its valid?
I was thinking of maybe having something like this:
New folder alongside Build/Checkouts called Binary Specs which contains all the json files that you need. So for example if you wanted to include the Fabric SDK, there would be a file "Carthage/Binary Specs/fabric.json". This json would be as spec'ed in the docs here.
This would then be referenced in the Carfile like so:
binary "spec://fabric.json" ~> 1.6.9
What do you think? Please let me know if you have a better idea, I am new to Carthage.
@Stoff81: From your above comment, I am not able to get where you want to place the json file?
Note that Build/Checkouts folder is only created when we run Carthage command. It should not be in that folders.
Also, normally we do not commit those folders in our repository. (I prefer those in gitignore files.). I am placing json file in CarthageSpecs folder. You can refer it with direct file path as in Cocoapods. (Technically, we can check if file exists at path).
Hope this makes sense and even I am new to Carthage but due to this limitation, for now I am preferring Cocoapods without integrating with project.
Hi, Im working on a PR for this now, what should the checks for a valid url be? I could make it so that if the first character is "/" then its valid?
URL has a isFileURL property. We should use that.
@shahdhiren ok thanks, I will move the spec folder out to the root. I guess we can then make the assumption that this will be the folder to check. So in the cartfile we could have something like:
binary "fabric.json" ~> 1.6.9
This will then check inside the CarthageSpecs as you describe.
@Stoff81: So does this mean that your changes will always expects json file in root folder? or any folder path that I gave (even if it is outside of repo directory)?
Any update on this?
Correct me if I'm wrong, but this only works for absolute paths? I get an error otherwise: Failed to read file or folder at : Error Domain=Result.AnyError Code=1 "file is directory"
+1 for relative file support :) Would be great! Thanks!
Most helpful comment
I think it makes sense to relax the requirement to allow local file URLs alongside HTTPS URLs. 👍