Jump to content
  • Advertisement
Sign in to follow this  
Schrompf

Visual Studio - Custom Build Step ignores additional dependencies

This topic is 4135 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, the project's growing, we now hand out executables occassionally for various reasons. To keep track of the issues reported it deems necessary to compile the repository's revision into the executable. We use Subversion, for which a nice tool is available to extract the revision and insert it into a template file of any sort. I included this tool using a Custom Build Step into the project. I added the template file, set up a custom build step for it including command line, output file and description and run it. It works just fine. Then I added a additional dependency so that the process also triggers when that other file is changed. That way I wanted to achieve that the version string is rebuild whenever the working copy is updated or committed. The file in question reflects this changes very well, it's touched on every update or commit. The problem is: Visual Studio ignores it. Some further experiments have shown that the path to the file seems to be part of the problem. For a different file the procedure works just fine. But this special file that I want to be my trigger lays in a path calles ".svn". Is the dot at the beginning a problem when addressing files relatively? At the moment the path to the additional dependency looks like ".\..\..\.svn\entries" and I figured that maybe that dot in the dir's name causes the trouble. I tried spreading quotation marks in various places but it didn't help. By constrast, a dependency of ".\..\..\test.txt" works flawlessly. Does someone have a hint how I get Visual Studio to relyable trigger the process when this file changes? Or is there maybe a better way to trigger the revision extraction process? Any help would be greatly appreciated. Bye, Thomas

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I had issues with Visual Studios doing something like this to me also (not the . thing but a step being skipped). It wouldn't run my batch file... Darn thing. Well it would be AFTER it had done everything else. The .svn is likely a hold over from *nix? Hidden directory. Try removing it?

Share this post


Link to post
Share on other sites
I just tried it in VS2005, and can't reproduce your problem - I created a (hidden) directory ".svn" two levels above the project directory, with a (read-only) file "entries" in it, and used a custom build step with Additional Dependencies = .\..\..\.svn\entries, and then it ran the command when (and only when) the entries file had a newer time (via 'touch') than the output file, which is what it should do. (The only issue was that I sometimes had to close and reopen the solution for it to detect changes in the project settings). So I'm not sure why it's not working for you... Maybe you could use FileMon to see if VS is really looking in the right place for the file?

I suppose one alternative would be to use a Pre-Build Event on the project, and have it check the SVN revision number and regenerate the version-number source file if it's changed - that would avoid unnecessary recompilation, though it would still unnecessarily look for the SVN revision number every time you try to build.

Or you could set up an automated build system, since that would help to avoid confusion about whether you compiled a clean copy of the code from SVN with no local changes and with the standard compiler and libraries, and to centrally store the debug symbols for each build, and to make sure two people don't distribute different builds of the same revision, etc, and then it'd be easy to stick a bit on the front of the build script to embed the revision number. But that's probably more work than you want now [smile]

Share this post


Link to post
Share on other sites
Err... I think I found the error. It has nothing to do with Visual Studio. It's the tool which for some reason does not update the target file if the revision is still the same. No change -> same date as before -> Custom Build Step is run over and over again (or never, if the date is strange). Weird, to say so, but I have a new hint now.

Thanks for your help! I should indeed setup some automated build system, propably including regression tests and the likes. But that's alot of work for our three little game developing fellows.

Bye, Thomas

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!