Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Sunday, September 14, 2008

Subversion under XCode




Create repository


svnadmin create /Users/sagasu/Worek/Workspaces/svnRepository/magicNumbers


My project name is Magic Numbers so the name of the repository is magicNumbers. You can specify any path you wish.

Integrate subversion repository with XCode SCM system.




Create a new repository configuration.




Click + (plus) button at the left button, to add a new repository.



Specify a name, and SCM too that you want to use (Subversion).



Fill the URL field. After filling URL field path and scheme will be automatically filled.

In the Repositories window choose Import, and choose a project that you want to add to the repository. And you are done.



One of the ways to make current project aware that it is inside a subversion control system is to navigate to the place where the project is held and delete it (you can use Finder to do it). Then open XCode and check in the project to this same directory (or different if you wish) from which it was removed. Now XCode will allow you to manage your files from XCode.

Developing under OS X




I've been using Tiger (OS X) for a year now, but few days ago I installed Leopard. I decided to upgrade to Leopard because there is no iPhone sdk for Tiger. Leopard ships with a newer version of XCode. I tried XCode few time before, but somehow I did not enjoyed it. I decided to give it one more try, mainly because recently I've been playing with cocoa framework, and it is easy to create interfaces in Interface Builder, which integrates great with XCode. Before I used to develop applications under Emacs using Carbon framework, because I did not enjoyed Objective-C. I believe that the thing that turned my attention from Objective-C was XCode. XCode had, and still has a really poor word completion system, due to that It doesn't help a nub programmer to find methods/objects that nub is looking for. This forced me to spend tremendous amount of time searching thru documentation/language reference, sometimes just to find out that this feature is not implemented and I need to do it on my own. Now when I am more familiar with OS X development platform is time to give XCode one more chance. What I like in OS X development is Interface Designer - it is nice, good looking, easy to use, and so on. Unfortunately it lacks many features, like shortcuts - I don't want to drag and drop things (control drop things). Interface Designer opens many windows, there is no easy way to move between them easily, or just define new key shortcuts to do an operation. So as a conclusion Interface Designer is nice to learn, easy to use to create simple operations, but later when one is more familiar with it, it takes to much time to do something. Let's go back to XCode; it still lacks a support for redefining key bindings - to do that I need to modify map files for entire system (also for other applications). It lacks refactoring tools that Eclipse has. Thanks god it has a not bad integration with external editors - like Emacs. Thanks to that I don't need to use mouse to open other file, or open test class for a class that I am currently editing. The feature that it really lucks is something like ctr+r or ctr+t in Eclipse (open class/resource that is included in project, just by typing it's name). XCode has also a good sides - it shows errors, and warnings really nicely. Debugger works great.

Wednesday, September 12, 2007

haskell on Mac




I have to take my words back in terms of edgy development on Mac, in respect to Haskell. Basically thru macports system it is possible to install Haskell in version 6.6.1 or even development version 6.7 witch is really edgy now. And it is as easy as on Linux:

sudo port install ghc

or ghc-devel for 6.7 version. I was really surprised when I find out that really cool package hoc. It was created for Haskell version 6.1, of course it works perfectly for my needs – you can use it with the newer version but you can only use procedures that existed in version 6.6.1, but it means that sooner or later I will face problems. Any way, be aware that macports will additionally install ncurses-5.6, gmp-4.2.1, perl-5.8.8, readline-5.2, ghc-6.6.1. Do you see what I see Perl, what is this guy doing here. It reminds me this RoR installation - it installs PHP and actually uses it to do configuration tasks; how weird is that? By the way Instant Rails is the most common way to install RoR on windows.

Going back to main topic installation of all GHC dependencies will take a while, so be patient. If you never wrote anything in Haskell be sure to see if GHC is really the thing that you want. Basically majority of programs written for HUGS will not run on GHC and vice versa. It reminds me (again) about scheme, if you use guile your programs will probably not work on MIT/GNU Scheme or DrScheme. You will have to modify your code. Oh, well - life is taft.

But again don't you feel that it is sad. You program in a language that is understood only by a few, and you are unable to share it with all of those who understand it?

Saturday, September 8, 2007

Mac the return




I‘ve been trying to configure Mac for the last few days. I‘m in a middle of the python development and I had to install py-unit on Mac, and then integrate it with Eclipse. There is a darwin port of py-unit so I did a little research to find out what is the difference between fink and darwin. The only think that I can say is that it worked. PyUnit is running fine.

For some time on I was willing to give a git one more shot. Last time when I tried it (1.5 year ago), I did not enjoy it. It just didn't suit my needs. To be honest I did not spent too much time then to read about all the benefits that it brings. Few days ago I finally managed to watch Linus speech at dev days about git. Linus made some strong point, and I totally agree with him there, but also this speech did not answer few questions: why git merge code so well, why does it better than subversion. Also a thought about SHA1 was really interesting, I am not a security guru, I have a very basic knowledge about that, but I enjoy math and I spend a lot of time researching math issues, any way Linus said that SHA1 is the best hash that is available on a market. That's interesting, why is that? I have to do some bigger research on that subject.

I don't think that distributed source code management systems (SCMS) is something that I need now - working on my own projects, or with a few friends, but in the old days (when the Earth was young, and mountains small) it was just a thing that I would needed. I was most curious to find out how branches and merges are implemented in git, how many tools support it (plugins, GUIs and so on). I am using a subversion to run my local projects, I thought that it would be a good idea to use both SCMS systems at this same time, cause it will give me some picture witch one is faster, easier to do simple stuff, and more advanced ones. To install git on Mac:


curl http://kernel.org/pub/software/scm/git/git-1.5.0.5.tar.gz -O
tar -zxf git-1.5.0.5.tar.gz
pushd git-1.5.0.5
make configure
./configure --prefix=/usr/local
make all
sudo make install


Then add to .profile file:


export PATH=${PATH}:/usr/local/bin



Simple, but still I would prefer to use fink or darwin ports, unfortunately I did not find git project in those repositories.

There is a dmg for subversion
. Unfortunately current version of subversion is 1.4.5 and mentioned dmg is for version 1.4.4, but still it is not that bad. In order to run svn you have to add /usr/local/bin to your PATH, just like it was done fore git. In other words if you done it for git you don't have to do anything, but if you are reading this article to configure subversion on your Mac be sure to do this also.

If you are looking for a GUI for subversion to run on Mac be sure to try svnx. It is really simple to create a repository in svn, and to add an existing project to it.


svnadmin create /Users/sagasu/worek/subversion/repositories/myProjectRepository
svn import /Users/sagasu/workspaces/workspace/myProject file:///Users/sagasu/worek/subversion/repositories/myProjectRepository -m "initial import"


to use git is also easy, but I was only able to create a repository in a path above source that I wanted to add. I spent some time trying to figure out if I can create a repository anywhere I want, I did not find this information.


git config --global user.name "Your Name"
git config --global user.email my@email.com

git init
git add .
git commit


And we are ready to rock and roll.