Changes between Version 2 and Version 3 of DevNotes/Obsolete/Development


Ignore:
Timestamp:
Apr 4, 2014 7:42:02 AM (10 years ago)
Author:
Tobias Richter
Comment:

First pass at converting the PDF to Wiki

Legend:

Unmodified
Added
Removed
Modified
  • DevNotes/Obsolete/Development

    v2 v3  
    1 = Development = 
    2  
    3 === [wiki:Development Developing SasView with Eclipse] === 
     1= DEVELOPING SASVIEW WITH ECLIPSE = 
     2 
     3Steve King, March 2014, Rev 6.1 
     4 
     5== Installation & Setup == 
     6Download & install the Eclipse SDK (eg, eclipse-SDK-4.3.2-win32) to a folder of your choice 
     7Eclipse name their versions: 
     8 
     9 4.3.1:: Ganymede 
     10 4.3.2:: Kepler 
     11 4.4:: Luna 
     12 
     13Do not install a version of Eclipse earlier than 4.3.1 
     14Note that there are some subtle variations in the menu trees between versions! Most of this 
     15document was originally written whilst using Ganymede. 
     16 
     17=== Setting Proxy === 
     18If your internet access is normally via a proxy server, locate and edit your 
     19C:\Users\userid\AppData\Roaming\Subversion\servers file and add under the [global] section: 
     20{{{ 
     21http-proxy-host = site_proxy_server_address 
     22http-proxy-port = site_proxy_server_port 
     23}}} 
     24 
     25To see if you use a proxy server, and to get it’s address, open Internet Explorer, then go Tools 
     26-> Internet Options -> Connections -> LAN Settings and look to see if you are using an 
     27automatic configuration script. If so it will probably be configured to use port 8080. If in 
     28doubt, contact your IT Support. 
     29 
     30=== Installing PyDev ===  
     31Start Eclipse and open: File -> Switch Workspace -> Other... -> Select a workspace (the default is drive:\path\Eclipse_workspace) 
     32 
     33Window -> Open Perspective -> Other -> PyDev 
     34 
     35If PyDev is not listed as a perspective it will be necessary to install it: 
     36 
     37Help -> Install New Software... and in the Work With: drop-down select the PyDev Update Site. Let the list of available software refresh. 
     38 
     39Check the box next to PyDev and click Next. The plug-in will install. 
     40 
     41If this doesn’t work: 
     42 
     43Download the PyDev certificate from http://pydev.org/pydev_certificate.cer and install it (in 
     44Windows, just right-click and select Install certificate) 
     45 
     46Now get PyDev from http://sourceforge.net/projects/pydev/files/ 
     47If you have Java 7 installed, you must install PyDev 3.4.1 or later. 
     48Extract the zip file to the Eclipse dropins folder and re-start Eclipse 
     49 
     50 
     51=== Installing Subversive === 
     52For SVN access it is necessary for Eclipse to have the Subversive plug-in installed. Earlier versions of Eclipse 
     53(e.g. 4.3.1) seemingly incorporated an SVN plug-in in the default distribution. Later versions (e.g. 
     54Kepler) do not! 
     55 
     56To install Subversive: 
     57 
     58 * (Help -> Install New Software... and in the Work With drop-down select the site for the Eclipse 
     59release you are using. Let the list of available software refresh. 
     60 * Scroll down the list of available software and locate Subversive SVN Team Provider Sources (or similar). Check the box next to it and click Next. The plug-in will install. 
     61 * Restart Eclipse. 
     62 
     63 * Window -> Preferences -> Team -> SVN -> SVN Connector 
     64 
     65 * Check the drop-down. If present, select JavaHL (for Windows x86). If this is not present it will be necessary to install the connector. 
     66 
     67To install the Subversive Connector: 
     68 
     69 * Help -> Install New Software 
     70 
     71 * Alongside the Work With drop-down, click Add and enter a URL in the Location box, e.g: http://community.polarion.com/projects/subversive/download/eclipse/3.0/kepler-site/ (or visit  http://www.polarion.com/products/svn/subversive/download.php for links to earlier versions of Subversive for Eclipse) 
     72 
     73 * Let the list of available software refresh. 
     74 
     75 * Scroll down the list of available software and locate a JavaHL Binaries plug-in appropriate to your OS. Check the box next to it and click Next. The plug-in will install. 
     76 
     77 * Restart Eclipse. 
     78 
     79=== Checking out Sasview Trunk === 
     80File -> Import -> SVN -> Checkout Projects from SVN -> Next 
     81 
     82IF no_SVN_repository_shown: 
     83Check ‘Create a new repository location’ -> Next -> Enter a URL for a SVN repository -> Next 
     84 
     85If Eclipse fails to download the trunk, try repeating the import process but this time using an 
     86existing repository (see below). 
     87 
     88ELSE: 
     89Check ‘Use existing repository location’ -> Select a SVN repository from the list shown -> Next 
     90 
     91The SasView SVN repository is hosted by SourceForge at: https://svn.code.sf.net/p/sasview/code 
     92 
     93For commit access aspiring developers need (read-only checkout is public): 
     94 a. to be registered with Source Forge, and  
     95 b. authorised by Paul Butler 
     96 
     97Eclipse will attempt to download the trunk. In the process it may be necessary to enter your SourceForge login details several times (because you are required to authenticate at each level of the repository) so check the ‘Save details’ box to speed up the authentication process. 
     98 
     99Enter a Workspace Location 
     100 
     101This can be any name you like, but will be the name given to your local trunk, and the name of the 
     102folder it is stored in; ie, drive:\path\Eclipse_workspace\workspace_location 
     103 
     104If you want you can also give this location a custom label. 
     105Do not change any of the other default settings on this dialog box! 
     106 
     107Click OK 
     108 
     109== Preparing to Build SasView ==  
     110 
     111NB: THIS MAY NOT WORK PROPERLY IF YOU ARE BEHIND A FIREWALL BECAUSE THE BUILD MAKES 
     112USE OF PYTHON EASY_INSTALL WHICH DYNAMICALLY DOWNLOADS PACKAGES FROM THE WEB 
     113 
     114=== Installing Python === 
     115The official version of Python for building SasView is 2.7 
     116 
     117Install NumPy, SciPy, and the additional Python site packages for building SasView 
     118 
     119NB: if you are using a Win64 version of Python ensure you also download and install a Win64 
     120version of wxPython compatible with your Python 2.x installation! 
     121 
     122Install the other additional packages for building SasView 
     123 
     124Install MINGW 
     125 
     126In Windows Explorer: 
     127Navigate to drive:\path\Python2x\lib\site-packages and delete any existing sasview .egg file 
     128 
     129Back in Eclipse: 
     130Window -> Preferences -> General -> Editors -> Text Editors 
     131 
     132Check ‘Insert spaces for tabs’ 
     133 
     134Check ‘Show print margin’ and set the ‘Print margin column’ to 80 
     135 
     136Check ‘Show line numbers’ 
     137 
     138Click OK 
     139 
     140Window -> Preferences -> PyDev -> Interpreter – Python 
     141 
     142If no Python interpreter is shown, click ‘New...’, enter a name for your Python installation and 
     143‘Browse...’ to its python.exe file 
     144 
     145Click OK 
     146 
     147In the PyDev Package Explorer pane: 
     148 
     149Navigate to the sansview folder within the trunk 
     150 
     151Right-click on sansview.py  Run As  Python Run 
     152 
     153If this fails with an error message in the console pane it means that there is no existing SasView build 
     154– which is what you want! If, on the other hand, SasView starts up, search for a sasview .egg file! 
     155 
     156Then repeat this test. 
     157 
     158Locate setup.py in the top level of the trunk 
     159 
     160Right-click on run.py  Properties  Run/Debug Settings 
     161 
     162IF no_launch_configuration shown: 
     163New -> Enter a name for the launch configuration 
     164 
     165Select the ‘Main’ tab -> Under ‘Project’, browse to the name of your trunk 
     166 
     167Select the ‘Arguments’ tab -> Type ‘install’ (without the quotes) in the box marked ‘Program arguments’ 
     168 
     169Click OK 
     170 
     171=== Building SasView the First Time === 
     172 
     173Right-click on setup.py -> Run As -> Run Configurations... 
     174 
     175Or highlight your_trunk_project setup.py and then choose Run -> Run As -> Python Run 
     176 
     177SasView should build from your local trunk. If the build fails it will most likely be because a Python 
     178package has not installed, in which case install it manually (eg, using easy_install) 
     179 
     180If you get an error about msvcr90.dll or msvcr90d.dll not being found, copy these from the Visual C++ 
     181Redistributable installation (if present) or from a reputable website and put in your MinGW/bin 
     182folder. 
     183 
     184=== Re-building SasView after Development === 
     185 
     186Navigate to the setup.py within the trunk 
     187 
     188Right-click on setup.py -> Run As -> Python Run 
     189 
     190SasView should build! 
     191 
     192The locally-built version of SasView should appear in 
     193drive:\path\Eclipse_workspace\workspace_location\dist as something similar to 
     194sasview-3.0.0_r0-py2.7-win32.egg 
     195 
     196=== Running SasView from Eclipse === 
     197 
     198Navigate to the run.py within the trunk 
     199 
     200Right-click on run.py -> Run As -> Python Run 
     201 
     202SasView should start up! 
     203 
     204NB: This is running SasView from compiling and building the Python/C/C++, it is not installing 
     205SasView 
     206 
     207NB: If you run SasView at this point it may stop an Installer application from building, so if you want 
     208an Installer application, create that first (see below)! 
     209 
     210=== Creating a SasView Installer Package === 
     211NB: You would not normally need to do this because that is the function of the Build Server! 
     212Navigate to the sansview folder within the trunk 
     213 
     214Right-click on setup_exe.py  Run As  Python Run 
     215 
     216This should create a file SasView.exe in the sansview\dist folder of the trunk 
     217 
     218Double-click on installer.iss to bring up the Inno Setup Compiler 
     219 
     220Click the green ‘play’ button to build a SasView installer 
     221 
     222This should create a file setupSasView.exe in the sansview\Output folder of the trunk 
     223 
     224=== Running Unit Tests === 
     225 
     226Locate an appropriate unit test in your_trunk_project\module\test 
     227 
     228Right-click on the utest_test-name.py file -> Run As -> Python unit-test 
     229 
     230NB: unit tests operate on the last built version of SasView, so if you have modified any modules or 
     231unit tests you must re-build SasView first! 
     232 
     233The unit test your_trunk_project\test\utest_sansview.py executes all the unit tests 
     234 
     235NB: you must have previously installed unittest_xml_reporting (eg, easy_install 
     236unittest_xml_reporting) 
     237 
     238Also see the section on ‘Checking the Build Server Tests’ below 
     239 
     240=== Committing Code Changes to the SVN Server === 
     241NB: run appropriate unit tests first! 
     242 
     243Save your changes to file.py 
     244 
     245Right-click on file.py -> Team -> Update (just in case someone has done something to the same file!) 
     246 
     247Right-click on file.py -> Team -> Commit 
     248 
     249Add a comment to describe your changes 
     250 
     251==== To See/Compare Code Changes ==== 
     252Either: 
     253 
     254Right-click on file.py  Compare with  Revision... / Local History... 
     255 
     256Or: 
     257 
     258Go to Source Forge 
     259 
     260Login 
     261 
     262Projects  SasView  Code 
     263 
     264NB: if you haven’t been coding for a while, right-click on the top level of the trunk and do Team -> Update 
     265 
     266=== To Tidy Up the Trunk === 
     267 
     268Right-click on the top level of the trunk 
     269 
     270Team -> Cleanup 
     271 
     272 
     273=== Checking the Build Server Tests === 
     274 
     275The Build Server automatically runs the unit tests as part of the build process, and reports the 
     276success/failure 
     277 
     278See, for example: 
     279http://build.sasview.org/job/SasView_Ubuntu12.04_Py2.7/ 
     280 
     281If a build has failed unit tests the ‘ball’ will be red 
     282 
     283Click on the date/time string next to the ball to get a view of what changes were committed to that 
     284build and what tests failed 
     285 
     286Click on a failed test link to see more detail about why a test failed 
     287 
     288=== Branches === 
     289Long-term code development projects, or modifications carrying a significant risk of breaking the 
     290code, should not be committed to the trunk, but conducted in a branch of the trunk instead 
     291Note that a branch is not simply a sub-folder of trunk 
     292The top-level of the SasView code repository contains: 
     293 Web:: the sasview.org web pages 
     294 Trunk:: the code in the current development build 
     295 Releases:: the code in the current official release build 
     296 Branches:: copies of trunk being used for special development projects 
     297 
     298Only when branches are debugged, working and tested should they be merged back into the trunk. 
     299 
     300NB: developers using branches should be aware that their branch copy of trunk will naturally fall 
     301behind the current trunk and should therefore periodically update their branch copy of trunk 
     302 
     303To create a branch in Eclipse: 
     304 
     305 * Right-click on your_trunk_project -> Team -> Branch/Tag 
     306 * Modify the URL shown by adding /branches/name_of_branch 
     307 * Click Next 
     308 * Select the HEAD Revision 
     309 * Click OK 
     310 
     311To check if a branch has been created/exists: 
     312 * Switch to SVN view (top right corner of the Eclipse screen) 
     313 
     314To work with a different branch: 
     315 * In PyDev view, right-click on the top-level of the current trunk -> Team -> Switch to another 
     316 * Branch/Tag/Revision... 
     317 * Modify the URL shown to point to the appropriate branch 
     318 * Click OK