Game Development Community

Script change = complete rebuild in XCode?

by Richard Skala · in iTorque 2D · 01/06/2010 (7:59 am) · 5 replies

It seems that even if I change just one script (.cs) file, in order to see the changes in the iPhone Simulator or an iPhone device, I have to do a complete Clean and Rebuild, which is unnecessarily time consuming. Is this normal? Or is there some other, faster way?

I found a thread that asks the question, but I don't have access to that forum:
Xcode: Changing a script implies a complete rebuild
http://www.torquepowered.com/community/forums/viewthread/88229

#1
01/06/2010 (8:38 am)
Hey RS, yes i posted in that thread as well :

From there ;

Quote:
Also, if your resources are linked as blue folders "referenced" , then you can right click and say "compile" and or "preprocess". This will say " Copying 1 / 1 Resources to product" and then, if all goes well the new data will be included and nothing will be left out. (make sure it installs to the device each time. if it doesnt, nothing changed).

Also, in the <dir of xcode project>/build, there are folders for each platform and configuration. For example, if im deploying to device and nothing is changing -> build/debug-iphoneos/myApp.app will exist. This app bundle is the root of the problem. It has all the files inside it, it just doesnt know the ones on disk have changed. Deleting this file, and build and go (it wont rebuild all), will refresh the file completely.

The touch command seldom works as xcode doesnt actually care about resources. It appears that xcode pretends to care about root resources, so clicking main.cs in the root of resources -> and changing it (adding a space for example) , and then saving, hitting build and go, it will update the files it needs to. This is also weird sometimes,

The other idea is to edit a low level c++ file, by low level i mean dont make a change in torqueConfig.h because then it will recompile. Find a gui object and either touch it, or add a space randomly. Save -> Build and go.

Again, this has proven dodgy at times as xcode likes to be erratic, and sometimes xcode gets its own ideas about what files have changed. Where certain things like, say 96 files get rebuilt, every single time. It may even happen where it rebuilds everything, everytime. If it starts being stupid, close up xcode and go "untouch" the folders.. This sometimes works sometimes doesnt. Sometimes restarting works sometimes it doesnt :)

welcome to xcode.

Also, deleting the .app bundle and hitting build and go will guarantee the changes migrating into the bundle. I am looking into a solution for this in the next release. It is just how XCode handles unknown file types,
#2
01/06/2010 (8:54 am)
Even changing link options without removing the .app isn't guaranteed to give you a new build! Keep that Finder window open at all times :)
#3
01/06/2010 (10:09 am)
strange, I'm basically always using touch (on the common folder as thats where I'm right now working most to get the old project working nicely again) and so far it seems to work.
#4
01/06/2010 (7:45 pm)
Thanks for your assistance, everyone. For me so far, using 'Touch' or 'Compile' on the assets hasn't been reliable. The most reliable method that you all suggested was to delete the .app file and then build.

For others new to Mac/XCode and are reading this thread:

- In 'Groups & Files', expand Products and select your .app file.
- Right click and select 'Reveal in Finder'. This will open the folder where the .app file is located.
- Right click the .app file and select 'Move To Trash'.
- Now when you select 'Build and Go', XCode will link and create a new .app file containing the updated assets.
#5
01/06/2010 (9:13 pm)
Sorry if it seems like i'm hijacking this thread...but it is to do with the develop pipeline I used.

Prior to 1.3 it was:
1) Edit, change, develop in Eclipse for scripts
2) Use editor to position things
3) Make sure I generated the dso, run a build script to grab all the assets and dsos (and core script files)
4) Run Xcode to test to the simulator or device with my Resource pointing to stuff I just copied (only dso's)
5) Build and deploy

With 1.3:
1) The dso's I generate are flagged as old when I run it on iPhone < 42. Don't get run. I read that the .cs files are run (and I think the iPhone app will generate the dso's?)
2) That being the case I assume the new development process is to go straight to Xcode for most script changes? or run from the editor?
3) This means I would have to create another Xcode project for a shipping building that doesn't include the same resources? (i.e the .cs files)