gca3020 / GABoardGameGeek

BoardGameGeek XMLAPI2 Swift Framework for interacting with games and collections on BGG
MIT License
8 stars 6 forks source link

Update to latest Alamofire and SWXMLHash #13

Open keyiyek opened 2 years ago

keyiyek commented 2 years ago

First, thanks for the library, I've been using it for a while and it's great!

The problem is that it is outdated, I managed to make it work on my old iMac modifying the pod file to get older versions of Alamofire and WSXMLHash. But now I'm working with a new Mini, new OSX, new Swift, the hassle was getting to big. I'm not a programmer, not by a long stretch, but I managed to hunt down the problems, and everything falls in place with just 4 edits in one file. Problem is, I can barely manage git repositories on my own, I have no idea how to show my changes to others (pull requests???), so I'll go old school (stone age old school).

the file is ApiAdapter.swift line 69 -> AF.request(baseUrl, parameters: params) line 74 -> case .success(let value): line 79 -> closure(.success(value)) line 106 -> let xmlIndexer = XMLHash.parse(xml)

(please, don't tell anybody on stack overflow about this, I already have a super noob reputation :) )

The above changes get rid of the errors, and the library seems to work. There are a few warnings on the Deployment Targets and Swift 5, I managed tot week those manually in Xcode, and have no idea where to look for those in the code.

Can you please (please, please, please, please) find the time to update the master branch?

gca3020 commented 2 years ago

I really didn't think anyone still used this, and I'm a little surprised the BGG API still works with it (but also totally unsurprised that the API hasn't been updated to JSON by now).

Unfortunately, I no longer have a Mac on which to test this, but I've made the changes you suggested onto a branch and created a pull request.

If the changes look right to you, I can merge it and tag a v2.0.0 version. I'm a little surprised there are no required updates to the Podfile, but I guess looking at it, I never pinned any specific versions, so it's no wonder the dependencies got out of sync.

gca3020 commented 2 years ago

@keyiyek I made the updates you suggested, and committed them (mostly blindly) and tagged as 1.3.0. Since I don't have a Mac anymore, I am not sure I can update the Cocoapod package and do all of that, but I assume you can pin versions as required.

I was also able to get this package building using Swift Package Manager, and can test it locally on my Linux system, and in the github actions workflow for MacOS.

I have a PR for that work at #15, and I plan on merging this and tagging as 2.0.0. All of my old unit tests are hopelessly broken, but I did get a basic, high-level "unit" test added that verifies the overall functionality, and I was able to pull objects from the API.

keyiyek commented 2 years ago

Thanks for the update, sorry I couldn't get to the computer these days.

I tried this:

It works, even without the import.

The Pod install instead is still installing the old version. Dunno if you want to bother changing the install part of the read.me.

gca3020 commented 2 years ago

Glad to hear it worked for you. The version on Cocoapods is still 1.2.0, I might see if I can update that this weekend. If you switched to the built-in swift package manager it would probably work with less manual intervention, but I don’t know what’s involved in that.

I’ll leave this open until I investigate updating the cocoapods version.

keyiyek commented 2 years ago

Swift Package Manager from Xcode works like a charm