OpenArbor Maintenance Upgrade to Luna

From DDCIDeos
Jump to navigationJump to search

Downloading Required Products

Download the new version of Eclipse and all the new products/plugins to put together a development environment that will allow for a successful build of the OpenArbor plugins. For OpenArbor development, the following products/plugins are required:

  1. Eclipse
  2. Java JDK and JRE
  3. SWTBot
  4. CDT
  5. Eclipse TM Project
  6. Subclipse
  7. Maven
  8. Apache Commons Net

At the time of the writing of this wiki page, we are migrating from Eclipse 3.7 (Indigo) to Eclipse 4.4 (Luna) DDCI_PCR:3005. All of the information recorded here is from that work. But, it should provide good information for future migrations to later versions of Eclipse when they are available.

After transitioning to Luna, several tests were failing in trying to select from a context menu (see DDCI_PCR:3039. SWTBot released a bug fix in v2.2.2, which did allow some of the failing tests to pass.

Product Download Info
Product Product Website Eclipse Update Site Product Version Downloaded Filename Comments
Eclipse for RCP and RAP Developers www.eclipse.org n/a 4.4 (Luna) Windows 32 Bit eclipse-rcp-luna-R-win32.zip
Apache Commons Net http://commons.apache.org/proper/commons-net/ http://commons.apache.org/proper/commons-net/download_net.cgi 3.3 commons-net-3.3-bin.zip Copy "commons-net-3.3.jar" and "commons-net-3.3-sources.jar" from the zip file to the Eclipse Luna plugin dir
Java 8 JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html n/a 8 jdk-8u20-windows-i586.exe The OA Makefile requires this to be in a zip file. Convert to zip
Java 8 JRE http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html n/a 8 jre-8u20-windows-i586.tar.gz The OA Makefile requires this to be in a zip file. Convert to zip
Maven http://maven.apache.org/ n/a 3.2.3 aparch-maven-3.2.3-bin.zip
CDT 8.4.0 for Eclipse Luna http://www.eclipse.org/cdt/ http://download.eclipse.org/tools/cdt/releases/8.4 8.4.0
SWTBot http://eclipse.org/swtbot/ http://download.eclipse.org/technology/swtbot/releases/latest/ (2.2.1) 2.2.2 repository.zip I renamed this zip file to swtbot2.2.2.zip
Eclipse TM Project https://projects.eclipse.org/projects/tools.tm http://download.eclipse.org/tm/updates/3.5/
Subclipse http://marketplace.eclipse.org/content/subclipse#.VBn8EhZWIjw http://subclipse.tigris.org/update_1.10.x 1.10.5

CDT Installation Choices

Creating Java JDK and JRE Zip Files

The OpenArbor Makefile requires that the JDK and JRE be in a zip file format. To convert what is downloaded from Oracle to the required zip file for OpenArbor's Makefile, do the following:

Java JDK

  1. Run the Java JDK installer executable that was downloaded (jdk-8u20-windows-i586.exe)
  2. Using 7zip, zip up the resulting installation at : C:\Program Files (x86)\Java\jdk1.8.0_20
  3. Name the resulting zip file: jdk-1.8-win32.win32.x86.zip

Java JRE

  1. Using 7zip, unzip the jre-8u20-windows-i586.tar.gz file to some temporary location
  2. Using 7zip, unzip the jre-8u20-windows-i586.tar file to some temporary location
  3. Using 7zip, zip up the contents of the jre1.8.0_20 folder
  4. Name the resulting zip file: jre-1.8-win32.win32.x86.zip

Clean up any temporary files/folders. It is not required that the Java JDK or JRE be installed on your system.

Install Eclipse and Add 3rd Party Plugins

To build the OpenArbor plugins, the Eclipse development environment must have all the required products/plugins it uses. The Eclipse for RCP and RAP Developers comes with most needed plugins, but not all.

  1. Create a directory for the new Eclipse (ie. C:\EclipseLuna)
  2. Using 7zip, extract the files from the eclipse-rcp-luna-R-win32.zip file to this directory.
  3. Create a desktop shortcut, called "OA Dev Luna" to C:\EclipseLuna\eclipse\eclipse.exe
  4. make a folder "jre" in the C:\EclipseLuna\eclipse directory
  5. extract the contents of jre-1.8-win32.win32.x86.zip to the jre directory created above
  6. Checkout a development branch of the OpenArbor workspace (ie. mainline)
mkdir -p /cygdrive/c/ddci_eclipse4
svn co https://deos.ddci.com/svn/DDCI/products/openarbor/openarbor/branches/mainline /cygdrive/c/ddci_eclipse4/branches/mainline
  1. Open EclipseLuna on the ddci_eclipse4/branches/mainline/workspace
  2. Use the "Help | Install New Software" Install dialog to install CDT, SWTBot, Subclipse and the Eclipse TM plugins. Use the Table to cut/paste update sites to the dialog for each product.
  3. Restart Eclipse as required.
  4. Import the existing OpenArbor project into the workspace

Development Environment Setup

  1. Define workpace preferences:
    1. Set Plugin Development -> API Baselines -> Missing API Baseline to Warning
    2. Java->Compiler->Errors/Warnings
      1. Potential Programming Problems->Serializable class without serialVersionUID: Ignore
      2. Unnecessary Code
        1. Value of parameter is not used: Warning
      3. Null analysis
        1. Redundant null check: Warning
      4. Annotations->Missing '@Override' annotation: Warning
    3. Java->Code Style->Formatter->Import...
      1. Use this file: https://deos.ddci.com/svn/DDCI/products/openarbor/OpenArbor-formatting.xml
    4. Check out (Preferences|Java|Editor|Save Actions) and enable it.
  2. Set the workspace to refresh automatically, and configure format source/organize imports to run on save
    1. Settings > General > Workspace > Refresh On Access (aka Lightweight Refresh).
  3. Check out Preferences|Java|Editor|Save Actions and enable it.
  4. Fix auto-props for both environments.
    1. In your desk maintainer environment, ./etc/subversion/, edit the config file and change the line that says enable-auto-props = no to enable-auto-props = yes.
    2. In Eclipse, go to Preferences|Team|SVN and change the configuration location at the bottom to point to the ./etc/subversion/ location of your maintainer environment.
  5. Configure any other preferences you want, then export them (see #Making preferences apply to all workspaces below).
  6. You might want to add -clean to eclipse.ini as well, since Eclipse tends to corrupt itself.
  7. Add a JDK. It goes in the jre folder in the eclipse directory. This improves portability. Unzip the JDK zip file into the JRE folder.
  8. If you're making this for everyone:
    1. Delete the workspace history. This is in two places.
      1. In configuration/config.ini, delete the line for osgi.instance.area.default. This is the last used workspace that Eclipse suggests when it prompts for a workspace.
      2. In configuration/.settings/org.eclipse.ui.ide.prefs, delete the line for RECENT_WORKSPACES. This is the full workspace history.
    2. Zip it all up and stick it on \\nx3000\OpenArbor\Downloads

Create two launch configurations

  1. Create six variables
    1. Window | Preferences | Run/Debug | String Substitutions
    2. Add "oaTestHarnessWorkspace", the location of all test harness data, e.g. "C:\oaTestHarness\workspace"
    3. Add "ddsName", the name of the dds you are using
    4. Add "ddsConfigName", the name of the dds configuration you are using
    5. Add "deosInstallDir", e.g. "${oaTestHarnessWorkspace}\DDS-list\${ddsName}"
    6. Add "testSystemInvocation", the arguments the test system needs to run, e.g. "--installationRoot ${deosInstallDir} --branchRoot ${oaTestHarnessWorkspace}/branches/mainline --enableDebugLog --buildLog C:\TEMP\BuildLog.txt --mldCommandQueueLogger C:\TEMP\MldCommandQueueLog.txt"
      1. You may want to change the branchRoot, for example when you are working on a release branch, or to use your development checkout instead
    7. Add "testWorkspacePrefix", where the workspaces will be located, e.g. "${oaTestHarnessWorkspace}\ddses\${ddsName}"
    8. In Windows, you should have a global environment variable pointing to your all products license file, named "DDCIFLEX_LICENSE_FILE", e.g. "C:\oaTestHarness\workspace\ddses\<ddsName>\License.lic"
  2. Run->Debug Configurations...->Eclipse Application
    1. Name it DDS <product> Dev Launch
    2. Main Tab
      1. Workspace Data: Location
        1. Use variables defined above to define workspace location - ${testWorkspacePrefix}\${ddsConfigName}\workspace
      2. Program to Run->Run a product: com.ddci.openarbor.application.product
    3. Plugins Tab
      1. Select the appropriate plugins for the product being tested!
      2. Make sure that the activated plugins match the DDC-I features you have installed
      3. Don't forget that the CDT plugins need to be activated as well
    4. Environment Tab
      1. Create two environment variables
        1. Name: DDCIINSTALLLOC
        2. Value: ${deosInstallDir}
        3. Name: DDCIFLEX_LICENSE_FILE
        4. Value: ${testWorkspacePrefix}\license.lic
  3. Run->Debug Configurations...->SWTBot Launch
    1. Name it DDS <product> Test Launch
    2. Test Tab
      1. Change Test Runner: to JUnit4 <-- Important to do this first!
      2. Run a Single Test
      3. Project: com.ddci.openarbortests
      4. Test Class: com.ddci.openarbortests.Launcher
    3. Main Tab
      1. Workspace Data: Location
        1. Use variables defined above to define workspace location - ${testWorkspacePrefix}\${ddsConfigName}\workspace
      2. Uncheck the "Clear" button!
      3. Program to Run->Run a product: com.ddci.openarbor.application.product
    4. Arguments Tab
      1. Add ${testSystemInvocation} at the end of the arguments
    5. Plugins Tab
      1. Select the appropriate plugins for the product being tested!
      2. Make sure that the activated plugins match the DDC-I features you have installed
      3. Don't forget that the CDT plugins need to be activated as well
      4. There is an additional gotcha here involving the run/debug context menu. If you get "Failed to find menuitem &1 Debug Deos Executable in path &Debug As->&1 Debug Deos Executable" while testing you can solve it by: (1) enable all the plugins, then (2) deselect all the jpt, jst, and wst plugins, then (3) click add required.
    6. Environment Tab
      1. Create two environment variables
        1. Name: DDCIINSTALLLOC
        2. Value: ${deosInstallDir}
        3. Name: DDCIFLEX_LICENSE_FILE
        4. Value: ${testWorkspacePrefix}\license.lic
  4. Export these launch configurations via File->Export... and put them in eclipse/launches if you are making a devkit.
  5. C:\Eclipse\Luna\eclipse\configuration\.settings\org.eclipse.ui.ide.prefs (has list of recent workspaces)
  6. replace prefs.ini from previous dev kit
  7. To make the devkit, close Eclipse and zip up Eclipse installation.
  8. Put new devkit here: \\nx3000\openarbor\oadevkit_luna.zip

Making preferences apply to all workspaces

  1. Configure all your preferences the way you want them.
  2. Export all preferences to an epf file.
  3. Hack the resulting epf to remove the /instance/ prefix from all the property names.
  4. But wait, Eclipse won't export everything. You may have to go digging in $workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/ <filename>.prefs for the bits in the .prefs files that you need. It's the same syntax, so just bodge them into export from above.
  5. Rename the epf to whatever.ini and put it into your eclipse directory.
  6. Edit your eclipse.ini so that the -pluginCustomization parameter points to your new ini file.

At this point there will likely be build errors that you will need to figure out how to resolve. Once all the build errors are resolved and you can successfully launch a new OpenArbor from a self-hosted new Eclipse, you are ready to move on to build the plugins "headless"ly using the Makefile to produce a release.

Build Resources

To successfully build OpenArbor, the following files must exist in the BuildResources directory (\\nx3000\openarbor\Downloads\BuildResources) used by the Makefile. A brief description of each file is in the table below, and more details about these files follow later in this document.

Filename Description
apache-maven-n.n.n-bin.zip Maven is the eclipse build mechanism
checkout_10_1_3_Feature.exe
checkout_10_8_Feature.exe
checkout_11_9_1_Feature.exe
lmborrow.exe
These are executables that are required for license borrowing. The are generated by a separate process, described here: Flexnet_License_Vendor_Daemon_Development
jdk-1.8-win32.win32.x86.zip
jre-1.8-win32.win32.x86.zip
Java zip files.
maven_tmp.zip
maven-repo-swtbot2.2.1.zip
Maven repository (a.k.a. maven repo)

The BuildResources directory has a lot more file in it than what is described above you say? You are right. All of the "other" files are remnants that are required by previous versions of OpenArbor. So, they are left here for good reason. If we ever need to go back to build a previous version of OpenArbor, all the required build resources files are here waiting.