Import Jack server 1.3-a8

Jack server version: 272501 5814c947fa240bddad237d79867991bbe37239c8

Bug: 26259965
Bug: 26449554
Bug: 26457457
Bug: 26457559
Bug: 26667689
Bug: 27037960
Bug: 27222770
Bug: 27262541
Bug: 27374393
Bug: 27665998

Change-Id: Ic965e76f4ee69a125509c3ffc40330ab3e401849
diff --git a/tools/README-jack-server.txt b/tools/README-jack-server.txt
index 00e10d5..3f86700 100644
--- a/tools/README-jack-server.txt
+++ b/tools/README-jack-server.txt
@@ -1,194 +1,217 @@
-###########
+This documentation describes usage of Jack server 1.3-a8.
+
 Jack server
-###########
+===========
 
-The Jack server's goal is to handle a pool of Jack compiler instances in order to limit memory usage
-and benefit from already warm instances.
-
-
+The Jack server's goal is to handle a pool of Jack compiler instances in
+order to limit memory usage and benefit from already warm instances.
 
 Setup for Mac OS
 ----------------
 
-Jack server is automatically installed and started by android build but requires initial setup on
-Mac OS:
+Jack server is automatically installed and started by android build but
+requires initial setup on Mac OS:
 
-  - Install MacPorts from http://www.macports.org/install.php
-    Make sure that /opt/local/bin appears in your path before /usr/bin. If not, please add the
-    following to your ~/.bash_profile file (If you do not have a .bash_profile file in your home
-    directory, create one):
-      export PATH=/opt/local/bin:$PATH
+-   Install MacPorts from macports.org  
+     Make sure that /opt/local/bin appears in your path before /usr/bin.
+    If not, please add the following to your ~/.bash_profile file (If
+    you do not have a .bash_profile file in your home directory, create
+    one):
 
-  - Get curl package from MacPorts:
-      $ POSIXLY_CORRECT=1 sudo port install curl +ssl
+            export PATH=/opt/local/bin:$PATH`
 
+-   Get curl package from MacPorts:
 
+            $ POSIXLY_CORRECT=1 sudo port install curl +ssl
 
 Starting the server
 -------------------
 
-You may need to start the Jack server manually.
-Use "jack-admin start-server".
-
-
+You may need to start the Jack server manually.  
+Use jack-admin start-server.
 
 Client info
 -----------
 
-The client is a bash script simply named "jack".
-It can be configured in "$HOME/.jack-settings"
+The client is a bash script simply named jack.  
+It can be configured in $HOME/.jack-settings
 
+.jack-settings file
 
+This file contains script shell variables:  
+SERVER_HOST: IP address of the server  
+by default: SERVER_HOST=127.0.0.1.
 
-".jack-settings" file
----------------------
+SERVER_PORT_SERVICE: Server service TCP port number. Needs to match the
+service port number defined in $HOME/.jack-server/config.properties on
+the server host (See Server info below)  
+by default: SERVER_PORT_SERVICE=8076.
 
-This file contains script shell variables:
-"SERVER_HOST": IP address of the server
-by default: "SERVER_HOST=127.0.0.1".
+SERVER_PORT_ADMIN: Server admin TCP port number. Needs to match the
+admin port number defined in $HOME/.jack-server/config.properties on the
+server host (See Server info below)  
+by default: SERVER_PORT_ADMIN=8077.
 
-"SERVER_PORT_SERVICE": Server service TCP port number. Needs to match the service port number
-defined in "$HOME/.jack-server/config.properties" on the server host (See "Server info" below)
-by default: "SERVER_PORT_SERVICE=8076".
-
-"SERVER_PORT_ADMIN": Server admin TCP port number. Needs to match the admin port number defined in
-"$HOME/.jack-server/config.properties" on the server host (See "Server info" below)
-by default: "SERVER_PORT_ADMIN=8077".
-
-"SETTING_VERSION": Internal, do not modify.
-
-
+SETTING_VERSION: Internal, do not modify.
 
 Server info
 -----------
 
-The server is composed of 2 jars named "jack-server.jar" and "jack-launcher.jar".
+The server is composed of 2 jars named jack-server.jar and
+jack-launcher.jar.
 
-Check "Admin" section to know how to install and administrate the Jack server.
+Check Admin section to know how to install and administrate the Jack
+server.
 
-The server can also be configured in "$HOME/.jack-server/config.properties".
+The server can also be configured in
+$HOME/.jack-server/config.properties.
 
+config.properties file
 
-
-"config.properties" file
-------------------------
-
-It contains Jack server configuration properties.
+It contains Jack server configuration properties.  
 Description with default values follows:
 
-jack.server.max-service=<number>
-  Maximum number of simultaneous Jack tasks. Default is 4.
+jack.server.max-service=<number>  
+ Maximum number of simultaneous Jack tasks. Default is 4.
 
-jack.server.max-jars-size=<size-in-bytes>
-  Maximum size for Jars, in bytes. "-1" means no limit. Default is 100 MiB.
+jack.server.max-jars-size=<size-in-bytes>  
+ Maximum size for Jars, in bytes. -1 means no limit. Default is 100 MiB.
 
-jack.server.time-out=<time-in-seconds>
-  Time out delay before Jack gets to sleep. When Jack sleeps, its memory usage is reduced, but it is
-  slower to wake up. "-1" means "do not sleep". Default is 2 weeks.
+jack.server.time-out=<time-in-seconds>  
+ Time out delay before Jack gets to sleep. When Jack sleeps, its memory
+usage is reduced, but it is slower to wake up. -1 means "do not sleep".
+Default is 2 weeks.
 
-jack.server.service.port=<port-number>
-  Server service TCP port number. Default is 8076. Needs to match the service port defined in
-  "$HOME/.jack-settings" on the client host (See Client section).
+jack.server.service.port=<port-number>  
+ Server service TCP port number. Default is 8076. Needs to match the
+service port defined in $HOME/.jack-settings on the client host (See
+Client section).
 
-jack.server.admin.port=<port-number>
-  Server admin TCP port number. Default is 8077. Needs to match the service port defined in
-  "$HOME/.jack-settings" on the client host (See Client section).
+jack.server.admin.port=<port-number>  
+ Server admin TCP port number. Default is 8077. Needs to match the
+service port defined in $HOME/.jack-settings on the client host (See
+Client section).
 
-jack.server.config.version=<version>
-  Internal, do not modify.
-
-
+jack.server.config.version=<version>  
+ Internal, do not modify.
 
 Server logs
------------
 
-Server logs can be found by running "jack-admin server-log". Default location is
-"$HOME/.jack-server/logs/".
-
-
+Server logs can be found by running jack-admin server-log. Default
+location is $HOME/.jack-server/logs/.
 
 Admin
 -----
 
-The "jack-admin" bash script allows to install and administrate the Jack server.
-Here are some commands:
+The jack-admin bash script allows to install and administrate the Jack
+server. Here are some commands:
 
-$ jack-admin help
+$ jack-admin help  
 Print help.
 
-$ jack-admin install-server jack-launcher.jar jack-server.jar
+$ jack-admin install-server jack-launcher.jar jack-server.jar  
 Install the Jack server.
 
-$ jack-admin uninstall-server
+$ jack-admin uninstall-server  
 Uninstall the Jack server and all components.
 
-$ jack-admin list jack
+$ jack-admin list jack  
 List installed versions for Jack.
 
-$ jack-admin update jack jack.jar
+$ jack-admin update jack jack.jar  
 Install or update a Jack jar.
 
-$ jack-admin start-server
+$ jack-admin start-server  
 Start the server.
 
-$ jack-admin stop-server
+$ jack-admin stop-server  
 Stop the server after the last compilation is complete.
 
-$ jack-admin kill-server
-Kill the server process immediately, interrupting abruptly ongoing compilations.
+$ jack-admin kill-server  
+Kill the server process immediately, interrupting abruptly ongoing
+compilations.
 
-$ jack-admin list-server
+$ jack-admin list-server  
 List Jack server processes.
 
-$ jack-admin server-stat
+$ jack-admin server-stat  
 Print various info about the server and the host.
 
-$ jack-admin server-log
+$ jack-admin server-log  
 Print log pattern.
 
-$ jack-admin dump-report
+$ jack-admin dump-report  
 Produce a report file that can be used to file a bug.
 
+Transitioning from server 1.1 (e.g. Marshmallow) to server 1.3 (e.g. N)
+-----------------------------------------------------------------------
+
+The old Jack server used a $HOME/.jack configuration file. It has now
+replaced by a $HOME/.jack-settings and a
+$HOME/.jack-server/config.properties. If those new files do not exist,
+run jack-admin start-server and they will be created. If you had custom
+settings in your $HOME/.jack, here's how to adapt those.
+
+SERVER_PORT_SERVICE=XXXX  
+Replace with SERVER_PORT_SERVICE=XXXX in $HOME/.jack-settings and
+jack.server.service.port=XXXX in $HOME/.jack-server/config.properties.
+
+SERVER_PORT_ADMIN=YYYY  
+Replace with SERVER_PORT_ADMIN=YYYY in $HOME/.jack-settings and
+jack.server.admin.port=YYYY in $HOME/.jack-server/config.properties.
+
+SERVER_NB_COMPILE=N  
+Replace with jack.server.max-service=N in
+$HOME/.jack-server/config.properties.
+
+SERVER_TIMEOUT=ZZ  
+You can replace with jack.server.time-out=ZZ, but it is recommended to
+keep the default setting of "7200" (2 hours).
+
+Other settings in the $HOME/.jack configuration file do not need to be
+copied. You should still keep your $HOME/.jack configuration file for
+the old Jack server because both server versions can run simultaneously.
 
 Troubleshooting
 ---------------
 
-Below you'll find some ways to solve some troubleshooting. If you don't find a solution, file a
-bug and attach the file produced by "jack-admin dump-report".
+Below you'll find some ways to solve some troubleshooting. If you don't
+find a solution, file a bug and attach the file produced by
+jack-admin dump-report.
 
+If compilation fails on No Jack server running
 
-If compilation fails on "No Jack server running":
-
-See "Starting the server" above.
-
+See Starting the server above.
 
 If your computer becomes unresponsive during compilation or if you experience Jack compilations
-failing on "Out of memory error.":
 
-You can improve the situation by reducing the number of jack simultaneous compilations by editing
-your "$HOME/.jack-server/config.properties" and changing jack.server.max-service to a lower value.
+failing on Out of memory error.:
 
+You can improve the situation by reducing the number of jack
+simultaneous compilations by editing your
+$HOME/.jack-server/config.properties and changing
+jack.server.max-service to a lower value.
 
-If you have trouble starting the server:
+If you have trouble starting the server
 
-This may mean that TCP ports are already in use on your computer. You can try modifying the ports
-both in your client and server configurations. See the "Server info" and "Client info" sections.
-If it doesn't solve the problem, please report and give us additional information by:
-  - Attaching your compilation log.
-  - Attaching the file produced by "jack-admin dump-report"
-
+This may mean that TCP ports are already in use on your computer. You
+can try modifying the ports both in your client and server
+configurations. See the Server info and Client info sections. If it
+doesn't solve the problem, please report and give us additional
+information by:  
+ - Attaching your compilation log.  
+ - Attaching the file produced by jack-admin dump-report
 
 If your commands fails on
-"Failed to contact Jack server: Problem reading <your home>/.jack-server/client.pem":
 
-This may mean that your server never managed to start, see
-"If you have trouble starting the server" above.
+Failed to contact Jack server: Problem reading<your home>/.jack-server/client.pem
 
+This may mean that your server never managed to start, see If you have
+trouble starting the server above.
 
-If your compilation gets stuck without any progress:
+If your compilation gets stuck without any progress
 
-Please report and give us additional information by:
-  - Attaching the file produced by "jack-admin dump-report"
-  - Restart the server by issuing commands "jack-admin kill-server; jack-admin start-server"
-
- 
+Please report and give us additional information by attaching the file
+produced by jack-admin dump-report.  
+Then restart the server by issuing commands
+jack-admin kill-server; jack-admin start-server