Merge "Remove jack-related modules"
diff --git a/tools/Android.mk b/tools/Android.mk
index 274f2f7..10e2453 100644
--- a/tools/Android.mk
+++ b/tools/Android.mk
@@ -19,59 +19,6 @@
##################################
include $(CLEAR_VARS)
-LOCAL_MODULE := jack-admin
-LOCAL_SRC_FILES := jack-admin
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_SUFFIX := $(HOST_EXECUTABLE_SUFFIX)
-LOCAL_BUILT_MODULE_STEM := jack-admin$(HOST_EXECUTABLE_SUFFIX)
-LOCAL_IS_HOST_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-##################################
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := jack-diagnose
-LOCAL_SRC_FILES := jack-diagnose
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_SUFFIX := $(HOST_EXECUTABLE_SUFFIX)
-LOCAL_BUILT_MODULE_STEM := jack-diagnose$(HOST_EXECUTABLE_SUFFIX)
-LOCAL_IS_HOST_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-##################################
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := jack
-LOCAL_SRC_FILES := jack
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_SUFFIX := $(HOST_EXECUTABLE_SUFFIX)
-LOCAL_BUILT_MODULE_STEM := jack$(HOST_EXECUTABLE_SUFFIX)
-LOCAL_IS_HOST_MODULE := true
-LOCAL_REQUIRED_MODULES := jack-admin jack-diagnose
-
-include $(BUILD_PREBUILT)
-
-##################################
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := jack-coverage-plugin
-LOCAL_SRC_FILES := jack-coverage-plugin.jar
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-MOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_SUFFIX := $(COMMON_JAVA_PACKAGE_SUFFIX)
-LOCAL_BUILT_MODULE_STEM := jack-coverage-plugin$(COMMON_JAVA_PACKAGE_SUFFIX)
-LOCAL_IS_HOST_MODULE := true
-
-include $(BUILD_PREBUILT)
-
-##################################
-include $(CLEAR_VARS)
-
LOCAL_MODULE := jack-jacoco-reporter
LOCAL_SRC_FILES := jack-jacoco-reporter.jar
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
diff --git a/tools/OWNERS b/tools/OWNERS
index b4ab537..0207076 100644
--- a/tools/OWNERS
+++ b/tools/OWNERS
@@ -1,11 +1,5 @@
-per-file *jack* = benoitlamarche@google.com
-per-file *jack* = jplesot@google.com
-
-per-file *jill* = benoitlamarche@google.com
-per-file *jill* = jplesot@google.com
-
-benoitlamarche@google.com # jack/jill
-jplesot@google.com # jack/jill
klyubin@google.com # signapk
srhines@google.com # LLVM
yroussel@google.com # MultiDex
+dwillemsen@google.com # Build tools
+ccross@google.com # Build tools
diff --git a/tools/README-jack-code-coverage.md b/tools/README-jack-code-coverage.md
deleted file mode 100644
index d1be035..0000000
--- a/tools/README-jack-code-coverage.md
+++ /dev/null
@@ -1,123 +0,0 @@
-# Code coverage with Jack
-
-Jack supports code coverage with `JaCoCo` (http://eclemma.org/jacoco). During the compilation,
-it will instrument code using JaCoCo API. Therefore, it requires a dependency to a jacoco-agent.jar
-that can be imported in the DEX output. Jack supports Jacoco v0.7.5 (see directory external/jacoco
-in the Android source tree).
-
-Besides, Jack will also produce a coverage metadata file (or description file) in a JSON format.
-It will be used to generate the report so we can match coverage execution file with source code.
-
-Starting with the Jack Douarn release (4.x), the code coverage is provided with the Jack plugin
-`jack-coverage-plugin.jar`.
-
-## Enabling code coverage with Jack
-
-### Using the Android build system
-
-You can enable code coverage by setting `EMMA_INSTRUMENT_STATIC=true` in your make command. The build
-system will compile it with Jack by enabling code coverage and importing the `jacoco-agent.jar`
-defined in external/jacoco. It will produce the metadata file in the 'intermediates' directory of
-the app.
-
-For instance, to instrument the Settings app:
-
- EMMA_INSTRUMENT_STATIC=true mmma -j32 packages/apps/Settings
-
-The medatafile is located in `$ANDROID_BUILD_TOP/out/target/common/obj/APPS/Settings_intermediates/coverage.em`
-
-Once the application is instrumented, you can install it and execute it to produce code coverage
-execution file.
-
-You can define class name filters to select which classes will be instrumented (all classes are
-instrumented by default) by defining the following build variables:
-* `LOCAL_JACK_COVERAGE_INCLUDE_FILTER`: a comma-separated list of class names to include
-* `LOCAL_JACK_COVERAGE_EXCLUDE_FILTER`: a comma-separated list of class names to exclude
-These filters will be passed on the Jack command-line (see below) only when code coverage is
-enabled.
-
-### Using Jack command-line
-
-To enable code coverage with Jack command-line, pass the following command-line options:
-
-```
---pluginpath <code_coverage_plugin_jar>
---plugin com.android.jack.coverage.CodeCoverage
--D jack.coverage=true
--D jack.coverage.metadata.file=<coverage_metadata_file_path>
--D jack.coverage.jacoco.package=<jacoco_internal_package_name>
-```
-
-where
-* `<code_coverage_plugin_jar>` is the path to the plugin jar file. In the Android tree, it is
- located in the `prebuilts/sdk/tools` directory.
-* `<coverage_metadata_file_path>` is a *mandatory* property that indicates the path of the file that
- will contain coverage information. This file must be passed to reporting tool to generate the
- report (see section Generating the report below)
-* `<jacoco_internal_package_name>` is an *optional* property that indicates the fully qualified name
- of the internal package name containing the class 'Offline' in the associated jacoco-agent.jar
- file. This package name is different for each release of JaCoCo library. If this property is not
- provided, Jack will automatically look for a Jacoco package which starts with
- `org.jacoco.agent.rt.internal`.
-
-Note: because Jack's code coverage support is based on Jacoco, it is mandatory that Jacoco classes
-are available at compilation time. They can be either on the classpath (--classpath) or imported
-as a static library in the output (--import).
-
-Jack also supports optional include and exclude class filtering based on class name:
-
-```
--D jack.coverage.jacoco.include=<includes>
--D jack.coverage.jacoco.exclude=<excludes>
-```
-
-where
-* `<includes>` is a comma-separated list of fully-qualified class names to include
-* `<excludes>` is a comma-separated list of fully-qualified class names to exclude
-
-Wildcards characters '?' and '*' are accepted to replace respectively one character or multiple
-characters.
-
-You can find the full command-line usage with
-
- java -jar <jack_jar> --help
-
-You can also find the description of all properties (including those for code coverage) with
-
- java -jar <jack_jar> --pluginpath <code_coverage_plugin_jar> --plugin com.android.jack.coverage.CodeCoverage --help-properties
-
-## Collecting code coverage
-
-To produce coverage execution data, instrumented classes must be executed and coverage data be
-dumped in a coverage execution file. For Android instrumentation tests, the frameworks can do
-so automatically:
-
- adb shell am instrument -w -e coverage true <package_name>/<instrumentation_class_name>
-
-For the case of the Settings app tests:
-
- adb shell am instrument -w -e coverage true com.android.settings.tests/android.test.InstrumentationTestRunner
-
-Once the tests are finished, the location of the coverage execution file should be printed in the
-console.
-
-## Generating the report
-
-A coverage report can be generated using the `jack-jacoco-reporter.jar` file. This is a command-line
-tool taking at least three inputs:
-
-* the coverage metadata file(s) produced by Jack
-* the coverage execution file(s) produced during execution
-* an existing directory where the report is generated
-
-It is also recommended to indicate the directories containing the source code of classes being
-analyzed to link coverage information with the source code.
-
-The command then looks like:
-
- java -jar jack-jacoco-reporter.jar --metadata-file <metadata_file> --coverage-file <execution_file> --report-dir <report_directory> --source-dir <source_dir_1> ... --source-dir <source_dir_N>
-
-You can find the full command-line usage with
-
- java -jar jack-jacoco-reporter.jar --help
-
diff --git a/tools/README-jack-server.md b/tools/README-jack-server.md
deleted file mode 100644
index 1f8ad35..0000000
--- a/tools/README-jack-server.md
+++ /dev/null
@@ -1,238 +0,0 @@
-This documentation describes usage of Jack server 1.3-a11.
-
-# 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.
-
-
-
-## Setup for Mac OS
-
-Jack server requires initial setup on Mac OS:
-
- - Install MacPorts from [macports.org](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`
-```
-
- - Get curl package from MacPorts:
-```
- $ POSIXLY_CORRECT=1 sudo port install curl +ssl
-```
-
-## Installing the server
-
-Jack server is automatically installed and started by Android build. If you need to do the
-installation manually use:
-```
- $ jack-admin install-server <launcher.jar> <server.jar>
-```
-
-
-## Starting the 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`
-
-
-
-### `.jack-settings` file
-
-This file contains script shell variables:
-`SERVER_HOST`: IP address of the server
-by default: `SERVER_HOST=localhost`.
-
-`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.
-
-
-
-## Server info
-
-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.
-
-The server can also be configured in `$HOME/.jack-server/config.properties`.
-
-
-
-### `config.properties` file
-
-It contains Jack server configuration properties.
-Modifications to those settings are taken into account after restarting the server.
-Description with default values follows:
-
-`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.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.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.
-
-
-
-### 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:
-
-`$ jack-admin help`
-Print help.
-
-`$ jack-admin install-server jack-launcher.jar jack-server.jar`
-Install the Jack server.
-
-`$ jack-admin uninstall-server`
-Uninstall the Jack server and all components. You should ensure that the Jack server
-is not running before uninstalling.
-
-`$ jack-admin list jack`
-List installed versions for Jack.
-
-`$ jack-admin update jack jack.jar`
-Install or update a Jack jar.
-
-`$ jack-admin start-server`
-Start the 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 list-server`
-List Jack server processes.
-
-`$ jack-admin server-stat`
-Print various info about the server and the host.
-
-`$ jack-admin server-log`
-Print log pattern.
-
-`$ 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`.
-
-
-### If compilation fails on `No Jack server running`
-
-See [Starting the server](#starting-the-server) above.
-
-
-### If your computer becomes unresponsive during compilation:
-
-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
-and then restarting the server.
-
-### 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
-and then restarting the server.
-If this is not enough, you may change the arguments used to start the server jvm and force a
-greater maximum Java heap size ("-Xmx"):
-- Stop the server using `jack-admin stop-server`, then:
-- If you start the server manually:
-`JACK_SERVER_VM_ARGUMENTS="-Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation" jack-admin start-server`
-- If you use the jack server in the android tree then
-`export ANDROID_JACK_VM_ARGS="-Xmx2g -Dfile.encoding=UTF-8 -XX:+TieredCompilation"`
-and restart your build command.
-
-
-### 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`
-
-
-### 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](#if-you-have-trouble-starting-the-server) above.
-
-
-### 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`.
-Then restart the server by issuing commands `jack-admin kill-server; jack-admin start-server`
-
diff --git a/tools/jack b/tools/jack
deleted file mode 100755
index 6705df6..0000000
--- a/tools/jack
+++ /dev/null
@@ -1,209 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Version: 1.3-eng
-#
-set -o nounset
-umask 077
-
-#
-# Settings
-#
-JACK_VERSION=${JACK_VERSION:=4.32.CANDIDATE}
-JACK_HOME="${JACK_HOME:=$HOME/.jack-server}"
-JACK_CLIENT_SETTING="${JACK_CLIENT_SETTING:=$HOME/.jack-settings}"
-TMPDIR=${TMPDIR:=/tmp}
-# This is half the timeout since the script will make a second attempt collecting debugs when
-# the first attempt fails on connection timeout
-JACK_CONNECTION_TIMEOUT=150
-JACK_EXTRA_CURL_OPTIONS=${JACK_EXTRA_CURL_OPTIONS:=}
-JACK_ASSERTION_ENABLED="${JACK_ASSERTION_ENABLED:=false}"
-
-
-abort () { exit 255; }
-
-
-#
-# Load client settings
-#
-if [ -f "$JACK_CLIENT_SETTING" ]; then
- source "$JACK_CLIENT_SETTING"
-else
- echo "Cannot find settings at '$JACK_CLIENT_SETTING'" >&2
- abort
-fi
-
-
-JACK_SERVER=${JACK_SERVER:=true}
-JACK_MAIN_COMMAND=${JACK_MAIN_COMMAND:="java -Djava.io.tmpdir=$TMPDIR -Dfile.encoding=UTF-8 -XX:+TieredCompilation"}
-JACK_REPOSITORY=${JACK_REPOSITORY:=}
-
-
-#
-# If not in server mode, exec jack
-#
-if [ "$JACK_SERVER" != "true" ]; then
- if [ -z "$JACK_REPOSITORY" ]; then
- echo "Running Jack without Jack server requires definition of JACK_REPOSITORY" >&2
- abort
- fi
- JACK_JAR=$JACK_REPOSITORY/jack-$JACK_VERSION.jar
- if [ ! -r "$JACK_JAR" ]; then
- echo "Jack jar \"$JACK_JAR\" is not readable" >&2
- abort
- fi
-
-
- exec $JACK_MAIN_COMMAND -jar $JACK_JAR "$@"
- echo "Cannot succeed to launch Jack without Jack server" >&2
- abort
-fi
-
-
-#
-# Prepare compilation
-#
-JACK_PWD="$PWD"
-JACK_EXIT="$TMPDIR/jack-task-$USER-$$-exit"
-
-# Cleanup
-trap 'rm -f "$JACK_EXIT" 2>/dev/null;' EXIT
-
-set -o errexit
-
-# Check that we can create temp file for exit status
-rm -rf "$JACK_EXIT"
-echo "" > "$JACK_EXIT"
-
-#
-# Launch the compilation
-#
-
-set +o errexit
-trap ERR
-
-# put arguments in a non array variable
-ARGS=""
-for i in "$@"; do
- ARGS="$ARGS $i"
-done
-
-
-CURRENT_CHARSET=$(locale charmap)
-if [ -z "$CURRENT_CHARSET" ]; then
- CHARSET_ARGUMENT=
-else
- CHARSET_ARGUMENT=";charset=$CURRENT_CHARSET"
-fi
-
-# Check base64 availability
-BASE64_CHECK=$((echo amFjaw==;echo LXNlcnZlcg==) | base64 --decode 2>&1)
-
-sendRequest() {
-RETRY_OPTION=$1
-shift
-
-# Launch compilation
-exec 3>&1
-exec 4>&2
-if [ "$BASE64_CHECK" = jack-server ]; then
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS $RETRY_OPTION \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output >(tee >(sed -n -e 's/^E|\(.*\)$/\1/p' | base64 --decode >&4 ) | tee >(sed -n -e 's/^X|\(.*\)$/\1/p' >>$JACK_EXIT) | sed -n -e 's/^O|\(.*\)$/\1/p' | base64 --decode >&3) \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X POST \
- -H "Accept: application/vnd.jack.command-out-base64;version=1$CHARSET_ARGUMENT" \
- -F "cli=$ARGS;type=text/plain$CHARSET_ARGUMENT" \
- -F "version=$JACK_VERSION;type=application/vnd.jack.select-exact;version=1" \
- -F "pwd=$JACK_PWD;type=text/plain$CHARSET_ARGUMENT" \
- -F "assert=$JACK_ASSERTION_ENABLED;type=text/plain$CHARSET_ARGUMENT" \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_SERVICE/jack \
- )
-else
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS $RETRY_OPTION \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output >(tee >(sed -n -e 's/^E|\(.*\)$/\1/p' >&4 ) | tee >(sed -n -e 's/^X|\(.*\)$/\1/p' >>$JACK_EXIT) | sed -n -e 's/^O|\(.*\)$/\1/p' >&3) \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X POST \
- -H "Accept: application/vnd.jack.command-out;version=1$CHARSET_ARGUMENT" \
- -F "cli=$ARGS;type=text/plain$CHARSET_ARGUMENT" \
- -F "version=$JACK_VERSION;type=application/vnd.jack.select-exact;version=1" \
- -F "pwd=$JACK_PWD;type=text/plain$CHARSET_ARGUMENT" \
- -F "assert=$JACK_ASSERTION_ENABLED;type=text/plain$CHARSET_ARGUMENT" \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_SERVICE/jack \
- )
-fi
-CURL_CODE=$?
-exec 3>&-
-exec 4>&-
-
-set -o errexit
-
-if [ $CURL_CODE -eq 0 ]; then
- # No problem, let's go
- JACK_CODE=$(cat "$JACK_EXIT")
- exit $JACK_CODE
-elif [ $CURL_CODE -eq 7 ]; then
- # Failed to connect
- echo "No Jack server running. Try 'jack-admin start-server'" >&2
- abort
-elif [ $CURL_CODE -eq 28 ]; then
- if [ "$RETRY_OPTION" == "" ]; then
- echo "Connection to the Jack server timeout, retrying with debug"
- sendRequest -v $@
- else
- echo "Connection to the Jack server timeout" >&2
- abort
- fi
-elif [ $CURL_CODE -eq 35 ]; then
- if [ "$RETRY_OPTION" == "" ]; then
- echo "SSL error when connecting to the Jack server, retrying with debug"
- sendRequest -v $@
- else
- echo "SSL error when connecting to the Jack server. Try 'jack-diagnose'" >&2
- abort
- fi
-elif [ $CURL_CODE -eq 58 ]; then
- echo "Failed to contact Jack server: Problem reading ${JACK_HOME}/client.pem. Try 'jack-diagnose'" >&2
- abort
-elif [ $CURL_CODE -eq 60 ]; then
- echo "Failed to authenticate Jack server certificate. Try 'jack-diagnose'" >&2
- abort
- elif [ $CURL_CODE -eq 77 ]; then
- echo "Failed to contact Jack server: Problem reading ${JACK_HOME}/server.pem. Try 'jack-diagnose'" >&2
- abort
-elif [ $CURL_CODE -eq 22 ]; then
- # Http code not OK, let's decode and abort
- if [ $HTTP_CODE -eq 400 ]; then
- # 400: Bad request
- echo "Bad request, see server log" >&2
- abort
- else
- # Other
- echo "Internal unknown error ($HTTP_CODE), try 'jack-diagnose' or see Jack server log" >&2
- abort
- fi
-else
- echo "Communication error with Jack server ($CURL_CODE). Try 'jack-diagnose'" >&2
- abort
-fi
-}
-
-sendRequest "" $@
diff --git a/tools/jack-admin b/tools/jack-admin
deleted file mode 100755
index f028d27..0000000
--- a/tools/jack-admin
+++ /dev/null
@@ -1,661 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Version: 1.3-a11
-#
-set -o nounset
-BASE_UMASK=$(umask)
-umask 077
-
-#
-# Settings
-#
-JACK_HOME="${JACK_HOME:=$HOME/.jack-server}"
-JACK_CLIENT_SETTING="${JACK_CLIENT_SETTING:=$HOME/.jack-settings}"
-TMPDIR=${TMPDIR:=/tmp}
-JACK_SERVER_VM_ARGUMENTS="${JACK_SERVER_VM_ARGUMENTS:=-Dfile.encoding=UTF-8}"
-JACK_EXTRA_CURL_OPTIONS=${JACK_EXTRA_CURL_OPTIONS:=}
-
-LAUNCHER_JAR="$JACK_HOME/launcher.jar"
-LAUNCHER_NAME=com.android.jack.launcher.ServerLauncher
-CURRENT_CHARSET=$(locale charmap)
-if [ -z "$CURRENT_CHARSET" ]; then
- CHARSET_ARGUMENT=
-else
- CHARSET_ARGUMENT=";charset=$CURRENT_CHARSET"
-fi
-
-JACK_LOGS_DIR="$JACK_HOME"/logs
-JACK_OUT_ERR="$JACK_LOGS_DIR"/outputs.txt
-JACK_CONNECTION_TIMEOUT=300
-
-#
-# Load client settings
-#
-if [ -f "$JACK_CLIENT_SETTING" ]; then
- source "$JACK_CLIENT_SETTING"
-fi
-
-#
-# Create or update client settings if needed
-#
-if [[ ! -f "$JACK_CLIENT_SETTING" || $SETTING_VERSION -lt 4 ]]; then
- echo "Writing client settings in" $JACK_CLIENT_SETTING
- cat >"$JACK_CLIENT_SETTING.$$" <<-EOT
- # Server settings
- SERVER_HOST=${SERVER_HOST:=localhost}
- SERVER_PORT_SERVICE=${SERVER_PORT_SERVICE:=8076}
- SERVER_PORT_ADMIN=${SERVER_PORT_ADMIN:=8077}
-
- # Internal, do not touch
- SETTING_VERSION=4
-EOT
- ln -f "$JACK_CLIENT_SETTING.$$" "$JACK_CLIENT_SETTING"
- rm "$JACK_CLIENT_SETTING.$$"
- source "$JACK_CLIENT_SETTING"
-fi
-
-usage () {
- echo "Usage : $0 [ install-server <launcher.jar> <server.jar> | uninstall-server | list <program> | update <program> <program.jar> | start-server | stop-server | kill-server | list-server | server-stat | server-stat-reset | server-log | server-gc | cleanup-server | dump-report]"
-}
-
-abort () { exit 255; }
-
-#
-# $1: curl command status
-# $2: HTTP status
-#
-handleHttpErrors() {
- if [ $1 -eq 0 ]; then
- # No problem, let's go
- return 0;
- elif [ $1 -eq 7 ]; then
- echo "No Jack server running. Try 'jack-admin start-server'" >&2
- abort
- elif [ $1 -eq 35 ]; then
- echo "SSL error when connecting to the Jack server. Try 'jack-diagnose'" >&2
- abort
- elif [ $1 -eq 58 ]; then
- echo "Failed to contact Jack server: Problem reading ${JACK_HOME}/client.pem. Try 'jack-diagnose'" >&2
- abort
- elif [ $1 -eq 60 ]; then
- echo "Failed to authenticate Jack server certificate. Try 'jack-diagnose'" >&2
- abort
- elif [ $1 -eq 77 ]; then
- echo "Failed to contact Jack server: Problem reading ${JACK_HOME}/server.pem. Try 'jack-diagnose'" >&2
- abort
- elif [ $1 -eq 22 ]; then
- # Http code not OK, let's decode and abort
- if [ $2 -eq 400 ]; then
- # 400: Bad request
- echo "Bad request, see Jack server log" >&2
- abort
- else
- # Other
- echo "Internal unknown error ($2), try 'jack-diagnose' or see Jack server log" >&2
- abort
- fi
- else
- echo "Communication error with Jack server $1. Try 'jack-diagnose'" >&2
- abort
- fi
-}
-
-checkCurlVersion () {
- curl --version | grep -q "SecureTransport"
- if [ "$?" -eq 0 ]; then
- echo "Unsupported curl, please use a curl not based on SecureTransport" >&2
- abort
- fi
-}
-
-#
-# $1: program name
-# $2: jar of the program
-#
-updateProgram () {
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output /dev/null \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X PUT \
- -F "jar=@$2;type=application/octet-stream" \
- -F "force=$FORCE_INSTALLATION;type=text/plain$CHARSET_ARGUMENT" \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/$1 \
- )
- handleHttpErrors $? $HTTP_CODE
-
- if [ "$1" == server ]; then
- echo "Server updated, waiting for restart"
- waitServerStarted
- fi
-}
-
-isServerRunning () {
- RETRY_SESSION=3
- DONE=1
- let DATE_TIMEOUT=$(date +%s)+$JACK_CONNECTION_TIMEOUT
- while [ "$DONE" -ne 0 ]; do
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output /dev/null \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X GET \
- -H "Accept: text/plain$CHARSET_ARGUMENT" \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/server \
- )
- CURL_CODE=$?
- if [ $CURL_CODE -eq 0 ]; then
- # No problem, let's go
- return 0;
- elif [ $CURL_CODE -eq 7 ]; then
- return 1
- else
- # In case of partial, timeout, empty response, network error, let's retry
- if [ $RETRY_SESSION -eq 0 ]; then
- echo "Communication error with Jack server ($CURL_CODE), try 'jack-diagnose' or see Jack server log" >&2
- abort
- else
- if [ $(date +%s) -lt $DATE_TIMEOUT ]; then
- let RETRY_SESSION=RETRY_SESSION-1
- else
- echo "Communication error with Jack server ($CURL_CODE), try 'jack-diagnose' or see Jack server log" >&2
- abort
- fi
- fi
- fi
- done
-}
-
-waitServerStarted () {
- DONE=1
- let DATE_TIMEOUT=$(date +%s)+$JACK_CONNECTION_TIMEOUT
- while [ "$DONE" -ne 0 ]; do
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output /dev/null \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X GET \
- -H "Accept: text/plain$CHARSET_ARGUMENT" \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/server \
- )
- CURL_CODE=$?
- if [ $CURL_CODE -eq 7 ] || [ $CURL_CODE -eq 35 ] || [ $CURL_CODE -eq 58 ] || [ $CURL_CODE -eq 60 ] || [ $CURL_CODE -eq 77 ]; then
- if [ $(date +%s) -ge $DATE_TIMEOUT ]; then
- echo "Jack server failed to (re)start, try 'jack-diagnose' or see Jack server log" >&2
- abort
- else
- sleep 1
- fi
- else
- # A connection was opened, no need to know if it went well
- DONE=0;
- fi
- done
-}
-
-#
-# $1: program name
-#
-listProgramVersion () {
- exec 3>&1
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output >(tr -d '\015' >&3) \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X GET \
- -H "Accept: text/plain$CHARSET_ARGUMENT" \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/$1 \
- )
- handleHttpErrors $? $HTTP_CODE
- exec 3>&-
-}
-
-#
-# Decoding argument
-#
-if [ $# -eq 0 ]
-then
- usage
- abort
-fi
-
-set +o errexit
-
-FORCE_INSTALLATION=false
-case $1 in
- force-update)
- FORCE_INSTALLATION=true
- COMMAND=update;;
- *)
- COMMAND=$1;;
-esac
-
-case $COMMAND in
- install-server)
- if [ $# -ne 3 ]; then
- usage
- abort
- fi
- if [ ! -r "$2" ]; then
- echo "Jack server launcher jar \"$2\" is not readable" >&2
- abort
- fi
- if [ ! -r "$3" ]; then
- echo "Jack server jar \"$3\" is not readable" >&2
- abort
- fi
-
- checkCurlVersion
-
- if [ ! -d "$JACK_HOME" ]; then
- echo Installing jack server in \"$JACK_HOME\"
- mkdir -p "$JACK_HOME"
- cp $2 "$LAUNCHER_JAR"
- cp $3 "$JACK_HOME/server-1.jar"
- mkdir "$JACK_LOGS_DIR"
- keytool -genkeypair -validity 3650 -alias server -keyalg RSA -keysize 2048 -keypass Jack-Server -storepass Jack-Server -dname "CN=$SERVER_HOST" -keystore "$JACK_HOME/server.jks"
- keytool -genkeypair -validity 3650 -alias client -keyalg RSA -keysize 2048 -keypass Jack-Server -storepass Jack-Server -dname "CN=$(id -un)@$(uname -n)" -keystore "$JACK_HOME/client.jks"
- else
- echo "Jack server already installed in \"$JACK_HOME\"" >&2
- abort
- fi
- exit 0 ;;
-
-
- uninstall-server)
- SERVERS_PID=$(ps -o "pid args" -u `id -u -n` | grep $LAUNCHER_NAME | grep -v grep | awk '{print $1}')
- if [ -n "$SERVERS_PID" ]; then
- echo "Jack server is running, please stop it before uninstall" >&2
- echo "If you want to proceeed anyway, use '$0 force-uninstall-server'" >&2
- exit 2
- fi
-
- if [ ! -d "$JACK_HOME" ]; then
- echo "Jack server in \"$JACK_HOME\" not found" >&2
- abort
- fi
-
- echo "Removing jack server from \"$JACK_HOME\""
- rm -rf "$JACK_HOME"
- exit 0 ;;
-
-
- force-uninstall-server)
- if [ ! -d "$JACK_HOME" ]; then
- echo "Jack server in \"$JACK_HOME\" not found" >&2
- abort
- fi
-
- echo "Removing jack server from \"$JACK_HOME\""
- rm -rf "$JACK_HOME"
- exit 0 ;;
-
-
- list)
- if [ $# -ne 2 ]
- then
- usage
- abort
- fi
-
- listProgramVersion $2 ;;
-
-
- update)
- if [ $# -lt 3 ]; then
- usage
- abort
- fi
-
- if [ $# -gt 4 ]; then
- usage
- abort
- fi
-
- if [ ! -r "$3" ]; then
- echo "Failed to update $2 of Jack server: \"$3\" is not readable" >&2
- abort
- fi
-
- checkCurlVersion
-
- if [ $FORCE_INSTALLATION = true ]; then
- updateProgram $2 $3
- else
- if [ $# -eq 4 ]; then
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output /dev/null \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X HEAD \
- --data "$4" \
- -H "Content-Type:application/vnd.jack.select-exact;version=1" \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/$2 \
- )
- CURL_CODE=$?
- if [ $CURL_CODE -eq 22 ]; then
- if [ $HTTP_CODE -eq 404 ]; then
- # version not found, proceed to installation
- updateProgram $2 $3
- exit 0
- fi
- fi
- handleHttpErrors $CURL_CODE $HTTP_CODE
- else
- # No version provided, proceed directly without testing
- updateProgram $2 $3
- fi
- fi
- exit 0;;
-
-
- stop-server)
- echo "Stopping background server"
-
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output /dev/null \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X POST \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/server/stop \
- )
- handleHttpErrors $? $HTTP_CODE ;;
-
-
- server-stat)
- echo "Getting statistic from background server"
-
- exec 3>&1
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output >(tr -d '\015' >&3) \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X GET \
- -H "Accept: text/plain$CHARSET_ARGUMENT" \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/stat \
- )
- handleHttpErrors $? $HTTP_CODE
- exec 3>&- ;;
-
-
- server-stat-reset)
- echo "Reseting peak statistics from the background server"
-
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output /dev/null \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X DELETE \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/stat \
- )
- handleHttpErrors $? $HTTP_CODE ;;
-
-
- server-log)
- exec 3>&1
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output >(tr -d '\015' >&3) \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X GET \
- -H "Accept: text/plain$CHARSET_ARGUMENT" \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/launcher/log \
- )
- handleHttpErrors $? $HTTP_CODE
- exec 3>&- ;;
-
-
- kill-server)
- echo "Killing background server"
- SERVERS_PID=$(ps -o "pid args" -u `id -u -n` | grep $LAUNCHER_NAME | grep -v grep | awk '{print $1}')
- if [ -z "$SERVERS_PID" ]; then
- echo "No Jack server to kill" >&2
- exit 2
- fi
-
- for PID in $SERVERS_PID; do
- kill $PID 2>/dev/null
- TIMEOUT=30
- while [ "$TIMEOUT" -ne 0 ]; do
- kill -0 $PID 2>/dev/null
- if [ $? -ne 0 ]; then
- continue 2
- fi
- sleep 1
- let TIMEOUT=TIMEOUT-1
- done
- kill -KILL $PID 2>/dev/null
- DONE=$?
- while [ $DONE -eq 0 ]; do
- kill -0 $PID 2>/dev/null
- DONE=$?
- sleep 1
- done
- done
-
- exit 0 ;;
-
-
- list-server)
- ps -A -o "user pid args" | grep $LAUNCHER_NAME | grep -v grep
- exit $? ;;
-
-
- start-server)
- if [ ! -d "$JACK_HOME" ]; then
- echo "Jack server installation not found" >&2
- abort
- fi
-
- isServerRunning
- RUNNING=$?
- if [ "$RUNNING" = 0 ]; then
- echo "Server is already running"
- else
- JACK_SERVER_COMMAND="java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS -cp $LAUNCHER_JAR $LAUNCHER_NAME"
- echo "Launching Jack server" $JACK_SERVER_COMMAND
- (
- trap "" SIGHUP
- for i in $(seq 3 255); do
- eval exec "$i"'>&-'
- done
- cd "$JACK_HOME"
- umask $BASE_UMASK
- exec $JACK_SERVER_COMMAND
- abort
- ) >"$JACK_OUT_ERR" 2>&1 &
- fi
-
- waitServerStarted
- exit 0 ;;
-
-
- server-log-level)
- if [ $# -eq 4 ]
- then
- LIMIT=$3
- COUNT=$4
- elif [ $# -eq 2 ]
- then
- COUNT=5
- if [ \( "$2" = "ERROR" \) -o \( "$2" = "WARNING" \) ]
- then
- LIMIT=1048576
- else
- LIMIT=10485760
- fi
- else
- usage
- abort
- fi
-
- echo "Setting logging parameters of background server"
-
- HTTP_CODE=$(curl --fail $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output /dev/null \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- --request PUT \
- --form "level=$2;type=text/plain$CHARSET_ARGUMENT" \
- --form "limit=$LIMIT;type=text/plain$CHARSET_ARGUMENT" \
- --form "count=$COUNT;type=text/plain$CHARSET_ARGUMENT" \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/launcher/log/level \
- )
- handleHttpErrors $? $HTTP_CODE ;;
-
-
- server-gc)
- echo "Requesting a garbage collection to the background server"
-
- HTTP_CODE=$(curl -f $JACK_EXTRA_CURL_OPTIONS \
- --cert "${JACK_HOME}/client.pem" \
- --cacert "${JACK_HOME}/server.pem" \
- --output /dev/null \
- --no-buffer --write-out '%{http_code}' --silent --connect-timeout $JACK_CONNECTION_TIMEOUT \
- -X POST \
- --noproxy ${SERVER_HOST} \
- https://${SERVER_HOST}:$SERVER_PORT_ADMIN/gc \
- )
- handleHttpErrors $? $HTTP_CODE ;;
-
-
-#
-# Should be run when server is off. Allows to clean files that could be forgotten on disk in case of
-# server VM crash after an update.
-#
- cleanup-server)
- shopt -s nullglob
- for file in $JACK_HOME/jack/*.deleted; do
- rm "${file%.deleted}"
- rm "$file"
- done
- exit 0 ;;
-
-
- dump-report)
- if [ ! -d "$JACK_HOME" ]; then
- echo "Failed to locate Jack server installation" >&2
- abort
- fi
-
- echo "Creating report..."
- REPORT="jack-report.$$.zip"
- REPORT_PATH="$(pwd)/$REPORT"
- REPORT_INFO="$JACK_HOME/report.$$.txt"
-
- if [ -e "$REPORT" ]; then
- echo "Failed to create Jack server report '$REPORT', file already exists" >&2
- abort
- fi
-
- trap 'rm -f "$REPORT_INFO" 2>/dev/null;' EXIT
-
- date >>"$REPORT_INFO" 2>&1
-
- echo "Dumping Jack server stacks..."
- echo >>"$REPORT_INFO"
- echo "\$ ps -o \"pid args\" | grep $LAUNCHER_NAME | grep -v grep | awk '{print $1}' | xargs kill -3" >>"$REPORT_INFO"
- (ps -o "pid args" | grep $LAUNCHER_NAME | grep -v grep | awk '{print $1}' | xargs kill -3) >>"$REPORT_INFO" 2>&1
-
- echo "Getting current user id..."
- echo >>"$REPORT_INFO"
- echo "\$ id -u" >>"$REPORT_INFO"
- id -u >>"$REPORT_INFO"
-
- echo "Listing Jack server process..."
- echo >>"$REPORT_INFO"
- echo "\$ ps -A -o \"uid pid args\" | grep $LAUNCHER_NAME | grep -v grep" >>"$REPORT_INFO"
- (ps -A -o "uid pid args" | grep $LAUNCHER_NAME | grep -v grep) >>"$REPORT_INFO" 2>&1
-
- echo "Listing process using Jack server service port $SERVER_PORT_SERVICE..."
- echo >>"$REPORT_INFO"
- echo "\$ lsof -i TCP:$SERVER_PORT_SERVICE -l" >>"$REPORT_INFO"
- lsof -i TCP:$SERVER_PORT_SERVICE -l >>"$REPORT_INFO" 2>&1
-
- echo "Listing process using Jack server admin port $SERVER_PORT_ADMIN..."
- echo >>"$REPORT_INFO"
- echo "\$ lsof -i TCP:$SERVER_PORT_ADMIN -l" >>"$REPORT_INFO"
- lsof -i TCP:$SERVER_PORT_ADMIN -l >>"$REPORT_INFO" 2>&1
-
- echo "Collecting Jack client configuration..."
- echo >>"$REPORT_INFO"
- echo "\$ cat \"\$JACK_CLIENT_SETTING\"" >>"$REPORT_INFO"
- cat "$JACK_CLIENT_SETTING" >>"$REPORT_INFO" 2>&1
-
- echo "Listing Jack server installation dir..."
- echo >>"$REPORT_INFO"
- echo "\$ cd \"\$JACK_HOME\"; ls -l -R -n ." >>"$REPORT_INFO"
- (cd "$JACK_HOME" ; ls -l -R -n . >>"$REPORT_INFO" 2>&1)
-
- echo "Collecting curl version..."
- echo >>"$REPORT_INFO"
- echo "\$ curl --version" >>"$REPORT_INFO"
- curl --version >>"$REPORT_INFO" 2>&1
-
- echo "Collecting curl connection info..."
- echo >>"$REPORT_INFO"
- echo "\$ JACK_EXTRA_CURL_OPTIONS=-v jack-admin list server" >>"$REPORT_INFO"
- JACK_EXTRA_CURL_OPTIONS=-v "$0" list server >>"$REPORT_INFO" 2>&1
-
- echo "Collecting Jack server stats..."
- echo >>"$REPORT_INFO"
- echo "\$ jack-admin server-stat" >>"$REPORT_INFO"
- "$0" server-stat >>"$REPORT_INFO" 2>&1
-
- echo "Collecting base64 info..."
- echo >>"$REPORT_INFO"
- echo "\$ base64 --version" >>"$REPORT_INFO"
- base64 --version >>"$REPORT_INFO" 2>&1
- echo >>"$REPORT_INFO"
- echo "\$ (echo amFjaw==;echo LXNlcnZlcg==) | base64 --decode" >>"$REPORT_INFO"
- (echo amFjaw==;echo LXNlcnZlcg==) | base64 --decode >>"$REPORT_INFO" 2>&1
-
- echo "Zipping Jack server installation dir except keys and certificates..."
- (cd "$JACK_HOME"; zip --exclude \*.pem \*.jks --recurse-paths "$REPORT_PATH" .) >/dev/null
- echo "Jack server report saved in '$REPORT'. Consider reviewing content before publishing."
- exit 0 ;;
-
-
- *)
- usage
- abort ;;
-esac
-
-
-# Exit
-
-exit 0
diff --git a/tools/jack-annotations.jar b/tools/jack-annotations.jar
deleted file mode 100644
index fa79119..0000000
--- a/tools/jack-annotations.jar
+++ /dev/null
Binary files differ
diff --git a/tools/jack-coverage-plugin.jar b/tools/jack-coverage-plugin.jar
deleted file mode 100644
index ac363d7..0000000
--- a/tools/jack-coverage-plugin.jar
+++ /dev/null
Binary files differ
diff --git a/tools/jack-diagnose b/tools/jack-diagnose
deleted file mode 100755
index dc7f3e9..0000000
--- a/tools/jack-diagnose
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Version: 1.3-a11
-#
-set -o nounset
-
-#
-# Settings
-#
-JACK_HOME="${JACK_HOME:=$HOME/.jack-server}"
-JACK_CLIENT_SETTING="${JACK_CLIENT_SETTING:=$HOME/.jack-settings}"
-TMPDIR=${TMPDIR:=/tmp}
-
-LAUNCHER_JAR="$JACK_HOME/launcher.jar"
-LAUNCHER_NAME=com.android.jack.launcher.ServerLauncher
-CURRENT_CHARSET=$(locale charmap)
-if [ -z "$CURRENT_CHARSET" ]; then
- CHARSET_ARGUMENT=
-else
- CHARSET_ARGUMENT=";charset=$CURRENT_CHARSET"
-fi
-
-JACK_LOGS_DIR="$JACK_HOME"/logs
-JACK_OUT_ERR="$JACK_LOGS_DIR"/outputs.txt
-JACK_CONNECTION_TIMEOUT=300
-
-#
-# Load client settings
-#
-if [ -f "$JACK_CLIENT_SETTING" ]; then
- source "$JACK_CLIENT_SETTING"
-fi
-
-
-usage () {
- echo "Usage : $0"
-}
-
-checkCurl() {
- CURL_COMMAND=$(which curl)
-
- if [ $? -ne 0 ] ; then
- echo "curl not found in PATH"
- return 255
- fi
-
- if ! "$CURL_COMMAND" --version >/dev/null 2>&1 ; then
- echo "Failed to execute '$CURL_COMMAND'"
- return 255
- fi
-
- if "$CURL_COMMAND" --version | grep -q "SecureTransport" ; then
- echo "'$CURL_COMMAND' unsupported, please use a curl not based on SecureTransport"
- fi
-
- if "$CURL_COMMAND" --version | grep -q "OpenSSL/1.0.0" ; then
- echo "'$CURL_COMMAND' is using a too old SSL library, please update curl and its dependencies"
- elif curl --version | grep -q "OpenSSL/0." ; then
- echo "'$CURL_COMMAND' is using a too old SSL library, please update curl and its dependencies"
- fi
-}
-
-
-checkJava() {
- JAVA_COMMAND=$(which java)
-
- if [ $? -ne 0 ] ; then
- echo "java not found in PATH"
- return 255
- fi
-
- if ! "$JAVA_COMMAND" -version >/dev/null 2>&1 ; then
- echo "Failed to execute '$JAVA_COMMAND'"
- return 255
- fi
-
-
- JAVA_VERSION=$("$JAVA_COMMAND" -version 2>&1 | head -1 | grep --only-matching -e \"1\\.[0-9]* | cut -c 4-)
- if [ -z "$JAVA_VERSION" ] ; then
- echo "'$JAVA_COMMAND': Failed to parse version, please ensure you're running a supported java"
- return 255
- fi
-
- if [ "$JAVA_VERSION" -lt 7 ] ; then
- echo "'$JAVA_COMMAND' is too old, please update to 1.7 or newer"
- fi
-}
-
-
-checkKeytool() {
- KEYTOOL_COMMAND=$(which keytool)
-
- if [ $? -ne 0 ] ; then
- echo "keytool not found in PATH"
- return 255
- fi
-
- if ! $KEYTOOL_COMMAND -help >/dev/null 2>&1 ; then
- echo "failed to execute '$KEYTOOL_COMMAND'"
- return 255
- fi
-
-
- if ! $KEYTOOL_COMMAND -help 2>&1 | grep -q -e "-genkeypair" ; then
- echo "'$KEYTOOL_COMMAND' unsupported, please ensure PATH allows finding keytool from a supported Java Runtime Environment ie 1.7 or newer"
- fi
-}
-
-
-#
-# $1: port number
-#
-checkport() {
- PID_USING_PORT=$(lsof -F p -i TCP:$1 -sTCP:LISTEN | cut -c 2-)
- if [ -z "$PID_USING_PORT" ] ; then
- # port is free nothing to check
- return 0
- fi
-
- PS_OUT=$(ps -p $PID_USING_PORT -o "pid uid args" | tail -1)
- if [ $? -ne 0 ] ; then
- # process exited before we could get any info, weird but means the port is now available
- return 0
- fi
-
- if ! echo $PS_OUT | grep -q $LAUNCHER_NAME ; then
- echo "Port $1 is used by another process (pid=$(echo $PS_OUT | awk '{print $1}')), please ensure to free the port or change port configuration in '$JACK_CLIENT_SETTING' and '$JACK_HOME/config.properties'"
- return 255
- fi
-
- if [ "$(echo $PS_OUT | awk '{print $2}')" -ne "$(id -u)" ] ; then
- echo "Port $1 is used b a Jack server from another user uid=$(echo $PS_OUT | awk '{print $2}'), please change port configuration in '$JACK_CLIENT_SETTING' and '$JACK_HOME/config.properties'"
- return 255
- fi
-}
-
-
-checkBase64() {
- BASE64_COMMAND=$(which base64)
-
- if [ $? -ne 0 ] ; then
- echo "base64 not found in PATH"
- return 255
- fi
-
- BASE64_CHECK=$((echo amFjaw==;echo LXNlcnZlcg==) | "$BASE64_COMMAND" --decode 2>&1)
- if [ "$BASE64_CHECK" != jack-server ]; then
- echo "'$BASE64_COMMAND' is not a supported version"
- return 255
- fi
-}
-
-STATUS=0
-
-if ! checkCurl ; then
- STATUS=1
-fi
-
-if ! checkJava ; then
- STATUS=1
-fi
-if ! checkKeytool ; then
- STATUS=1
-fi
-
-if ! checkport $SERVER_PORT_ADMIN ; then
- STATUS=1
-fi
-if ! checkport $SERVER_PORT_SERVICE ; then
- STATUS=1
-fi
-
-if ! checkBase64 ; then
- echo "base64 is not mandatory but installing a supported version can help with standard output and standard error problems"
-fi
-
-if [ $STATUS -eq 0 ] ; then
- echo "Diagnostic completed without error."
-fi
-# Exit
-exit $STATUS
diff --git a/tools/jack-ea b/tools/jack-ea
deleted file mode 100755
index 94c2a17..0000000
--- a/tools/jack-ea
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Version: 1.3-a9
-#
-set -o nounset
-export JACK_ASSERTION_ENABLED=true
-if [ -e "$(dirname $0)/jack" ]; then
- "$(dirname $0)/jack" $@
-else
- jack $@
-fi
diff --git a/tools/jack-jar-tools.jar b/tools/jack-jar-tools.jar
deleted file mode 100644
index 9570195..0000000
--- a/tools/jack-jar-tools.jar
+++ /dev/null
Binary files differ
diff --git a/tools/jack-launcher.jar b/tools/jack-launcher.jar
deleted file mode 100644
index 2ca0332..0000000
--- a/tools/jack-launcher.jar
+++ /dev/null
Binary files differ
diff --git a/tools/jack-server-4.11.ALPHA.jar b/tools/jack-server-4.11.ALPHA.jar
deleted file mode 100644
index bc43dde..0000000
--- a/tools/jack-server-4.11.ALPHA.jar
+++ /dev/null
Binary files differ
diff --git a/tools/jack_for_module.mk b/tools/jack_for_module.mk
deleted file mode 100644
index 6623a48..0000000
--- a/tools/jack_for_module.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-#
-# Define version of Jack used to compile one module by defining the var <module name>.JACK_VERSION
-# with value, the Jack version code. See possible values in prebuilts/sdk/tools/jack_versions.mk.
diff --git a/tools/jack_server_setup.mk b/tools/jack_server_setup.mk
deleted file mode 100644
index 780f890..0000000
--- a/tools/jack_server_setup.mk
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-LOCAL_PATH:= $(call my-dir)
-
-jack_server_version := 4.11.ALPHA
-jack_server_jar := $(LOCAL_PATH)/jack-server-$(jack_server_version).jar
-
-
-ifneq ($(ANDROID_JACK_VM_ARGS),)
-jack_vm_args := $(ANDROID_JACK_VM_ARGS)
-else
-jack_vm_args := -Dfile.encoding=UTF-8 -XX:+TieredCompilation
-endif
-available_jack_jars := $(wildcard $(LOCAL_PATH)/jacks/jack-*.jar)
-
-ifdef JACK_SERVER
-ifneq ($(JACK_SERVER),true)
-jack_server_disabled=true
-endif
-endif
-
-.PHONY: setup-jack-server
-setup-jack-server : PRIVATE_JACK_ADMIN := $(LOCAL_PATH)/jack-admin
-setup-jack-server : PRIVATE_PATH := $(LOCAL_PATH)
-setup-jack-server : PRIVATE_SERVER_VERSION := $(jack_server_version)
-setup-jack-server : PRIVATE_SERVER_JAR := $(jack_server_jar)
-setup-jack-server: $(JACK) $(LOCAL_PATH)/jack-launcher.jar $(jack_server_jar) $(available_jack_jars)
-ifndef jack_server_disabled
- @echo Ensuring Jack server is installed and started
-ifneq ($(dist_goal),)
- $(hide) $(PRIVATE_JACK_ADMIN) stop-server 2>&1 || (exit 0)
- $(hide) $(PRIVATE_JACK_ADMIN) kill-server 2>&1 || (exit 0)
- $(hide) $(PRIVATE_JACK_ADMIN) uninstall-server 2>&1 || (exit 0)
-endif
- $(hide) $(PRIVATE_JACK_ADMIN) install-server $(PRIVATE_PATH)/jack-launcher.jar $(PRIVATE_SERVER_JAR) 2>&1 || (exit 0)
-ifneq ($(dist_goal),)
- $(hide) mkdir -p "$(DIST_DIR)/logs/jack/"
- $(hide) JACK_SERVER_VM_ARGUMENTS="$(jack_vm_args) -Dcom.android.jack.server.log.file=$(abspath $(DIST_DIR))/logs/jack/jack-server-%u-%g.log" $(PRIVATE_JACK_ADMIN) start-server 2>&1 || exit 0
-else
- $(hide) JACK_SERVER_VM_ARGUMENTS="$(jack_vm_args)" $(PRIVATE_JACK_ADMIN) start-server 2>&1 || exit 0
-endif
- $(hide) $(PRIVATE_JACK_ADMIN) update server $(PRIVATE_SERVER_JAR) $(PRIVATE_SERVER_VERSION) 2>&1 || exit 0
- $(hide) $(foreach jack_jar,$(available_jack_jars),$(PRIVATE_JACK_ADMIN) update jack $(jack_jar) $(patsubst $(PRIVATE_PATH)/jacks/jack-%.jar,%,$(jack_jar)) || exit 47;)
-ifdef JACK_ENGINEERING_VERSION
- $(hide) $(PRIVATE_JACK_ADMIN) update jack $(jack_eng_jar)
-endif
-endif
diff --git a/tools/jack_versions.mk b/tools/jack_versions.mk
deleted file mode 100644
index a62cb9f..0000000
--- a/tools/jack_versions.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-LOCAL_PATH:= $(call my-dir)
-
-jack_jar_tools := $(LOCAL_PATH)/jack-jar-tools.jar
-jack_eng_jar := $(LOCAL_PATH)/jacks/jack.jar
-
-JACK_STABLE_VERSION := 4.32.CANDIDATE
-JACK_DOGFOOD_VERSION := 4.32.CANDIDATE
-JACK_SDKTOOL_VERSION := 4.32.CANDIDATE
-JACK_LANG_DEV_VERSION := 4.32.CANDIDATE
-ifneq ("$(wildcard $(jack_eng_jar))","")
-JACK_ENGINEERING_VERSION := $(shell $(JAVA) -jar $(jack_jar_tools) --version-code jack $(jack_eng_jar))
-endif
-
-ifneq ($(ANDROID_JACK_DEFAULT_VERSION),)
-JACK_DEFAULT_VERSION := $(JACK_$(ANDROID_JACK_DEFAULT_VERSION)_VERSION)
-ifeq ($(JACK_DEFAULT_VERSION),)
-$(error "$(ANDROID_JACK_DEFAULT_VERSION)" is an invalid value for ANDROID_JACK_DEFAULT_VERSION)
-endif
-JACK_APPS_VERSION := $(ANDROID_JACK_DEFAULT_VERSION)
-else
-ifneq (,$(TARGET_BUILD_APPS))
-# Unbundled branches
-JACK_DEFAULT_VERSION := $(JACK_STABLE_VERSION)
-else
-# Complete android tree
-JACK_DEFAULT_VERSION := $(JACK_STABLE_VERSION)
-endif
-JACK_APPS_VERSION := STABLE
-endif
diff --git a/tools/jacks/jack-4.32.CANDIDATE.jar b/tools/jacks/jack-4.32.CANDIDATE.jar
deleted file mode 100644
index 9767682..0000000
--- a/tools/jacks/jack-4.32.CANDIDATE.jar
+++ /dev/null
Binary files differ
diff --git a/tools/jills/jill-4.32.CANDIDATE.jar b/tools/jills/jill-4.32.CANDIDATE.jar
deleted file mode 100644
index 970ec3c..0000000
--- a/tools/jills/jill-4.32.CANDIDATE.jar
+++ /dev/null
Binary files differ