building a command-line tool as a bundle
building a command-line tool as a bundle
- Subject: building a command-line tool as a bundle
- From: Roland King <email@hidden>
- Date: Sun, 17 Aug 2008 19:41:18 +0800
This is probably a ridiculously stupid question but I'm still learning
here ..
I started building a Cocoa app then decided that I wanted to build
myself a little command-line tool to test the classes I'm writing.
Perhaps it should be a Unit test but I thought perhaps I'd learn those
another day. So I added a command-line target, marked the .m and .h
files I wanted to test as belonging to that target, wrote a main() and
all is well.
Now I want my final cocoa app to use a plist file in the app bundle
for some startup data, so I'd like my little command-line tool to be a
bundled app too (instead of the straight executable which is currently
built) so I can put the plist file in there and do some tests. So I
was trying to convert the commandline tool target to build a bundle
and haven't managed it.
Is it actually possible to do that by twiddling the config settings?
Clearly the cocoa app itself is just an executable in a bundle, that's
what I kind of want.
I tried adding a Cocoa Bundle target, but that doesn't build an
executable. I wondered about adding a second Cocoa Application target,
then removing the nib and other stuff I didn't need and changing the
main.m file to be my test command-line code, but then I'd have two
Info.plist files in my project, one with the information for the Cocoa
app and one with the information for the commandline bundle app thing,
and that doesn't sound right either, infact it doesn't sound possible.
Is there a way to have two targets, each building a bundle, each of
which is using mostly the same source code and to which I can add the
same resources so I can test my code like this?
Apologies if my approach is just entirely wrong here, I'm used to
testing new code by writing simple command line type tools which
exercise code. I am trying quite hard to forge ahead with the actual
project itself and didn't really want to stop and learn how to use the
unit test framework, assuming that's even the right way to do this.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden