AMAPstudio

User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
documentation:svn [2016/07/26 09:15]
coligny
documentation:svn [2020/08/31 07:42] (current)
beudez [1. Install Java SE 8 (JDK)]
Line 1: Line 1:
 +====== Developing models in Capsis with JDK 1.8 and Subversion (SVN) ======
  
 +Un [[:​private:​copieLocalePourLesModelisateurs|résumé de la procédure en français]] est disponible.
 +
 +This documentation is for Capsis modellers (according to the Capsis charter), it explains how to get a full local copy of Capsis on their computer to be able to add their own work in the platform.
 +
 +The Capsis software sources are hosted on a Subversion (SVN) repository.
 +
 +A Login is required (see section 2. below).
 +
 +<box 80% round green |**Important note** >
 +If you are not already a Capsis modeller and if you would like to integrate a model in Capsis, please see [[:​documentation:​howtojoin|How to join Capsis]] and contact the development team (see [[:​contact]]) in order your registration to be validated.
 +</​box>​
 +
 +
 +==== 1. Install Java SE 8 (JDK)====
 +
 +Capsis relies on Java version 1.8 (or Java 8): Java Development Kit Standard Edition version 1.8. 
 +
 +-> **To check if your installation of java is correct**, [[faq|check the FAQ, section 3.6]]. The system must find a jdk 1.8.x. If correct, jump directly to section 2.
 +
 +**On windows**
 +  * Download and install the Java developper Kit (**JDK** and not JRE) version 1.8 : 
 +    * [[http://​www.oracle.com/​technetwork/​java/​javase/​downloads/​jdk8-downloads-2133151.html|Try from here]] (e.g. Windows x86 for 32 bits systems).
 +
 +  * Modify the **PATH** environment variable according to your installation directory ​
 +     ​* ​ Click Start > Settings > Control Panel > System > Advanced > Environment Variables.
 +     * In the ''​PATH''​ **system** variable (**not** in ''​PATH''​ **user** variable), add the location of the bin/ folder of the installed JDK __at first position__. A typical value is: ''​C:​\Program Files\Java\jdk1.8.0_<​version>​\bin''​ (you may seek this directory in a file manager and copy / paste the path).
 +    * A ";"​ must be added between the paths in the ''​PATH''​ variable.
 +    * You should only have one bin/ directory for a JDK in the path at a time. Those following the first instance will be ignored.
 +
 +**On Linux**
 +
 +   * Download a JDK installer
 +     * [[http://​www.oracle.com/​technetwork/​java/​javase/​downloads/​jdk8-downloads-2133151.html|Try from here]] (e.g. Linux x64 tar.gz for Linux Ubuntu 64 bits systems).
 +
 +     * If the ''​PATH''​ variable is to be updated, have a look in ''/​etc/​environment'',​ ''​~/​.bashrc''​ or ''​~/​.profile''​ files. You may have a look at this doc to [[https://​help.ubuntu.com/​community/​EnvironmentVariables|change the PATH under Linux Ubuntu]].
 +
 +     * The path to the location of the bin/ folder of the installed JDK must be added __at first position__ of the ''​PATH''​ variable. A ":"​ must be added between the paths in the ''​PATH''​ variable.
 +
 +-> To check if your installation of java is now correct, [[faq|check the FAQ]].
 +
 +==== 2. Create an amap-dev account ====
 +
 +Capsis files are hosted on the //​amap-dev//​ development server. To access to Capsis files, you need to create an account on the server.
 +
 +  * Register yourself on : http://​amap-dev.cirad.fr/​account/​register . 
 +  * Once your account has been validated by an administrator you can access to the Capsis project: http://​amap-dev.cirad.fr/​projects/​capsis
 +
 +Your login/​password will be used to access to SVN files, but also to modify the Capsis Wiki web site and to manage Capsis on the //​amap-dev//​ development server (e.g. ask for a bug correction / a new feature).
 +
 +==== 3. Get a local copy of the project (checkout) ====
 +
 +SmartSVN makes it possible to access to the SVN repository.
 +
 +  * Download and install SmartSVN : https://​www.smartsvn.com/ ​
 +  * Start SmartSVN
 +    * //if Smartsvn ask for svnserve and svnadmin, click Cancel//
 +    * //During installation,​ SmartSVN may ask you if you want to evaluate the Pro version. You can ignore this message//
 +  * Choose Check out project from repository
 +  * Quick Checkout : 
 +    * URL: ''​http://​amap-dev.cirad.fr/​svn/​capsis/​trunk''​
 +    * Local directory: the directory you choose for your local copy (e.g. C:\capsis4 OR /​home/​coligny/​java/​capsis4)
 +  * Accept the server fingerprint if proposed
 +  * Enter your login and password
 +** Note: This is your new login password you entered when you registered on amap-dev at section 2**
 +  * Validate and finish
 +
 +<box 80% round green |**Possible trouble** >
 +
 +The checkout operation may fail after a while with an error message, e.g. 
 +
 +//APR does not understand this error code
 +ra_serf: The server sent a truncated HTTP response body//
 +
 +In this case, try to continue the operation this way in SmartSVN: ​
 +
 +  * select the capsis4 (top level) directory in the '​Directories'​ panel, ​
 +  * Modify > Cleanup
 +  * Update
 +
 +This should continue the process. This operation might be done several times in case your internet connection is not optimal.
 +</​box>​
 +
 +/*
 +=== Solution 2 :  Eclipse===
 +
 +For eclipse user, see [[documentation:​using_eclipse]]
 +
 +
 +=== Solution 3 : Command line ===
 +
 +  * Install ''​svn''​ program (ie ''​sudo apt-get install subversion''​)
 +  * In a shell, do
 +<​code>​
 +svn checkout --username login http://​amap-dev.cirad.fr/​svn/​capsis/​trunk capsis4
 +</​code>​
 +
 +=== Solution 4 : Others SVN clients ===
 +
 + ​Others SVN clients are available like 
 +  * Tortoise : http://​tortoisesvn.tigris.org/​
 +
 +*/
 +
 +==== 4. SVN usual operations ====
 +
 +Later when you will need to get the last changes of the server downloaded to your local copy, you will use SmartSVN and the **Update** command. ​
 +
 +When you will have to upload your own changes onto the server, you will use the SVN **Commit** command. ​
 +
 +You may ask for support to well understand the process when updating your local copy or commiting your changes the first time.
 +
 +For more information on the SVN commands, see this doc: [[documentation:​svn_update_and_commit|SVN update and commit]].
 +
 +==== 5. Recompile and start Capsis====
 +
 +  * Open a terminal (Dos prompt under windows, shell under linux)
 +  * Go to the ''​capsis4''​ directory with ''​cd''​
 +  * Recompile the project
 +
 +  ant compile
 +
 +  * If you need a full recompilation (should be done __after each SVN update__)
 +
 +  ant clean compile
 +
 +
 +** Note **: If there are errors, please contact the capsis team.
 +
 +  * Then you can launch Capsis.
 +
 +The ''​capsis.bat''​ or ''​capsis.sh''​ scripts are used to start capsis :
 +
 +Under Windows:
 +
 +  capsis ​
 +
 +Under Linux:
 +
 +  sh capsis.sh
 +
 +//Note// : you can also use 
 +
 +  ant run
 +
 +
 +==== 6. Configure your editor ====
 +
 + See [[documentation:​code editor]].
 +
 +==== 7. Other useful command ====
 +
 + See [[documentation:​ant]].