Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 7, 2006, 04:15 PM   #1
dailo
macrumors regular
 
Join Date: Mar 2006
Xcode over network

I really like to use Xcode to program but I am making KLD modules for FreeBSD and it's a pain always uploading an updated file to my FreeBSD server and compiling it. Is there anyway I can have it automatically upload the updated source code to my FreeBSD server so I don't have to do it manually everytime. i tried cyberduck's synchronization thing, but it doesn't appear to be doing it automatically when I save with Xcode. Thanks!
dailo is offline   0 Reply With Quote
Old Apr 8, 2006, 11:52 AM   #2
superbovine
macrumors 68030
 
superbovine's Avatar
 
Join Date: Nov 2003
Quote:
Originally Posted by dailo
I really like to use Xcode to program but I am making KLD modules for FreeBSD and it's a pain always uploading an updated file to my FreeBSD server and compiling it. Is there anyway I can have it automatically upload the updated source code to my FreeBSD server so I don't have to do it manually everytime. i tried cyberduck's synchronization thing, but it doesn't appear to be doing it automatically when I save with Xcode. Thanks!
Use SCM to work with xcode. if you need more help, i'd suggest you google for it. there is a lot resources on this topic.

http://heath.hrsoftworks.net/archives/000026.html
http://maczealots.com/tutorials/xcode-cvs/
http://developer.apple.com/internet/...soverview.html

I'd suggest you have the CVS server installed on your bsd box, it can be on your mac. After you update your repository just make a CVS account for your bsd box to update it source code before compiling. You can do all this in your make file or use a different script entirely. Generally, I have two scripts one to update and clean and one to make. One of the things you will have to catch is it will update the *.o files, and you will have to clean them once you update your CVS account on your bsd box.

Last edited by superbovine; Apr 8, 2006 at 07:32 PM.
superbovine is offline   0 Reply With Quote
Old Apr 8, 2006, 12:25 PM   #3
Eraserhead
macrumors G4
 
Eraserhead's Avatar
 
Join Date: Nov 2005
Location: UK
You "should" be able to program it in applescript with a folder action, I'm not exactly sure how to program it but it should work, alternatively you could do an applescript that runs when idle, and checks the directory for items modified after it last ran, then upload to your server.
Eraserhead is online now   0 Reply With Quote
Old Apr 8, 2006, 03:03 PM   #4
superbovine
macrumors 68030
 
superbovine's Avatar
 
Join Date: Nov 2003
Quote:
Originally Posted by Eraserhead
You "should" be able to program it in applescript with a folder action, I'm not exactly sure how to program it but it should work, alternatively you could do an applescript that runs when idle, and checks the directory for items modified after it last ran, then upload to your server.
CVS does exactly what you said in the first part. however, it logs and revision numbers and all kinds of usually things for you to keep your revision straight and code sharing between multiple coders.

Last edited by superbovine; Apr 8, 2006 at 07:31 PM.
superbovine is offline   0 Reply With Quote
Old Apr 8, 2006, 03:48 PM   #5
dailo
Thread Starter
macrumors regular
 
Join Date: Mar 2006
Wow CVS, never really looked into this before. Seems pretty frickin awesome haha. Keeps all my revisions, thansk a lot!! I am a student programmer and this seems like it will help a lot. Thanks.
dailo is offline   0 Reply With Quote
Old Apr 8, 2006, 04:44 PM   #6
dailo
Thread Starter
macrumors regular
 
Join Date: Mar 2006
How do I add a command in my makefile to automatically update the source before compiling it? I cannot seem to find anything on it on google. Thanks.

Quote:
Originally Posted by superbovine
Use SCM to work with xcode. if you need more help, i'd suggest you google for it. there is a lot resources on this topic.

http://heath.hrsoftworks.net/archives/000026.html
http://maczealots.com/tutorials/xcode-cvs/
http://developer.apple.com/internet/...soverview.html

I'd suggest you have the CVS server installed on your bsd box, it can be on your mac. After you update your repository just make a CVS account for your bsd box to update it source code before compiling. You can all this to your make file or use a different script entirely. Generally, I have two scripts one to update and clean and one to make. One of the things you will have to catch is it will update the *.o files, and you will have to clean them once you update your CVS account on your bsd box.
dailo is offline   0 Reply With Quote
Old Apr 8, 2006, 07:26 PM   #7
superbovine
macrumors 68030
 
superbovine's Avatar
 
Join Date: Nov 2003
Quote:
Originally Posted by dailo
How do I add a command in my makefile to automatically update the source before compiling it? I cannot seem to find anything on it on google. Thanks.
After you learn this stuff pretty well, CVS looks great on a resume.

This is a partial script which you should be able to modify your own makefile to work with this. I use two different scripts, this is part of my update cvs script.

The script basically calls a cvs update then backups the old source code in a backup directory giving you another layer of revisions. after that it overwrites the old source with the updated source from the cvs.


Code:
#!/bin/sh

cat << EOF
This script will make a backup of the ~/prod/src directory, and then replace
~/dev/src with a snapshot of the CVS using ~/cvsstuff/Crimson local copy
(which will be updated).

Press return to continue, Ctrl-C to quit out.
EOF
read dummy

echo "Updating the cvs local copy at ~/cvsstuff/c2src/src/"
cd ~/cvsstuff/c2src/src/
cvs update
echo "Done."

echo "Moving current source/bin directory to src_`date "+%b_%d_%Y"`."
cd ~/dev
mv src src_`date "+%b_%d_%Y"`
mkdir src
echo "Done."

echo "Copying new src snapshot."
cd src
cp ~/cvsstuff/c2src/src/*.[ch] .
cp ~/cvsstuff/c2src/src/makefile .
cp ~/cvsstuff/c2src/src/depend .
echo "Done."
If this code is confusing you, read up on some shell scripting. google knows all about shell scripting. here is a link to get you started.

http://www.noendpress.com/vroman/she...ting/index.php
superbovine is offline   0 Reply With Quote
Old Apr 8, 2006, 11:45 PM   #8
dailo
Thread Starter
macrumors regular
 
Join Date: Mar 2006
Thanks a lot! I started to write my own script, but yours is much better.

Also this CVS stuff is pretty awesome. I've always heard of it, but never took the time to look into it. But seems very useful, especially for big projects.
dailo is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
The App Store app thinks Xcode is installed, but I deleted Xcode. moonman239 Mac Applications and Mac App Store 3 May 6, 2014 05:53 PM
Moving from xcode 3.2 to xcode 4.5.2 compilation error for 'abs' macro in stdlib.h hrishidev Mac Programming 7 Jun 2, 2013 10:36 AM
How to create a social network in xcode? 8220347 iPhone/iPad Programming 3 Jun 1, 2013 12:45 PM
Xcode 3 vs Xcode 4 when dealing with Objective-C timebourne Mac Programming 8 Sep 23, 2012 05:36 PM
XCode 4.4.1 to Xcode 4.5 in Mountain Lion VinegarTasters OS X 10.8 Mountain Lion 2 Sep 19, 2012 08:55 PM

Forum Jump

All times are GMT -5. The time now is 11:46 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC