be07dba204fffc909c3018f0cc43fc220546aab8
configuration/buildAndUpdateProduct.sh
| ... | ... | @@ -601,7 +601,6 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then |
| 601 | 601 | cp $i $i.bak |
| 602 | 602 | cat $i | sed -e 's/SinglePermutation/AllPermutations/' >$i.sed |
| 603 | 603 | mv $i.sed $i |
| 604 | - |
|
| 605 | 604 | done |
| 606 | 605 | fi |
| 607 | 606 | else |
configuration/install-gwt
| ... | ... | @@ -1,5 +1,8 @@ |
| 1 | 1 | #!/bin/bash |
| 2 | 2 | SAILING_GIT_ROOT="${1}" |
| 3 | +if [ -n ${2} ]; then |
|
| 4 | + OUTPUT_FOLDER_FOR_GWT_ZIP="${2}" |
|
| 5 | +fi |
|
| 3 | 6 | GWT_VERSION=2.11.0 |
| 4 | 7 | GWT="`mktemp -t -d gwt.XXXXX`" |
| 5 | 8 | GWT_ROOT="${GWT}/trunk" |
| ... | ... | @@ -11,6 +14,9 @@ git clone https://github.com/axeluhl/gwt-maven-plugin.git -b ${GWT_VERSION} |
| 11 | 14 | cd ${GWT_ROOT} |
| 12 | 15 | ant clean dist-dev -Dgwt.version=${GWT_VERSION} |
| 13 | 16 | cp build/dist/gwt-${GWT_VERSION}.zip ${GWT} |
| 17 | +if [ -n ${OUTPUT_FOLDER_FOR_GWT_ZIP} ]; then |
|
| 18 | + cp build/dist/gwt-${GWT_VERSION}.zip ${OUTPUT_FOLDER_FOR_GWT_ZIP} |
|
| 19 | +fi |
|
| 14 | 20 | cd ${GWT} |
| 15 | 21 | rm -rf gwt-${GWT_VERSION} |
| 16 | 22 | unzip gwt-${GWT_VERSION}.zip |
home.md
| ... | ... | @@ -104,6 +104,7 @@ SAP is at the center of today’s technology revolution, developing innovations |
| 104 | 104 | * [[Managing ORC Performance Curve Regattas|wiki/howto/setup-orc-regatta]] |
| 105 | 105 | * [[Qualtrics Surveys|wiki/howto/qualtrics/qualtrics]] |
| 106 | 106 | * [[Chargebee Payment Integration|wiki/howto/chargebee]] |
| 107 | +* [[Building and Using a Forked GWT Version|wiki/howto/development/gwt-fork]] |
|
| 107 | 108 | |
| 108 | 109 | ### Development |
| 109 | 110 |
wiki/howto/development/gwt-fork.md
| ... | ... | @@ -0,0 +1,55 @@ |
| 1 | +# Building and Using a Forked GWT Version |
|
| 2 | + |
|
| 3 | +If we feel we'd like to change something in GWT that we cannot get into the official GWT release, be it temporarily or for good, we have to build our own version of GWT. For the first time this became relevant in the context of [bug5077](https://bugzilla.sapsailing.com/bugzilla/show_bug.cgi?id=5077). The following sections describe the necessary steps to build and work with a forked version of GWT. |
|
| 4 | + |
|
| 5 | +## TL;DR |
|
| 6 | + |
|
| 7 | +See ``configuration/install-gwt``, adjust the ``GWT_VERSION`` and the repository URLs and branches; make sure that under ``configuration/gwt-poms`` you have the necessary ``pom.xml`` files for the version you're planning to build (usually you can copy an existing file from a different version and simply adjust the version number in the new copy). Also see the script's use in ``configuration/buildAndUpdateProduct.sh`` and read and follow the "Forking the GWT Project" section. |
|
| 8 | + |
|
| 9 | +## Forking the GWT Project |
|
| 10 | + |
|
| 11 | +See, e.g., [https://github.com/axeluhl/gwt/tree/issue-7987-compatibility](https://github.com/axeluhl/gwt/tree/issue-7987-compatibility) which is a fork of the original Github project at [https://github.com/gwtproject/gwt](https://github.com/gwtproject/gwt). You can follow the instructions in the README of the original project for building instructions. This will ask you to also clone the GWT tools Github repository from [https://github.com/gwtproject/tools/](https://github.com/gwtproject/tools/). Note that when you use an IDE to consolidate your imports then you're likely to cause Lint errors based on extra imports that an IDE would include for Javadoc type references where the import is not used by non-comment code. |
|
| 12 | + |
|
| 13 | +Running the build successfully produces a file ``gwt-0.0.0.zip`` (or ``gwt-x.x.x.zip`` if you used the ``-Dgwt.version=x.x.x`` command-line option for your build) in the ``dist`` folder. |
|
| 14 | + |
|
| 15 | +Since for a Maven build with the patched version you'll also need a fork of the ``gwt-maven-plugin`` you will also have to fork the [https://github.com/gwtproject/tools/](https://github.com/gwtproject/tools/) repository, adjust the GWT version it uses in the top-level ``pom.xml`` file, adjust the version it builds and comment the dependency on ``gwt-servlet`` and ``requestfactory``. For an example of such a fork see [https://github.com/axeluhl/gwt-maven-plugin/tree/2.11.0](https://github.com/axeluhl/gwt-maven-plugin/tree/2.11.0). |
|
| 16 | + |
|
| 17 | +## Using the ``configuration/install-gwt`` Script to Build and Deploy Forked GWT |
|
| 18 | + |
|
| 19 | +Adjust the ``GWT_VERSION`` variable in ``configuration/install-gwt`` as well as the repository and branch specifiers at the top of the file, telling the script which repositories / forks to use; then invoke with your local GIT root folder as the first parameter, and optionally as a second parameter a folder where you want the resulting GWT distribution placed as a ZIP file named ``gwt-x.x.x.zip`` with ``x.x.x`` being the version number you specified in ``GWT_VERSION``. For example: |
|
| 20 | + |
|
| 21 | +``` |
|
| 22 | + ./configuration/install-gwt /home/me/git-sail /tmp |
|
| 23 | +``` |
|
| 24 | + |
|
| 25 | +This will create a new, unique temporary folder, clone the GWT fork, the GWT tools, ``gwt-maven-plugin`` fork there, then build the forked GWT version, resulting in a ZIP file named after the version you specified in the ``GWT_VERSION`` variable before. If you specified a folder for this ZIP file as a second parameter, the ZIP file will be copied to that location. The script will then unpack the distribution ZIP file in a temporary folder and copy the JAR files necessary to your GIT workspace into the OSGi GWT wrapper bundles' ``lib/`` folders. It then installs these JAR files as Maven artifacts into your local Maven repository (usually at ``~/.m2/repository``). The POM files necessary for this step are taken from ``configuration/gwt-poms/*-${GWT_VERSION}``, so you have to make sure that those files exist, e.g., by copying them from other versions already available in that folder and only adjusting the version number. |
|
| 26 | + |
|
| 27 | +Next, the script builds and installs the ``gwt-maven-plugin`` artifact. |
|
| 28 | + |
|
| 29 | +You can then use the ``gwt-x.x.x.zip`` file from the folder you specified to install it as your GWT version of choice in your Eclipse installation (Preferences / GWT / GWT Settings). Refresh your Eclipse workspace to make the IDE recognize the changes in the ``lib/`` folders of the GWT wrapper bundles. Then you need to adjust the ``Bundle-Version:`` line in the ``com.google.gwt.[dev|servlet|user]`` wrapper bundles to your ``GWT_VERSION`` of choice. Furthermore, adjust the ``gwt.version`` property in ``java/pom.xml`` to match the ``GWT_VERSION`` you specified. The latter is relevant for the Maven build to work. |
|
| 30 | + |
|
| 31 | +## Building the Product with the GWT Fork |
|
| 32 | + |
|
| 33 | +The ``configuration/buildAndUpdateProduct.sh`` script combines all build steps necessary to build our product, with or without test execution, with or without the Gradle build for our mobile Android apps, and at its core with a Maven build that together with the Maven Tycho plugin builds our OSGi product as its main outcome. The Maven build uses the ``gwt-maven-plugin`` for all GWT compilations. Furthermore, we provide GWT to the OSGi environment through three wrapper bundles: ``com.google.gwt.[dev|servlet|user]``, each containing one or more of the GWT JARs found in the GWT distribution (``gwt-dev.jar``, ``gwt-servlet.jar``, ``gwt-servlet-deps.jar``, and ``gwt-user.jar``). Their OSGI manifests (``META-INF/MANIFEST.MF``) contain the GWT version number as their bundle version, as well as the list of packages to export. As explained above, you can install your forked GWT version into your workspace. The ``configuration/install-gwt`` script helps you with the production and distribution of the GWT artifacts into your local workspace, and it installs the necessary artifacts into your local Maven repository, enabling a local Maven-based product build. |
|
| 34 | + |
|
| 35 | +The ``configuration/install-gwt`` script may be included in the ``configuration/buildAndUpdateProduct.sh`` script, especially when a forked GWT version is to be used on that branch for building the product in our central CI. |
|
| 36 | + |
|
| 37 | +The Maven build will then use the forked ``gwt-maven-plugin`` which has been built with the forked GWT version. It builds the wrapper bundles that have been updated with the forked GWT's JARs and probably a changed version number in the bundle manifest. As a result you will obtain a product that is consistent with the forked GWT version. |
|
| 38 | + |
|
| 39 | +## Running with the GWT Fork |
|
| 40 | + |
|
| 41 | +Should the GWT fork require additional parameters, such as, e.g., the specification of a ``-Dgwt.rpc.version`` system property when launching a VM, then these parameters must be specified in three kinds of locations: |
|
| 42 | + |
|
| 43 | +- in the ``parameters.common`` property in the ``java/pom.xml`` file |
|
| 44 | +- in all launch configurations that you use to launch a server environment locally (e.g., ``SailingServer (No Proxy)``) |
|
| 45 | +- in the ``COMMON_JAVA_ARGS`` parameter in the ``java/target/start`` script |
|
| 46 | + |
|
| 47 | +When running locally, from your Eclipse environment, again make sure to have the correct GWT version selected in your Preferences / GWT / GWT Settings tab. If you're launching a server environment using the ``java/target/start`` script as deployed in a typical server instance directory, you don't need to worry because the ``start`` script is a copy of the ``java/target/start`` script you modified in the step above. |
|
| 48 | + |
|
| 49 | +## The ``gwt-2.11.0.zip`` Release Candidate for bug5077 |
|
| 50 | + |
|
| 51 | +There is a pull request pending that contributes an improved RPC serialization protocol implementation which allows the server to stream the response payload instead of producing it entirely and multiply in memory before sending it out. See [https://github.com/gwtproject/gwt/pull/9779](https://github.com/gwtproject/gwt/pull/9779). This pull request allows us to build a special proxy for large payloads constructed from server-side data where the proxy has its own custom field serializer which constructs all data required for DTO construction from the server-side objects on the fly and writes them to the stream as primitive values (int, double, ...) instead of objects. This has vast benefits for memory consumption on the server side. See also the discussion on [bug5077](https://bugzilla.sapsailing.com/bugzilla/show_bug.cgi?id=5077) and at the [GWT issue 7987](https://github.com/gwtproject/gwt/issues/7987). |
|
| 52 | + |
|
| 53 | +The Github fork [https://github.com/axeluhl/gwt/tree/issue-7987-compatibility](https://github.com/axeluhl/gwt/tree/issue-7987-compatibility) holds the branch to be pulled. It is the basis for the ``configuration/install-gwt`` script to build the GWT artifacts. With branch ``bug5077`` the ``configuration/buildAndUpdateProduct.sh`` script is now using the ``configuration/install-gwt`` script. To work with this branch (and with the ``master`` branch going forward, once ``bug5077`` has been merged to ``master``) developers have to obtain the GWT installation ZIP for the fork. We make the latest copy available [here](https://static.sapsailing.com/gwt-2.11.0.zip). |
|
| 54 | + |
|
| 55 | +With branch ``bug5077`` the [on-boarding document](/wiki/howto/onboarding) has been adjusted accordingly regarding where to get a GWT copy from. |
|
| ... | ... | \ No newline at end of file |
wiki/howto/onboarding.md
| ... | ... | @@ -52,13 +52,15 @@ First of all, make sure you've looked at [http://www.amazon.de/Patterns-Elements |
| 52 | 52 | 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 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) |
| 53 | 53 | 8. Maven 3.1.1 (or higher), [http://maven.apache.org](http://maven.apache.org) |
| 54 | 54 | 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) |
| 55 | -9. GWT SDK 2.10.0 ([http://www.gwtproject.org/download.html](http://www.gwtproject.org/download.html)) |
|
| 56 | - Download the gwt sdk and extract it to a location of your preference (e.g. windows `C:\Program Files\gwt`) |
|
| 55 | +9. Forked GWT SDK 2.11.0 release candidate ([https://static.sapsailing.com/gwt-2.11.0.zip](https://static.sapsailing.com/gwt-2.11.0.zip)). The official releases can be found at [http://www.gwtproject.org/download.html](http://www.gwtproject.org/download.html) |
|
| 56 | + but shouldn't be used unless we roll back the changes of branch ``bug5077`` or GWT has merged and released the [pull request 9779](https://github.com/gwtproject/gwt/pull/9779). |
|
| 57 | + Download the GWT DSK and extract it to a location of your preference (e.g. `C:\Program Files\gwt` on Windows or `/opt/gwt` on Linux or MacOS/X). |
|
| 58 | + You will see in section [Tuning the Eclipse Installation](#onboarding-information_sap-sailing-analytics-development-setup_tuning-the-eclipse-installation) |
|
| 59 | + below how you announce this GWT SDK to your Eclipse installation. |
|
| 57 | 60 | 10. 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/)). |
| 58 | 61 | Make sure that the environment variable `ANDROID_HOME` is set (e.g. Windows C:\Users\\**'user'**\AppData\Local\Android\Sdk ) |
| 59 | 62 | 11. Get the content of the git repository |
| 60 | 63 | 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. |
| 61 | - |
|
| 62 | 64 | 12. Install the eclipse plugins (see [Automatic Eclipse plugin installation](#onboarding-information_sap-sailing-analytics-development-setup_automatic-eclipse-plugin-installation)) |
| 63 | 65 | 12. Configure Eclipse (see [Tuning the Eclipse Installation](#onboarding-information_sap-sailing-analytics-development-setup_tuning-the-eclipse-installation)) |
| 64 | 66 | 13. Configure Maven to use the correct JRE by following the instructions in the paragraph [maven-setup](#onboarding-information_sap-sailing-analytics-development-setup_maven-setup) |
| ... | ... | @@ -111,7 +113,7 @@ Out of the box, multiple settings in Eclipse need to be changed. Go to Window |
| 111 | 113 | - In "General ⇒ Editors ⇒ Text Editors" check Insert Spaces for Tabs |
| 112 | 114 | - In "General ⇒ Editors ⇒ Text Editors ⇒ Quick Diff" change the reference source from 'Version on Disk' to 'A Git Revision'. If you like other colours for marking diffs change them here. (Example: Changes = Yellow, Additions = Green, Deletions = Red) |
| 113 | 115 | - In "GWT ⇒ Errors/Warnings" set "Missing SDK" to "Ignore" |
| 114 | -- In "GWT ⇒ GWT Settings ⇒ Add..." add the GWT SDK |
|
| 116 | +- In "GWT ⇒ GWT Settings ⇒ Add..." add the GWT SDK you downloaded and unpacked earlier |
|
| 115 | 117 | - In "Java ⇒ Build Path ⇒ Classpath Variables" 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`. |
| 116 | 118 | - In "Java ⇒ Code Style ⇒ Formatter" import the CodeFormatter.xml from $GIT_HOME/java |
| 117 | 119 | - In "Java ⇒ Compiler" set the Compiler compliance level to 1.8 |