If significant changes are done to a project structure and simple source checkout wouldn't cut it, we have "changes.txt" file in a project that describes what extra actions are required开发者_开发知识库:
10/10/2010: New table field, run following query: .....
10/11/2010: Library X was replaced with library Y, copy it to tomcat folder
This gets the job done but often people forget to check this file and spend time figuring out why it doesn't work.
Our projects are in Java and we are using Ant for builds and SVN for source versioning.
I am sure there must be some better solution. I am not looking for something fancy and advanced, a big red message during SVN checkout or some message during Ant build would be perfect.
(PS. Making changes apply automatically is not an option, some instruction only a human should perform)
It sounds like your team members have individual sandboxes. In order to know whether their rig is out-of-date with respect to the project you need to know which updates have been applied in their sandbox (and therefore which have not been applied).
Looking at the changes you mention you really need the changes applied to the sandbox before a build happens - otherwise the failure mode will be unpredictable, and possibly very cryptic.
Perhaps you could add an Ant target, which your build would depend on, that would check whether the sandbox was up-to-date, and fail fast if not.
In order to decide whether a sandbox is up-to-date you need to store some sort of revision number in it, one that is only updated when the team member has brought it up-to-date. As you mention a database, how about having a simple table in there that just stores a number that represents the state of the sandbox. Your new Ant target would use the sql task to fetch the sandbox revision number, and compare it to one in the source tree (You could use a file that is not source controlled to hold the sandbox version if the database route is too complex.) If they differ you could echo a message saying 'Your sandbox needs up dating, see the changes file and apply changes newer than ${sandbox.date}
'. Once the sandbox has been brought up-to-date the developer will need to manually update the record in the database table to get the build to work.
I'd urge you to script as many of the changes as possible - even if the update scripts are manually run.
Add this to your ant buildfile at the appropriate point (probably the last build-related task so that people can see it without having to scroll up):
<loadfile property="changes" srcFile="changes.txt"/>
<echo>${changes}</echo>
Honestly, mass emails seem to do the trick where I work.
EDIT: This doesn't mean you shouldn't keep changes.txt
up to date.
精彩评论