Update: testlint now uses multiple targets schemes (thanks Julien and Dan)
I hate dependencies. I don’t care what dependency manager you’ve signed onto, I probably don’t want to go there and do that.
Sure, I don’t mind if there’s one or two git submodules so long if the Readme file includes simple clear instructions.
After downloading iBrowser you must set up nuzip: (1) cd ibrowser (2) git submodule init (3) git submodule update
But for the most part, if you’re building stuff that makes me go out and install more tools to build your stuff, you’ve already lost the war. </unpopularopinion>
Other Ways to Kill the Cat Kitten
Which brings me to my delint project. I’ve hesitated to put it up at github. I was operating under the impression that it’s far better to do a full parser than a line-by-line regex sweep.
Last night, I sat down and gave SourceKitten and SwiftLint a deep look. After, I thought, “Hey, testlint isn’t all that bad.” So I decided to create a new repo. Which I did.
One problem. While I don’t have any dependencies (yay me, sweeps lapel with pride), I do have some custom build phases that I don’t plan on removing each time I push.
Cthulu Builds
I came up with this solution, which I’m going to throw out here and then wait for everyone to scream in horror. Since I don’t want to mess with my build phases (I like them exactly the way they are, thank you), I’ve put in a quick alert to enable you (who are not me) to remove them on your end:
It works like this. I have an empty “heyitsme.h” file in my dev folder, outside the bit that gets synced to github. When you pull the repo, it doesn’t copy. This stuff triggers the first time you compile.
#if !__has_include("heyitsme.h") #error "HEY! YOU ARE NOT ME!" #warning "Do this:" #warning "* Remove the heyitsme.h file from the Project navigator." #warning "* In TARGET > Build Phases, delete my 2 custom copy phases (bin and dropbox)." #warning "* Delete this not-me test bit. (from if to endif)" #endif
It takes about 2 seconds to remove the missing file from the navigator, eliminate my custom build phases, and erase the the few lines of code that create the error and warnings. After that, everything should compile out of the box with no dependencies.
Brilliant? Stupid? Evil? Let me know. (Updated to use multiple targets schemes)
3 Comments
Hrm, can’t you have custom build phases that you keep to your personal user and then others that are “shared”? For example, have a target that you keep to yourself with all your own fun, and then another that’s shared that has the boilerplate phases. I may be missing something, but this is what I do.
So how do I do this? Happy to learn!
Something like this maybe :
https://github.com/erica/testlint/pull/1