Skip to content

Developers: Updating and Releasing a New Version

kalden edited this page Mar 18, 2013 · 7 revisions

This page is only relevant to those developing iDynomics who are responsible for releasing a new stable version of the software.#

We have made iDynoMiCS available in two ways:

  1. The github - making the 'bleeding edge' code available
  2. Via 'stable releases' - packages that we release every so often containing fixes and improvements that had already been uploaded to github.

This page focuses on how the update procedure, and how a new stable release should be introduced.

When a new stable release is required.

  • Log in to Github, and navigate to the iDynoMiCS repository. On the top left there is a 'zip' button. Press that to compress the repository into a new stable release.

  • Depending on the number of changes being made in the release, you may wish to alter the contents of the zip file. For example, if you are releasing a version where most of the files have changed, it is sensible to release the file extracted from github as the new release. If not, it may make sense to delete any of the files which have not changed, to ease download of the update. If you choose to do this, extract all the files, delete what is required, and compress the archive again. In either case, rename the zip file to something more suitable, for instance to contain the latest version number. For example, the first stable release zip file was called iDynomicsv1_1.zip.

  • Upload this zip file to the iDynomics folder of the Kreft group website

  • The simulator checks whether it is the latest version of the software by comparing the current version number (specified in Idynomics.java, parameter version_number) against a version number in a html file in the online repository. This check is performed using methods in the Check_Release_Status class within the soft_update package. The file containing the version number of the latest release is called version.html. and is on the Kreft group website in the iDynomics folder. This contains a line in the format: [version]version_num[/version]. The first step is to increment this version number, and reupload the version.html file.

  • Once the simulator has checked this version number against its own and found it is not the current version, the simulator will display a Java Swing window, detailing the new additions and fixes in the new version. Again this is using methods in the Check_Release_Status to download a file containing details of the update. These details are also within a html file in the iDynomics folder, named history.html. Again this is in the format: [history]text[/history]. Document your changes within the two history tags. You can use html tags within the two square bracket tags. Upload the updated history.html document. PS: It may be an idea to keep the old history.html document for reference - maybe save the old one with its associated version number.

  • If the user clicks Update, then the simulation itself will close after launching the update program within Update_iDynomics.jar, available in the updater folder of the iDynomics package. This needs to be the case such that all classes can be updated - if the simulator is currently running and using a particular file (idynomics.java included) the file may not be able to be changed. Although this runs as a separate entity, the class Update_IDynomics can be found in the main iDynomics repository, in the soft_update package. The jar is created from this class, and stored within a directory named updater within the iDynomics simulation package. This jar file must be shipped with the iDynomics repository for this update to work, and must reside within a directory called updater

  • This jar file refers to one more html file in the iDynomics repository that will need to be altered for each update - a file named url.html. This file, again of the format [url]web address[/url] is a web link to the new update zip file created from git hub in the earlier step. Note that the update link must be a zip file, and not be compressed in any other way. Also, the internal directory structure should be identical to that of the simulation, so the updater replaces the correct files. For example, if an update was required for ActiveAgent.class, that is within the simulator.agent packages, this file would be within the folder structure src/simulator/agent as is the case for the simulation. However if you extract the zip from the git hub repository, this issue should be taken care of for you. Make sure you have set the URL to show the correct address of the new zip file update, and upload url.html to the iDynomics repository.

  • With the updated files uploaded, when the user starts their simulation the program will check whether it is the latest version. If not, a window is shown and the user given the choice to update. If they choose to update, the new zip file will be downloaded from the Kreft group website and stored in the users iDynomics folder. The updater will then extract the files from this archive into a folder called update, and copy these files into the relevant place in the iDynomics directory, replacing older files as required. With this complete, both the update folder and the update.zip file will be removed as these are no longer required, and the update is complete.