0b415a2609cef6adc85f6b6f0b4c3100f525049a
wiki/howto/onboarding.md
| ... | ... | @@ -4,217 +4,228 @@ This document describes the onboarding process for a new team member (developer) |
| 4 | 4 | |
| 5 | 5 | First of all, make sure you've looked at [http://www.amazon.de/Patterns-Elements-Reusable-Object-Oriented-Software/dp/0201633612](http://www.amazon.de/Patterns-Elements-Reusable-Object-Oriented-Software/dp/0201633612). That's a great book, and knowing at least some of it will help you a great deal finding your way around our solution. |
| 6 | 6 | |
| 7 | -### SAP Sailing Analytics Development Setup |
|
| 7 | +[TOC] |
|
| 8 | +## SAP Sailing Analytics Development Setup |
|
| 8 | 9 | |
| 9 | -#### Installations |
|
| 10 | +### Accounts |
|
| 10 | 11 | |
| 11 | -1. JDK >= 11 (it is required by Eclipse) |
|
| 12 | -2. Eclipse (Eclipse IDE for Eclipse Committers, version 4.15.0 ["2021-03"](https://www.eclipse.org/downloads/packages/release/2021-03/r/eclipse-ide-eclipse-committers)), [http://www.eclipse.org](http://www.eclipse.org) |
|
| 13 | -3. Get the content of the git repository (see |
|
| 14 | -Steps to build and run the Race Analysis Suite below) |
|
| 15 | -4. Install the eclipse plugins (see Automatic Eclipse plugin installation below) |
|
| 16 | -5. Git (e.g. Git for Windows v2.18), [http://git-scm.com](http://git-scm.com) / [https://git-for-windows.github.io](https://git-for-windows.github.io) |
|
| 17 | -6. MongoDB (at least Release 4.4), download: [https://www.mongodb.com/](https://www.mongodb.com/) |
|
| 18 | -7. RabbitMQ, download from [http://www.rabbitmq.com](http://www.rabbitmq.com). Requires Erlang to be installed. RabbitMQ installer will assist in installing Erlang. Some sources report that there may be trouble with latest versions of RabbitMQ. In some cases, McAffee seems to block the installation of the latest version on SAP hardware; in other cases connection problems to newest versions have been reported. We know that version 3.6.8 works well. [https://github.com/rabbitmq/rabbitmq-server/releases/tag/rabbitmq_v3_6_8](https://github.com/rabbitmq/rabbitmq-server/releases/tag/rabbitmq_v3_6_8) is the link. |
|
| 19 | -8. JDK 1.8 (Java SE 8), [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) --- Alternatively you can use the SAPJVM 1.8: Go to [http://sapjvm.wdf.sap.corp:1080/downloads](http://sapjvm.wdf.sap.corp:1080/downloads), select JVM 1.8, extract the downloaded .zip into desired location (e.g. C:\Program Files\Java), then Go to Window -> Preferences -> Java -> Installed JREs and add the VM. |
|
| 20 | -9. Maven 3.1.1 (or higher), [http://maven.apache.org](http://maven.apache.org) |
|
| 21 | -10. GWT SDK 2.9.0 ([http://www.gwtproject.org/download.html](http://www.gwtproject.org/download.html)) |
|
| 22 | -11. Standalone Android SDK (see section "Additional steps required for Android projects"). OPTIONALLY: You may additionally install Android Studio ([https://developer.android.com/tools/studio/index.html](https://developer.android.com/tools/studio/index.html)) or IntelliJ IDEA ([https://www.jetbrains.com/idea/download/](https://www.jetbrains.com/idea/download/)). |
|
| 12 | +1. Git Account |
|
| 13 | + The primary Git repository for the project is hosted on sapsailing.com. It is mirrored on an hourly basis into SAP's internal Git/Gerrit repository, but branches from the external Git end up under the remote `sapsailing.com` in the internal repository, thus do not automatically merge into their branch counterparts. Conversely, commits pushed onto branches of the SAP-internal Gerrit will not by themselves end up on the external Git at sapsailing.com. |
|
| 23 | 14 | |
| 24 | -#### Automatic Eclipse plugin installation |
|
| 15 | +- For access to the external git at `ssh://trac@sapsailing.com/home/trac/git` please send your SSH public key to Axel Uhl or Simon Marcel Pamies, requesting git access. Make sure to NOT generate the key using Putty. Putty keys don't work reliably under Linux and on Windows/Cygwin environments. Use ssh-keygen in a Cygwin or Linux or MacOS/X environment instead. For further instructions for generating an ssh-key see [GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) |
|
| 16 | +- Alternatively, for access to the SAP-internal Git/Gerrit repository register yourself as a Git user in the SAP-Git under: [https://git.wdf.sap.corp:8080/](https://git.wdf.sap.corp:8080/); ask the Git administrator (Axel Uhl) to get on the list of enabled committers |
|
| 25 | 17 | |
| 26 | -The necessary Eclipse plugins described above can be automatically be installed into a newly unzipped version of [Eclipse IDE for Eclipse Committers "2020-06"](https://www.eclipse.org/downloads/packages/release/2020-06/r/eclipse-ide-eclipse-committers) by using the script "configuration/installPluginsForEclipse2020-06.sh". In addition, the script applies some updates to plugins packaged with Eclipse itself. To start the plugin installation, run the following command using your Eclipse installation directory as command line parameter for the script: |
|
| 18 | +2. Bugzilla |
|
| 27 | 19 | |
| 28 | - ./installPluginsForEclipse2021-03.sh "/some/path/on/my/computer/eclipse" |
|
| 20 | +- Create an account at https://bugzilla.sapsailing.com |
|
| 21 | +- Ask the Bugzilla administrator (axel.uhl@sap.com) to enable your account for editing bugs |
|
| 22 | +- Bugzilla url: [https://bugzilla.sapsailing.com](https://bugzilla.sapsailing.com) |
|
| 29 | 23 | |
| 30 | -Be aware that with this script it's not possible to update the plugins to newer versions. Instead you can install a new version by unpacking the base package and executing the script. |
|
| 24 | +3. Wiki |
|
| 31 | 25 | |
| 32 | -###### On Windows |
|
| 33 | -You need a Git Bash or Cygwin shell to run the script. In addition you need to replace all backslashes with forward slashes. |
|
| 26 | +- Send a request to Axel Uhl or Simon Marcel Pamies that includes the SHA1 hash of your desired password. Obtain such an SHA1 hash for your password here: [http://www.sha1-online.com/](http://www.sha1-online.com/). |
|
| 34 | 27 | |
| 35 | -###### On Mac OS: |
|
| 36 | -- Before running the script, start eclipse and install **GWT Plugin** manually from repository [http://storage.googleapis.com/gwt-eclipse-plugin/v3/release](http://storage.googleapis.com/gwt-eclipse-plugin/v3/release) |
|
| 37 | -- It's not sufficient to provide the path to the app, instead you need to get the path to the directory inside of the app package hosting the "eclipse" binary (.../Eclipse.app/Contents/MacOS). |
|
| 28 | +4. Hudson |
|
| 29 | + |
|
| 30 | +- Request a [Hudson](https://hudson.sapsailing.com) user by sending e-mail to Axel Uhl or Simon Marcel Pamies. |
|
| 31 | + |
|
| 32 | +### Installations |
|
| 33 | + |
|
| 34 | +1. JDK >= 11, it is required by Eclipse and therefore should be referenced in the environment variable `JAVA_HOME`. As an alternative to the environment variable Eclipse can be configured to use a different version of Java see [here](https://stackoverflow.com/questions/18469170/how-to-run-eclipse-with-different-java-version) for further instructions. |
|
| 35 | +2. Eclipse IDE for Eclipse Committers, version 4.15.0 ["2021-03"](https://www.eclipse.org/downloads/packages/release/2021-03/r/eclipse-ide-eclipse-committers) |
|
| 36 | +3. JDK 1.8 (Java SE 8), ideal is the SAPJVM 1.8: Go to [https://tools.eu1.hana.ondemand.com/#cloud](https://tools.eu1.hana.ondemand.com/#cloud), scroll down to `SAP JVM` select your operating System, extract the downloaded .zip into desired location (e.g. Windows C:\Program Files\Java), then open Eclipse and navigate to Window → Preferences → Java → Installed JREs and add the 1.8 VM. |
|
| 37 | +4. Install the eclipse plugins (see [Automatic Eclipse plugin installation](#automatic-eclipse-plugin-installation)) |
|
| 38 | +5. Configure Eclipse (see [Tuning the Eclipse Installation](#tuning-the-eclipse-installation)) |
|
| 39 | +6. Git (e.g. Git for Windows v2.18), [http://git-scm.com](http://git-scm.com) / [https://git-for-windows.github.io](https://git-for-windows.github.io) |
|
| 40 | +7. Configure git (see [Git repository configuration essentials](#git-repository-configuration-essentials)) |
|
| 41 | +8. MongoDB (at least Release 4.4), download: [https://www.mongodb.com/](https://www.mongodb.com/) |
|
| 42 | +9. RabbitMQ, download from [http://www.rabbitmq.com](http://www.rabbitmq.com). Requires Erlang to be installed. RabbitMQ installer will assist in installing Erlang. Some sources report that there may be trouble with the latest versions of RabbitMQ. In some cases, McAffee seems to block the installation of the latest version on SAP hardware; in other cases connection problems to the newest versions have been reported. We know that version 3.6.8 works well. [https://github.com/rabbitmq/rabbitmq-server/releases/tag/rabbitmq_v3_6_8](https://github.com/rabbitmq/rabbitmq-server/releases/tag/rabbitmq_v3_6_8) |
|
| 43 | +10. Maven 3.1.1 (or higher), [http://maven.apache.org](http://maven.apache.org) |
|
| 44 | + A setup guide for windows can be found on this webpage: [https://maven.apache.org/guides/getting-started/windows-prerequisites.html](https://maven.apache.org/guides/getting-started/windows-prerequisites.html) |
|
| 45 | +11. GWT SDK 2.9.0 ([http://www.gwtproject.org/download.html](http://www.gwtproject.org/download.html)) |
|
| 46 | + Download the gwt sdk and extract it to a location of your preference (e.g. windows C:\Program Files\gwt) |
|
| 47 | +12. Standalone Android SDK (see section "Additional steps required for Android projects"). OPTIONALLY: You may additionally install Android Studio ([https://developer.android.com/tools/studio/index.html](https://developer.android.com/tools/studio/index.html)) or IntelliJ IDEA ([https://www.jetbrains.com/idea/download/](https://www.jetbrains.com/idea/download/)). |
|
| 48 | + Make sure that the environment variable `ANDROID_HOME` is set (e.g. Windows C:\Users\\**'user'**\AppData\Local\Android\Sdk ) |
|
| 49 | +13. Get the content of the git repository |
|
| 50 | + Clone the repository to your local file system from `ssh://[SAP-User]@git.wdf.sap.corp:29418/SAPSail/sapsailingcapture.git` or `ssh://trac@sapsailing.com/home/trac/git` User "trac" has all public ssh keys. |
|
| 51 | +14. Configure Maven to use the correct JRE by following the instructions in the paragraph [maven-setup](#maven-setup) |
|
| 52 | +15. Follow the instructions in the [development setup](#sap-sailing-analytics-development-setup) to build the project. |
|
| 53 | +16. The steps for building the project for a deployment can be found in the [Build for deployment](#build-for-deployment) section. This is not needed in the daily development workflow and should only be run when needed. |
|
| 54 | + |
|
| 55 | +### Further optional but recommended installations |
|
| 56 | + |
|
| 57 | +1. Cygwin, [http://www.cygwin.com/](http://www.cygwin.com/) |
|
| 58 | + Please note that when using one of the newer versions of Cygwin, your Cygwin home folder setting might differ from your Windows home folder. This will likely lead to problems when issuing certain commands. For troubleshooting, take a look at the following thread: [https://stackoverflow.com/questions/1494658/how-can-i-change-my-cygwin-home-folder-after-installation](https://stackoverflow.com/questions/1494658/how-can-i-change-my-cygwin-home-folder-after-installation) |
|
| 59 | +2. Eclipse Mylyn Bugzilla extension |
|
| 60 | +3. kdiff3 (git tool) |
|
| 61 | +4. Firebug (javascript & .css debugging, included in Firefox Developer Tools in newer versions of Firefox by default) |
|
| 62 | + |
|
| 63 | +### Automatic Eclipse plugin installation |
|
| 38 | 64 | |
| 39 | -Be aware hat the installation may take several minutes depending on your Internet connection. When the script finished running, please check that no errors occurred (the installation process only logs errors but doesn't fail). |
|
| 65 | +The necessary Eclipse plugins described above can be automatically be installed into a newly unzipped version of ["2021-03"](https://www.eclipse.org/downloads/packages/release/2021-03/r/eclipse-ide-eclipse-committers) by using the script "./configuration/installPluginsForEclipse2021-03.sh". In addition, the script applies some updates to plugins packaged with Eclipse itself. To start the plugin installation, run the following command using your Eclipse installation directory as command line parameter for the script: |
|
| 66 | + |
|
| 67 | + ./installPluginsForEclipse2021-03.sh "/some/path/on/my/computer/eclipse" |
|
| 68 | + |
|
| 69 | +Be aware that with this script it's not possible to update the plugins to newer versions. Instead, you can install a new version by unpacking the base package and executing the script. |
|
| 70 | + |
|
| 71 | +Be aware hat the installation may take several minutes depending on your Internet connection. When the script finished running, please check that no errors occurred (the installation process only logs warnings/errors but doesn't fail). |
|
| 40 | 72 | |
| 41 | 73 | The script will install the following plugins for your convenience: |
| 42 | 74 | |
| 43 | -* GWT Plugin ([https://github.com/gwt-plugins/gwt-eclipse-plugin](https://github.com/gwt-plugins/gwt-eclipse-plugin)) |
|
| 44 | -* GWT SDM Debug Bridge ([http://sdbg.github.io/](http://sdbg.github.io/)) |
|
| 45 | -* Easy Shell ([https://anb0s.github.io/EasyShell/](https://anb0s.github.io/EasyShell/)) |
|
| 46 | -* Memory Analyzer ([https://www.eclipse.org/mat/](https://www.eclipse.org/mat/)) |
|
| 47 | -* SAP JVM Profiler ([https://tools.hana.ondemand.com](https://tools.hana.ondemand.com)) |
|
| 48 | -* UMLet ([https://www.umlet.com/](https://www.umlet.com/)) |
|
| 49 | -* various updates to preinstalled plugins |
|
| 75 | +- GWT Plugin ([https://github.com/gwt-plugins/gwt-eclipse-plugin](https://github.com/gwt-plugins/gwt-eclipse-plugin)) |
|
| 76 | +- GWT SDM Debug Bridge ([http://sdbg.github.io/](http://sdbg.github.io/)) |
|
| 77 | +- Easy Shell ([https://anb0s.github.io/EasyShell/](https://anb0s.github.io/EasyShell/)) |
|
| 78 | +- Memory Analyzer ([https://www.eclipse.org/mat/](https://www.eclipse.org/mat/)) |
|
| 79 | +- SAP JVM Profiler ([https://tools.hana.ondemand.com](https://tools.hana.ondemand.com)) |
|
| 80 | +- UMLet ([https://www.umlet.com/](https://www.umlet.com/)) |
|
| 81 | +- various updates to preinstalled plugins |
|
| 50 | 82 | |
| 51 | -#### Tuning the Eclipse Installation |
|
| 83 | +#### On Windows |
|
| 84 | + |
|
| 85 | +You need a Git Bash or Cygwin shell to run the script. The default path of Eclipse on Windows is: C:/Users/**'user'**/eclipse//committers-2021-03/eclipse |
|
| 86 | + |
|
| 87 | +#### On Mac OS: |
|
| 88 | + |
|
| 89 | +- Before running the script, start eclipse and install **GWT Plugin** manually from repository [http://storage.googleapis.com/gwt-eclipse-plugin/v3/release](http://storage.googleapis.com/gwt-eclipse-plugin/v3/release) |
|
| 90 | +- It's not sufficient to provide the path to the app, instead you need to get the path to the directory inside of the app package hosting the "eclipse" binary (.../Eclipse.app/Contents/MacOS). |
|
| 91 | + |
|
| 92 | +### Tuning the Eclipse Installation |
|
| 52 | 93 | |
| 53 | 94 | Out of the box, two settings in Eclipse avoid a clean workspace. Go to Window - Preferences and change the following two settings: |
| 54 | 95 | |
| 55 | -* Set the "Missing GWT SDK" warning to "Ignore". See screenshot below. |
|
| 96 | +- Set the "Missing GWT SDK" warning to "Ignore". See screenshot below. |
|
| 56 | 97 | |
| 57 | 98 |  |
| 58 | 99 | |
| 59 | -* Set the "Plug-in does not export all packages" warning to "Ignore". See screenshot below. |
|
| 100 | +- Set the "Plug-in does not export all packages" warning to "Ignore". See screenshot below. |
|
| 60 | 101 | |
| 61 | 102 |  |
| 62 | 103 | |
| 63 | -#### Further optional but recommended installations |
|
| 64 | - |
|
| 65 | -1. Cygwin, [http://www.cygwin.com/](http://www.cygwin.com/) |
|
| 66 | -2. Eclipse Mylyn Bugzilla extension |
|
| 67 | -3. kdiff3 (git tool) |
|
| 68 | -4. Firebug (javascript & .css debugging, included in Firefox Developer Tools in newer versions of Firefox by default) |
|
| 69 | - |
|
| 70 | -#### Accounts |
|
| 104 | +### Git repository configuration essentials |
|
| 71 | 105 | |
| 72 | -1. Git Account |
|
| 73 | -The primary Git repository for the project is hosted on sapsailing.com. It is mirrored on an hourly basis into SAP's internal Git/Gerrit repository, but branches from the external Git end up under the remote ``sapsailing.com`` in the internal repository, thus do not automatically merge into their branch counterparts. Conversely, commits pushed onto branches of the SAP-internal Gerrit will not by themselves end up on the external Git at sapsailing.com. |
|
| 74 | - * For access to the external git at ``ssh://trac@sapsailing.com/home/trac/git`` please send your SSH public key to Axel Uhl or Simon Marcel Pamies, requesting git access. Make sure to NOT generate the key using Putty. Putty keys don't work reliably under Linux and on Windows/Cygwin environments. Use ssh-keygen in a Cygwin or Linux or MacOS/X environment instead. |
|
| 75 | - * Alternatively, for access to the SAP-internal Git/Gerrit repository register yourself as a Git user in the SAP-Git under: [https://git.wdf.sap.corp:8080/](https://git.wdf.sap.corp:8080/); ask the Git administrator (Axel Uhl) to get on the list of enabled committers |
|
| 76 | -2. Bugzilla |
|
| 77 | - * Create an account at https://bugzilla.sapsailing.com |
|
| 78 | - * Ask the Bugzilla administrator (axel.uhl@sap.com) to enable your account for editing bugs |
|
| 79 | - * Bugzilla url: [https://bugzilla.sapsailing.com](https://bugzilla.sapsailing.com) |
|
| 80 | -3. Wiki |
|
| 81 | - * Send a request to Axel Uhl or Simon Marcel Pamies that includes the SHA1 hash of your desired password. Obtain such an SHA1 hash for your password here: [http://www.sha1-online.com/](http://www.sha1-online.com/). |
|
| 82 | -4. Hudson |
|
| 83 | - * Request a [Hudson](https://hudson.sapsailing.com) user by sending e-mail to Axel Uhl or Simon Marcel Pamies. |
|
| 84 | - |
|
| 85 | -#### Steps to build and run the Race Analysis Suite |
|
| 86 | - |
|
| 87 | -1. Get the content of the git repository |
|
| 88 | - * Generate SSH Keys with "ssh-keygen -t rsa -C "" " command in Cygwin Terminal (Not with Putty!!!) |
|
| 89 | - * Clone the repository to your local file system from `ssh://[SAP-User]@git.wdf.sap.corp:29418/SAPSail/sapsailingcapture.git` or `ssh://trac@sapsailing.com/home/trac/git` User "trac" has all public ssh keys. |
|
| 90 | - |
|
| 91 | -To Clone the repository use the command: `git clone` after directing into a prior initialized repository. |
|
| 92 | - * Please note that when using one of the newer versions of Cygwin, your Cygwin home folder setting might differ from your Windows home folder. This will likely lead to problems when issuing certain commands. For troubleshooting, take a look at the following thread: [https://stackoverflow.com/questions/1494658/how-can-i-change-my-cygwin-home-folder-after-installation](https://stackoverflow.com/questions/1494658/how-can-i-change-my-cygwin-home-folder-after-installation) |
|
| 93 | -2. Check out the 'master' branch from the git repository. The 'master' branch is the main development branch. Please check that you start your work on this branch. |
|
| 94 | -2. Configure your local git repository |
|
| 95 | - * Execute the command `git config core.autocrlf false` in the git repository |
|
| 96 | - * Ensure that your git username and email is set properly: In case you are unsure, use the commands `git config user.name "My Name"` and `git config user.email my.email@sap.com` in the git repository. |
|
| 97 | -3. Setup and configure Eclipse |
|
| 98 | - * Make absolutely sure to import CodeFormatter.xml (from $GIT_HOME/java) into your Eclipse preferences (Preferences->Java->Code Style->Formatter) |
|
| 99 | - * It is also strongly recommended to import CodeFormatter\_JavaScript.xml (from $GIT_HOME/java) into your Eclipse preferences (Preferences->JavaScript->Code Style->Formatter) to ensure correct formatting of JavaScript Native Interface (JSNI) implementations. |
|
| 100 | - * Install the required plugins using the script provided above. Further configuration steps depend on the plugins being installed successfully. |
|
| 101 | - * In Eclipse go to "Window->Preferences->Java->Build Path->Classpath Variables" and create a new classpath variable called ``ANDROID_HOME``. Set its value to the install location of your Android SDK, e.g., ``c:\apps\android-sdk-windows`` or ``/usr/local/android-sdk-linux``. |
|
| 102 | - * Install GWT SDK and add the SDK in Eclipse (Preferences -> GWT -> GWT Settings -> Add...) |
|
| 103 | - * In "Window->Preferences->GWT->Errors/Warnings, set "Missing SDK" to "Ignore" (If not done earlier, see: Tuning the Eclipse Installation) |
|
| 104 | - * In "Window->Preferences->General->Editors->TextEditors" check Insert Spaces for Tabs |
|
| 105 | - * In "Window->Preferences->Web->HTML Files->Editor" indent using Spaces |
|
| 106 | - * In "Window->Preferences->General->Content Types" select on the right side CSS, now add in the lower file association list *.gss to get limited syntax highlighting and content assist in GSS files |
|
| 107 | - * In "Window->Preferences->XML(Wild Web Developer)->Validation & Resolution->Enable Validation" Disable the Checkbox |
|
| 108 | - * Install Eclipse debugger for GWT SuperDevMode |
|
| 109 | - * Install Eclipse eGit (optional) |
|
| 110 | - * Check that JDK 1.8 is available and has been set for compilation in Eclipse |
|
| 111 | - * Check that JDK 1.8 has been matched to JavaSE-1.8 (...>Installed JREs>Execution Environments) |
|
| 112 | - * It is also possible to match the SAPJVM 8 to JavaSE-1.8 (for profiling purposes) |
|
| 113 | - * Import all Race Analysis projects from the `java/` subdirectory of the git main folder (make sure to import via the wizard [but without smart import]<del>"Git->Projects from Git"</del> "Import->General->Projects from Folder or Archive" in Eclipse, and additionally make sure to scan for nested projects!) |
|
| 114 | - * Import all projects from the `mobile/` subdirectory of the git main folder; this in particular contains the race committee app projects |
|
| 115 | - * Set the Eclipse target platform to race-analysis-p2-remote.target (located in com.sap.sailing.targetplatform/definitions) |
|
| 116 | - * Wait until the target platform has been resolved completely |
|
| 117 | - * Rebuild all projects |
|
| 118 | -4. On clear workspace additional steps should be performed once: |
|
| 119 | - 1. Run "GWT Dashboards SDM" launch configuration. After successful start, launch configuration can be stopped. |
|
| 120 | - 2. Run "GWT Security SDM" launch configuration. After successful start, launch configuration can be stopped. |
|
| 121 | - 3. Run "GWT xdStorage Sample SDM" launch configuration. After successful start, launch configuration can be stopped. |
|
| 122 | -5. Run the Race Analysis Suite |
|
| 123 | - * Start the MongoDB (cd /somePathTo MongoDB/mongodb/bin; rm c:/data/SAP/sailing/mongodb/mongod.lock; ./mongod --dbpath c:/data/SAP/sailing/mongodb) |
|
| 124 | - * Start the appropriate Eclipse launch configuration (e.g. 'Sailing Server (no Proxy)') You´ll find this in the debug dropdown |
|
| 125 | - * <del>Run "Security UI sdm" in the debug dropdown</del> (obsolete) |
|
| 126 | - * Run "GWT Sailing SDM" in the debug dropdown |
|
| 127 | -6. Import races within the Race Analysis Suite |
|
| 128 | - * <del>Choose "Security UI sdm" in the upper left corner of the "Development Mode" Tab in Eclipse and open "...Login.html" in your browser</del> (obsolete) |
|
| 129 | - * Choose "GWT Sailing SDM" in the "Development Mode" Tab and open "...AdminConsole.html..." (It is normal that the first try fails. Reload the page after the first try) |
|
| 130 | - * Default Login: user "admin", password "admin" |
|
| 131 | - * In the list on the left, click on "Connectors" |
|
| 132 | - * For TracTrac Events: In the "TracTrac Connections" Form, fill in the JSON URL [http://germanmaster.traclive.dk/events/event_20120905_erEuropean/jsonservice.php](http://germanmaster.traclive.dk/events/event_20120905_erEuropean/jsonservice.php)(all other required information will be filled in automatically) |
|
| 133 | - * Press "List Races" |
|
| 134 | - |
|
| 135 | -#### Git repository configuration essentials |
|
| 136 | 106 | The project has some configuration of line endings for specific file types in ".gitattributes". To make this work as intended, you need to ensure that the git attribute "core.autocrlf" is set to "false". This can be done by navigating to your local repository in a Bash/Git Bash/Cygwin instance and executing the command `git config core.autocrlf false`. |
| 137 | 107 | |
| 138 | 108 | If you are first time git user, don't forget to specify your user metadata. Use the commands `git config user.name "My Name"` and `git config user.email my.email@sap.com` to tell git your name and email address. |
| 139 | 109 | |
| 140 | 110 | Depending on the location of your local repository, it's filepaths might be too long for the default settings to handle. Excecute the command `git config --system core.longpaths true` to enable your system wide git installation to handle long file paths. |
| 141 | 111 | |
| 142 | -#### Maven Setup |
|
| 143 | -Copy the settings.xml **and** the toolchains.xml from the top-level git folder to your ~/.m2 directory. Adjust the proxy settings in settings.xml accordingly (suggested settings for corporate network inside). Set the paths inside of toolchains.xml to your JDKs depending on where you installed them (this is like setting the compiler for your IDE, but for Maven; This makes it possible to build with the same Maven configuration on every system). Make sure the mvn executable you installed above is in your path. Open a shell (preferrably a git bash or a cygwin bash), cd to the git workspace's root folder and issue "./configuration/buildAndUpdateProduct.sh build". This should build the software and run all the tests. If you want to avoid the tests being executed, use the -t option. If you only want to build one GWT permutation (Chrome/English), use the -b option. When inside the SAP VPN, add the -p option for proxy use. Run the build script without arguments to get usage hints. |
|
| 112 | +### Maven Setup |
|
| 144 | 113 | |
| 145 | -#### Further hints |
|
| 146 | -- Configure Eclipse to use Chrome or Firefox as the default browser |
|
| 147 | -- Install the GWT Browser Plugin for the GWT Development mode <del>(Chrome or Firefox; as of this writing (2013-11-05), Firefox is the only platform where the plug-in runs stably)</del> (As of 2016-08-31 Firefox is the only browser supporting the GWT plugin, you have to download Firefox version 24 for it to work) |
|
| 148 | -- Use SAP JVM Profiler. If you used the script above and installed the SAPJVM instead of the jdk, you can now open the profiling perspective by clicking on Window -> Perspective -> Open Perspective -> Profiling) |
|
| 149 | -- Make sure you run Eclipse with a JRE containing javax/xml/bind, otherwise you will not be able to use the SDM. See [https://github.com/sdbg/sdbg/pull/162](https://github.com/sdbg/sdbg/pull/162). To start Eclipse with Java 8 add the following two lines above the `-vmargs` in your eclipse.ini: |
|
| 150 | -`-vm` |
|
| 151 | -`<path/to/sapjvm8/jre/bin/java>` |
|
| 114 | +Copy the settings.xml **and** the toolchains.xml from the top-level git folder to your ~/.m2 directory. Adjust the proxy settings in settings.xml accordingly (suggested settings for corporate network inside). Set the paths inside of toolchains.xml to your JDKs depending on where you installed them (this is like setting the compiler for your IDE, but for Maven; This makes it possible to build with the same Maven configuration on every system). Make sure the mvn executable you installed above is in your path. |
|
| 152 | 115 | |
| 153 | -#### Git usage troubleshooting |
|
| 116 | +### Steps to build and run the Race Analysis Suite |
|
| 154 | 117 | |
| 155 | -There are some inconsistencies regarding line endings (unix vs windows) in our git repository. There is a configuration named ".gitattributes" committed to the root folder of the repository that helps to prevent inconsistencies of line endings when committing files. Files that existed before are partially using unix (LF) or windows (CRLF) line endings. When committing files, git will ensure unix line endings for e.g. *.java files. This can lead to big diffs that hurt when trying to merge/diff. |
|
| 118 | +1. Check out the 'master' branch from the git repository. The 'master' branch is the main development branch. Please check that you start your work on this branch. |
|
| 119 | +2. Setup and configure Eclipse |
|
| 156 | 120 | |
| 157 | -When merging branches that potentially have conflicts regarding line endings, you can specifically parameterize the git command line to not produce a big bunch of conflicts. Using the parameter `-Xignore-space-at-eol` while doing a merge will drastically reduce such conflicts. Using this, the commandline to merge "master" into your current branch is `git merge -Xignore-space-at-eol master`. |
|
| 121 | +- Make absolutely sure to import CodeFormatter.xml (from $GIT_HOME/java) into your Eclipse preferences (Window ⇒ Preferences ⇒ Java ⇒ Code Style ⇒ Formatter) |
|
| 122 | +- It is also strongly recommended to import CodeFormatter_JavaScript.xml (from $GIT_HOME/java) into your Eclipse preferences (Window ⇒ Preferences ⇒ Web ⇒ Client-side JavaScript ⇒ Formatter) to ensure correct formatting of JavaScript Native Interface (JSNI) implementations. |
|
| 123 | +- In Eclipse go to "Window ⇒ Preferences ⇒ Java ⇒ Build Path ⇒ Classpath Variables" and create a new classpath variable called `ANDROID_HOME`. Set its value to the installation location of your Android SDK, e.g., `C:\Users\'user'\AppData\Local\Android\Sdk` or `/usr/local/android-sdk-linux`. |
|
| 124 | +- Add the SDK in Eclipse (Preferences ⇒ GWT ⇒ GWT Settings ⇒ Add...) |
|
| 125 | +- In "Window ⇒ Preferences ⇒ GWT ⇒ Errors/Warnings, set "Missing SDK" to "Ignore" (If not done earlier, see: Tuning the Eclipse Installation) |
|
| 126 | +- In "Window ⇒ Preferences ⇒ General ⇒ Editors ⇒ TextEditors" check Insert Spaces for Tabs |
|
| 127 | +- In "Window ⇒ Preferences ⇒ Web ⇒ HTML Files ⇒ Editor" indent using Spaces |
|
| 128 | +- In "Window ⇒ Preferences ⇒ General ⇒ Content Types" select on the right side CSS, now add in the lower file association list \*.gss to get limited syntax highlighting and content assist in GSS files |
|
| 129 | +- In "Window ⇒ Preferences ⇒ XML(Wild Web Developer) ⇒ Validation & Resolution ⇒ Enable Validation" Disable the Checkbox |
|
| 130 | +- Install Eclipse debugger for GWT SuperDevMode |
|
| 131 | +- Install Eclipse eGit (optional) |
|
| 132 | +- Check that JDK 1.8 is available and has been set for compilation in Eclipse |
|
| 133 | +- Check that JDK 1.8 has been matched to JavaSE-1.8 ("Window ⇒ Preferences ⇒ Java ⇒ Installed JREs ⇒ Execution Environments ⇒ JavaSE-1.8) |
|
| 134 | +- Import all Race Analysis projects from the `java/` subdirectory of the git main folder (make sure to import via the wizard [but without smart import] "Import ⇒ General ⇒ Projects from Folder or Archive" in Eclipse, and additionally make sure to scan for nested projects!) |
|
| 135 | +- Import all projects from the `mobile/` subdirectory of the git main folder; this in particular contains the race committee app projects |
|
| 136 | +- Set the Eclipse target platform to race-analysis-p2-remote.target (located in com.sap.sailing.targetplatform/definitions) Window ⇒ Preferences ⇒ Plug-in Development ⇒ Target Platform select `Race Analysis Target` |
|
| 137 | +- Wait until the target platform has been resolved completely |
|
| 138 | +- Rebuild all projects |
|
| 158 | 139 | |
| 159 | -In cases where code was reformatted, you can also ignore all whitespace changes by using the parameter `-Xignore-space-change`. |
|
| 140 | +1. On clear workspace additional steps should be performed once: |
|
| 141 | + 1. Run "GWT Dashboards SDM" launch configuration. After successful start, launch configuration can be stopped. |
|
| 142 | + 2. Run "GWT Security SDM" launch configuration. After successful start, launch configuration can be stopped. |
|
| 143 | + 3. Run "GWT xdStorage Sample SDM" launch configuration. After successful start, launch configuration can be stopped. |
|
| 144 | +2. Run the Race Analysis Suite |
|
| 145 | + 1. Start the MongoDB (cd /somePathTo MongoDB/mongodb/bin; rm c:/data/SAP/sailing/mongodb/mongod.lock; ./mongod --dbpath c:/data/SAP/sailing/mongodb) |
|
| 146 | + 2. Run "GWT Sailing SDM" in the debug dropdown |
|
| 147 | + 3. Start the appropriate Eclipse launch configuration (e.g. 'Sailing Server (no Proxy)') You´ll find this in the debug dropdown |
|
| 148 | +3. Import races within the Race Analysis Suite |
|
| 160 | 149 | |
| 161 | -When doing a diff, you can also use the parameters `--ignore-space-at-eol` and `--ignore-space-change`. |
|
| 150 | +- Choose "GWT Sailing SDM" in the "Development Mode" Tab and open "...AdminConsole.html..." (It is normal that the first try fails. Reload the page after the first try) |
|
| 151 | +- Default Login: user "admin", password "admin" |
|
| 152 | +- In the list on the left, click on "Connectors" |
|
| 153 | +- For TracTrac Events: In the "TracTrac Connections" Form, fill in the JSON URL [http://germanmaster.traclive.dk/events/event_20120905_erEuropean/jsonservice.php](http://germanmaster.traclive.dk/events/event_20120905_erEuropean/jsonservice.php)(all other required information will be filled in automatically) |
|
| 154 | +- Press "List Races" |
|
| 155 | + |
|
| 156 | +- Use SAP JVM Profiler. If you used the script above and installed the SAPJVM instead of the jdk, you can now open the profiling perspective by clicking on Window ⇒ Perspective ⇒ Open Perspective ⇒ Profiling) |
|
| 157 | + |
|
| 158 | +### Build for deployment |
|
| 159 | +Open a shell (preferrably a git bash or a cygwin bash), cd to the git workspace's root folder and issue "./configuration/buildAndUpdateProduct.sh build". This should build the software and run all the tests. If you want to avoid the tests being executed, use the -t option. If you only want to build one GWT permutation (Chrome/English), use the -b option. When inside the SAP VPN, add the -p option for proxy use. Run the build script without arguments to get usage hints. |
|
| 162 | 160 | |
| 163 | -When doing a merge in Eclipse, you can tell the merge editor to do a similar thing by right clicking and selecting "Ignore White Space". Other merge/diff tools also provide such a functionality. |
|
| 164 | 161 | |
| 165 | -When a file has "wrong line endings" (line endings are different to what is configured in ".gitattributes" file) and you touch those files without changing the contents, git will potentially show that these files are changed. To get rid of those phantom changes, you can do a "git checkout HEAD path/toFile/in/repository". |
|
| 166 | 162 | |
| 167 | -#### Further hints |
|
| 163 | +## Further hints |
|
| 168 | 164 | |
| 169 | -If you are working with a linux-system and you get the error message `error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory` try to install lib32z1 and lib32stdc++6. |
|
| 165 | +If you are working with a linux-system and you get the error message `error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory` try to install lib32z1 and lib32stdc++6. |
|
| 166 | + |
|
| 167 | +### Steps to consider for using other modules |
|
| 170 | 168 | |
| 171 | -#### Steps to consider for using other modules |
|
| 172 | 169 | 1. For Eclipse Build |
| 173 | - * MANIFEST.MF , add module names unter dependencies |
|
| 174 | - * *.gwt.xml , add `<inherits name="-modulename-.-gwt.xml file name-" />` |
|
| 175 | - * In DebugConfigurations => Classpaths, Add Sourcefolder where classes are you want to user from the module |
|
| 170 | + - MANIFEST.MF , add module names unter dependencies |
|
| 171 | + - \*.gwt.xml , add `<inherits name="-modulename-.-gwt.xml file name-" />` |
|
| 172 | + - In DebugConfigurations => Classpaths, Add Sourcefolder where classes are you want to user from the module |
|
| 176 | 173 | 2. For Maven Build |
| 177 | - * pom.xml , Add Dependency to used module ie. |
|
| 178 | -`<dependency>` |
|
| 179 | -`<groupId>com.sap.sailing</groupId>` |
|
| 180 | -`<artifactId>com.sap.sailing.domain.common</artifactId>` |
|
| 181 | -`<version>1.0.0-SNAPSHOT</version>` |
|
| 182 | -`<classifier>sources</classifier>` |
|
| 183 | -`</dependency>` |
|
| 174 | + - pom.xml , Add Dependency to used module ie. |
|
| 175 | + `<dependency>` |
|
| 176 | + `<groupId>com.sap.sailing</groupId>` |
|
| 177 | + `<artifactId>com.sap.sailing.domain.common</artifactId>` |
|
| 178 | + `<version>1.0.0-SNAPSHOT</version>` |
|
| 179 | + `<classifier>sources</classifier>` |
|
| 180 | + `</dependency>` |
|
| 184 | 181 | |
| 185 | -#### Using Android Studio for Development |
|
| 182 | +### Using Android Studio for Development |
|
| 186 | 183 | |
| 187 | 184 | The Android Apps can be built in Android Studio or gradle command line. Android Studio is built on top of IntelliJ IDEA, so it is possible to use IntelliJ IDEA as well. |
| 188 | 185 | |
| 189 | 186 | 1. On the "Welcome Screen" choose "Import Project (Eclipse, ADT, Gradle, etc.)" |
| 190 | 187 | 2. Navigate to the project root folder and select the "build.gradle" file (all used modules are defined in "settings.gradle") |
| 191 | - * it will download all necessary gradle runtime files |
|
| 192 | - * you will see floating messages at the top right |
|
| 193 | - * ignore "non-managed pom.xml file..." |
|
| 194 | - * choose "add root" from "Unregistered VCS root detected" (you can add this later, if you missed it) |
|
| 188 | + - it will download all necessary gradle runtime files |
|
| 189 | + - you will see floating messages at the top right |
|
| 190 | + - ignore "non-managed pom.xml file..." |
|
| 191 | + - choose "add root" from "Unregistered VCS root detected" (you can add this later, if you missed it) |
|
| 195 | 192 | 3. Setup the Android SDK |
| 196 | - * in Android Studio press Tools -> Android -> SDK Manager |
|
| 197 | - * Install from section "Tools" (hint: carefull not to update |
|
| 198 | - * Android SDK Tools |
|
| 199 | - * Android SDK Platform-tools |
|
| 200 | - * Android SDK Build-tools 22.0.1 (latest version at the time of writing) |
|
| 201 | - * Install everything of "Android 5.1.1 (API 22)" (latest API at the time of writing) |
|
| 202 | - * the "System Images" are optional and only needed for the emulators, which can't be fully used because of the missing Google Play Services (needed for location detection in the wind fragment) |
|
| 203 | - * Install from section "Extras" |
|
| 204 | - * Android Support Repository |
|
| 205 | - * Google Repository |
|
| 206 | - * Google USB Driver (only on Windows) |
|
| 193 | + - in Android Studio press Tools ⇒ Android ⇒ SDK Manager |
|
| 194 | + - Install from section "Tools" (hint: carefull not to update |
|
| 195 | + - Android SDK Tools |
|
| 196 | + - Android SDK Platform-tools |
|
| 197 | + - Android SDK Build-tools 22.0.1 (latest version at the time of writing) |
|
| 198 | + - Install everything of "Android 5.1.1 (API 22)" (latest API at the time of writing) |
|
| 199 | + - the "System Images" are optional and only needed for the emulators, which can't be fully used because of the missing Google Play Services (needed for location detection in the wind fragment) |
|
| 200 | + - Install from section "Extras" |
|
| 201 | + - Android Support Repository |
|
| 202 | + - Google Repository |
|
| 203 | + - Google USB Driver (only on Windows) |
|
| 207 | 204 | 4. To edit all (not only Android) modules, open the left window "1: Project" and switch the view from "Android" to "Project" (folder view) |
| 208 | -5. At the top is a drop down, where you can switch the mobile projects (com.sap.sailing.*) and start with buttons right to it |
|
| 209 | - * Run (starts the app on a real device or emulator) |
|
| 210 | - * Debug (starts the app with an attached debugger) |
|
| 211 | - * Attach Debugger (useful, if the app is currently running and you want to start debugging against the correspond sources) |
|
| 205 | +5. At the top is a drop down, where you can switch the mobile projects (com.sap.sailing.\*) and start with buttons right to it |
|
| 206 | + - Run (starts the app on a real device or emulator) |
|
| 207 | + - Debug (starts the app with an attached debugger) |
|
| 208 | + - Attach Debugger (useful, if the app is currently running and you want to start debugging against the correspond sources) |
|
| 212 | 209 | |
| 213 | 210 | If git is not in the Path system environment variable, the gradle build will not work. |
| 214 | 211 | |
| 215 | -##### To enable missing git integration |
|
| 212 | +### Git usage troubleshooting |
|
| 213 | + |
|
| 214 | +There are some inconsistencies regarding line endings (unix vs windows) in our git repository. There is a configuration named ".gitattributes" committed to the root folder of the repository that helps to prevent inconsistencies of line endings when committing files. Files that existed before are partially using unix (LF) or windows (CRLF) line endings. When committing files, git will ensure unix line endings for e.g. \*.java files. This can lead to big diffs that hurt when trying to merge/diff. |
|
| 215 | + |
|
| 216 | +When merging branches that potentially have conflicts regarding line endings, you can specifically parameterize the git command line to not produce a big bunch of conflicts. Using the parameter `-Xignore-space-at-eol` while doing a merge will drastically reduce such conflicts. Using this, the commandline to merge "master" into your current branch is `git merge -Xignore-space-at-eol master`. |
|
| 217 | + |
|
| 218 | +In cases where code was reformatted, you can also ignore all whitespace changes by using the parameter `-Xignore-space-change`. |
|
| 219 | + |
|
| 220 | +When doing a diff, you can also use the parameters `--ignore-space-at-eol` and `--ignore-space-change`. |
|
| 221 | + |
|
| 222 | +When doing a merge in Eclipse, you can tell the merge editor to do a similar thing by right clicking and selecting "Ignore White Space". Other merge/diff tools also provide such a functionality. |
|
| 223 | + |
|
| 224 | +When a file has "wrong line endings" (line endings are different to what is configured in ".gitattributes" file) and you touch those files without changing the contents, git will potentially show that these files are changed. To get rid of those phantom changes, you can do a "git checkout HEAD path/toFile/in/repository". |
|
| 225 | + |
|
| 226 | +### To enable missing git integration |
|
| 216 | 227 | |
| 217 | -1. navigate to VCS -> Enable Version Control Integration |
|
| 228 | +1. navigate to VCS ⇒ Enable Version Control Integration |
|
| 218 | 229 | 2. choose git in the drop down |
| 219 | 230 | 3. if everything is correct, you'll see the current branch at the bottom line |
| 220 | 231 |