Skip to content
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

Package the source code into a static library #66

Closed
wants to merge 3 commits into from
Closed

Package the source code into a static library #66

wants to merge 3 commits into from

Conversation

zoul
Copy link

@zoul zoul commented Dec 1, 2011

I think the sources are easier to use when packaged into an Xcode project with a library target. (My primary target is iOS. If there are people using JSONKit on desktop Macs, it should be trivial to add a framework target to the project.)

One benefit is that you can bundle the tests along with the library, which should make development easier. The tests are currently run whenever the library gets built for the Simulator. (I have added one example test to the project to make it clear how things work.)

Another plus is that you don’t have to monkey around with ARC settings. If you have a project that uses ARC, you can link against the library that uses manual memory management just fine.

And a third advantage – that made me fork your code in the first place – is deployment in projects where the JSONKit code is used more than once. I have two libraries that both bundle the naked JSONKit sources and obviously I get a linker complaining about duplicate symbols. This should be easier to solve with a static library.

There are no drawbacks for people who don’t need the Xcode project, they can grab the naked sources as usually.

@zoul
Copy link
Author

zoul commented Dec 1, 2011

I have written two blog posts (one, two) about static libraries and code reuse in Xcode; these might argue in better detail why static libraries are more useful than naked source files.

@MSchmidt
Copy link

+1 especially for compatibility with ARC and non-ARC projects!

@ghost
Copy link

ghost commented Jan 6, 2012

ARC is a satan's abomination, if you want a static lib just use your lazy tiny fingers and write a simple makefile, this kind of request, that's just insane.

@MSchmidt
Copy link

MSchmidt commented Jan 6, 2012

Whatever your opinion is on ARC, it would be a good thing for JSONKit to support both kinds of projects.

@ghost
Copy link

ghost commented Jan 6, 2012

if you read carefully the documentation about ARC there is no issue mixing both until you do the right thing, tagging your code with insane qualifiers which the compiler will just parse to put it back the perfect way it was..., just an insane man could have invented this stupidity, moreover developers want memory control not garbage at large, they want to see it in their code, if you disagree you should move back to scripting languages such as java or c#, the toys for the kids.

@zoul
Copy link
Author

zoul commented Jan 6, 2012

If you don’t find the feature useful, please feel free to ignore this pull request.

@jonsterling
Copy link

I find @Cucurbita's ramblings rather difficult to decipher, though I can at least determine that they're quite unproductive. Here's my take:

If your project uses ARC, either package your own static library or specify that those particular files should not built with ARC (this is possible in Xcode's Build Phases).

In general, I prefer all my dependencies in static libraries, so I definitely see where you are coming from. However, I also happen to think it's really cool that JSONKit is distributed as minimally as it is. In fact, I think that's one of its more attractive attributes.

@escoz
Copy link

escoz commented Jan 6, 2012

+1 for static library. Clear separation between library code and application code makes it much easier to keep track of changes while still making it easy for people to stay in sync with project changes.

Congrats to @jonsterling for being so professional regarding @Cucurbita's comment.

@ghost
Copy link

ghost commented Jan 6, 2012

@jonsterling shame is always a good motivation for redemption

@zoul
Copy link
Author

zoul commented Apr 16, 2013

OK, there’s obviously little motivation to merge.

@zoul zoul closed this Apr 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants