AMAPstudio

User Tools


Compile and Commit correctly

Francois de Coligny - 5.3.2007

A complete and correct recompilation on the computer of one member of the project does not ensure everything will compile correctly for the other members. It depends on the correctness of the CVS operation meanwhile.

1) There is a safe way to check that everything compiles correctly on one machine: with a correct CLASSPATH (containing capsis4/bin/), change directory to capsis4/bin/ then launch jib all_force. This will erase all the “.class” and will recompile all the “.java”. If no errors at the end, it means that the local copy compiles correctly. The list of the compiled pakages can be found in the file makefile.jib in capsis4/bin/.

2) But this does not guarantee that everything will compile correctly on others' machines because you pass them your sources through CVS. If for example, you forget to add (add then commit) a source file in CVS, everything will compile correctly on your machine (the class is present in your local copy), but there will be errors on the others' machines in the source files using this class, missing in their local copy. The same if you forget to commit a file that you modified on your machine (modified tag in SmartCVS), your collegues will not have these modifications but the other classes you commited will look for them and will not compile correctly.

3) To prepare correctly a commit, here is a possible way: 3.1) Do a general update to retrieve the work of the other members in your local copy (in SmartCVS, select the upper lever directory in the file-tree: the capsis4/ directory, then update with the default options and check in the bottom log that everything is correct). 3.2) Do a complete recompilation (from capsis4/bin/, jib all_force and check the correctness of the result). 3.3) add, remove, commit (in SmartCVS, add your new files in the CVS system by add, remove the files you do not use any more from the CVS system by remove, then commit all the files tagged added, removed and modified).

4) To ensure that a commit is correct (correct compilation on the machines of the other members of the development community), you can do an update on a test-only machine. 4.1) If “new” machine, perform a first time checkout to get a local copy of capsis4/, set the CLASSPATH on capsis4/bin/ (and ensure the PATH contains java/bin/). 4.2) Each time you need to do a test (after a commit, see 3), do an update on the test machine (always after having checked that the selected directory in the file tree is capsis4/ not to forget updated files in sub directories), check that the operation ends correctly. 4.3) Launch a complete recompilation with jib all_force. If no errors, it means that you forgot nothing (in your add, remove, commit) and that the recompilation will be ok too on your collegues' machines.

Note: Never copy directly files from one machine to another one (by mail, with usb keys…). You would risk complications then when synchronizing through CVS: the first commit would be ok but for the second, you would have messages telling you that someone already changed that portion of code and that you have to resolve conflicts. To go from one machine to another one, the good way is through CVS.

documentation/compile_and_commit.txt · Last modified: 2013/05/23 08:25 (external edit)