3.1. Set up a new Eclipse workspace

This section describes how to create and configure an empty Eclipse workspace (the next section describes how to download the source code into the workspace).

3.1.1. Option 1 of 3: Download and use a template workspace (script method)

ALTERNATIVELY

3.1.2. Option 2 of 3: Download and use a template workspace (manual method)

  1. Browse https://alfred.diamond.ac.uk/buckminster/templates/ and download the applicable template_workspace_version.zip
    If you are developing on DAWN 1.x or GDA 8.x, use the highest 2.x version (this specifies Java 1.7 compliance)
    If you are developing on DAWN 2.x or GDA 9.x, use the highest 3.x version (this specifies Java 1.8 compliance)
  2. Unzip the downloaded template_workspace_version.zip into a new, empty directory

  3. Start your Eclipse IDE, specifying the new directory as your workspace

ALTERNATIVELY

3.1.3. Option 3 of 3: Configure the workspace manually

3.1.3.1. Configuration

  1. Start the Eclipse IDE, ensuring that you are using the correct java, and specifying a new, empty directory as your workspace

  2. If prompted, turn off Report usage of Subclipse to Subclipse team

  3. At Project, de-select Build automatically

  4. Go to Window ‣ Preferences, and set assorted preferences

    • At General ‣ Appearance, select the Classic theme
    • At General, select Show heap status
    • At General ‣ Startup and Shutdown, select Refresh workspace on startup
    • At General ‣ Startup and Shutdown, de-select all Plug-ins activated on startup
    • At Buckminster, set Ant Logger level: to INFO
    • At Buckminster ‣ Console, de-select Limit console output
    • At Mylyn ‣ Tasks, de-select Synchronize with repositories every nn minutes; de-select Display notifications for overdue tasks and incoming changes
    • At Team ‣ Git ‣ Committing, de-select Hard-wrap commit message
    • At Team ‣ Git ‣ History, de-select Relative Dates
    • At Team ‣ Git, and under Default repository folder:, select and change to ${workspace_loc}_git
    • At Team ‣ SVN, check that the SVN Interface is SVNKit (Pure Java)
    • At PyDev ‣ Interpreters, de-select (3x) Notify when a <type> project has no interpreter?
    • At Run/Debug ‣ Console, de-select Limit console output
    • At Spring ‣ Beans Support, select Disable Auto Config Detection
    • At Spring ‣ Beans Support ‣ Namespaces, de-select Load NameSpaceHandlers and XSDs from project's classpath
    • At Spring ‣ Validation, de-select everything on the Project Validators and Project Builders tabs
  5. Go to Window ‣ Preferences, and set default line ending and encoding

    • At General ‣ Workspace, set Text file encoding to Other: UTF-8
    • At General ‣ Workspace, set New text file line delimiter to Other: Unix
  6. Go to Window ‣ Preferences ‣ Java ‣ Compiler, and set the Compiler compliance level

    • For Dawn 1.x and GDA 8.x, the Java compliance level must be 1.7
    • For Dawn 2.x and GDA 9.x, the Java compliance level must be 1.8
  7. Go to Window ‣ Preferences ‣ Run/Debug ‣ String Substitution, and add string substitution variables

    • name GDALargeTestFiles_loc, value /dls_sw/dasc/GDALargeTestFiles/ (or as appropriate), description Absolute file system path of directory of large test files
    • name GDA_instance_config_name, value beamline-config (will be reset by pewma.py, or manually), description Project name of GDA instance config
  8. Window ‣ Perspective ‣ Open Perspective ‣ SVN Repository Exploring

    • Right-click New ‣ Repository Location and enter https://svn.diamond.ac.uk/subversion/gda
    • Switch back to the Plug-in Development perspective
  9. Close these views:

    • Task List (Mylyn) view
    • Tasks view
    • Target Platform State view
    • Component Explorer view
    • Component Outline view
  10. At Window ‣ Show View ‣ Other, add the Console, Progress and Error Log views

  11. At Window ‣ Show View ‣ Other, add the Navigator view, then switch back to the Package Explorer view

  12. At Window ‣ Show View ‣ Other, add the Git Repositories and Git Staging views

  13. Select the Error Log view, and edit the view options

    • de-select Activate on new events
    • At Filters, set Show events logged during: to Most recent session
  14. File ‣ Restart the Eclipse IDE, pointing to the newly-created workspace

  15. Now define a project to hold the target platform (IMPORTANT!):

    cp -pivr diamond-releng.git/diamond.releng.buckminster/templates/tp/ /path/to/template-workspace/
    
    • At File ‣ Import ‣ General ‣ Existing Projects into workspace, import the tp project
    • At Window ‣ Preferences ‣ Plug-in Development ‣ Target Platform, activate the (empty) target you just imported
    • At Window ‣ Preferences ‣ Plug-in Development ‣ Target Platform, remove the Running Platform target definition
    • At Window ‣ Preferences ‣ Buckminster, click Refresh Meta-data
  16. File ‣ Exit, then restart the Eclipse IDE with the -clean option, pointing to the newly-created workspace

  17. In the Error Log, delete all entries

  18. File ‣ Exit

  19. Remove unnecessary entries from the template workspace to reduce the size.

    The following can definitely be deleted:

    .recommenders
    .metadata/.plugins/org.eclipse.m2e.*
    .metadata/.plugins/org.eclipse.mylyn.*
    .metadata/.plugins/org.springframework.ide.eclipse.osgi.targetdefinition
    
  20. Suppress the PyDev funding pop-up by adding the following line to ./.metadata/.plugins/org.eclipse.core.runtime/.settings/org.python.pydev.prefs:

    PYDEV_FUNDING_SHOWN_2014=true
    
  21. Check that the size of the workspace is < 1MB:

    $ du -sh .
    816K    .
    

3.1.3.2. Publish the template workspace

Note: This step only needs to be done by the build engineer.

  • From within the template workspace, zip the template:

    version=v2.12  # for DAWN 1.x and GDA 8.x; i.e. the Java 7 based products
    version=v3.0  # for DAWN 2.x and GDA 9.x; i.e. the Java 8 based products
    cd /scratch/template/
    echo -e "template Eclipse workspace created `date`\n." | zip -rTz template_workspace_${version}.zip .
    cp -piv template_workspace_${version}.zip diamond-releng.git/diamond.releng.buckminster/templates/
    
  • Commit the new template in diamond-releng.git/

  • Update and commit diamond-releng.git/diamond.releng.buckminster/software/pewma.py so that a materialize of master uses the latest template.

  • Publish to the above to https://alfred.diamond.ac.uk/buckminster/ using the standard mechanism