Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare 4.0.1 release #83

Merged
merged 166 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
26dc142
add time threshold for backoff reset
eli-darkly Dec 11, 2018
881473f
Merge branch 'master' into eb/ch15975/backoff-reset
eli-darkly Dec 11, 2018
ca0865d
allow endpoint to be specified as either URI or HttpUrl
eli-darkly Dec 11, 2018
a35c7e6
add @since
eli-darkly Dec 11, 2018
8e4363b
add interface for customizing requests
eli-darkly Dec 11, 2018
54f11e0
Merge pull request #18 from launchdarkly/eb/ch15975/backoff-reset
eli-darkly Dec 13, 2018
7b104a0
Merge pull request #20 from launchdarkly/eb/ch28150/customize-request
eli-darkly Dec 13, 2018
32f80d8
Merge branch 'master' into eb/ch28144/okhttp-url
eli-darkly Dec 13, 2018
1bd8145
Merge pull request #19 from launchdarkly/eb/ch28144/okhttp-url
eli-darkly Dec 13, 2018
52d1732
javadoc fixes
eli-darkly Dec 13, 2018
e82ee5f
add changelog for past releases
eli-darkly Dec 13, 2018
5917b43
Merge branch 'master' of github.com:launchdarkly/okhttp-eventsource
eli-darkly Dec 13, 2018
d6a189b
remove JSR305
eli-darkly Mar 19, 2019
9674ef7
Merge pull request #21 from launchdarkly/eb/ch34379/annotations
eli-darkly Mar 20, 2019
ef15c12
Merge branch 'master' of github.com:launchdarkly/okhttp-eventsource
eli-darkly Mar 21, 2019
6d498fe
Merge branch 'master' of github.com:launchdarkly/okhttp-eventsource
eli-darkly Aug 1, 2019
890eada
replace SSL-specific config method with general-purpose HTTP config m…
eli-darkly Aug 1, 2019
7ba89f4
make helper method static
eli-darkly Aug 1, 2019
4acfb7e
Merge pull request #22 from launchdarkly/eb/ch44325/http-custom-config
eli-darkly Aug 1, 2019
95e4c37
add end-to-end EventSource tests
eli-darkly Aug 1, 2019
c93f4f0
spacing
eli-darkly Aug 1, 2019
0460bfe
Merge pull request #23 from launchdarkly/eb/ch28292/http-tests
eli-darkly Aug 1, 2019
5cd1b37
Merge branch 'master' of github.com:launchdarkly/okhttp-eventsource
eli-darkly Aug 1, 2019
64a67fc
Merge branch 'master' of github.com:launchdarkly/okhttp-eventsource
eli-darkly Aug 22, 2019
9f05a9a
omit default header value if there's a custom value
eli-darkly Oct 12, 2019
2e5354b
avoid trailing period in logger name
eli-darkly Oct 12, 2019
9f83742
Merge pull request #25 from launchdarkly/eb/ch52604/logger-name
eli-darkly Oct 18, 2019
3dd72a6
Merge pull request #24 from launchdarkly/eb/ch52602/override-header
eli-darkly Oct 18, 2019
b77ea93
merge from public after release
LaunchDarklyCI Oct 18, 2019
9874518
add 1.x branch
eli-darkly Jan 18, 2020
7ada28f
update to OkHttp 4.x and Java 8
eli-darkly Jan 18, 2020
bf2f83c
javadoc fixes
eli-darkly Jan 18, 2020
09d9173
Merge branch 'master' into eb/ch62055/okhttp-4.x
eli-darkly Jan 18, 2020
0c3695e
Merge pull request #26 from launchdarkly/eb/ch62055/okhttp-4.x
eli-darkly Jan 22, 2020
8c9ca57
remove EventSource setters, + test improvements
eli-darkly Jan 22, 2020
0c59325
Merge pull request #27 from launchdarkly/eb/ch62489/remove-setters
eli-darkly Jan 22, 2020
65e49b3
merge from public after release
LaunchDarklyCI Jan 22, 2020
7339b66
update Gradle release
eli-darkly Jan 31, 2020
8cabf86
enable Github Pages
eli-darkly Jan 31, 2020
cf995b9
Merge pull request #28 from launchdarkly/eb/ch63665/fix-release
eli-darkly Jan 31, 2020
0644277
skip tests in release
eli-darkly Jan 31, 2020
0814f3d
Merge branch 'public-master'
eli-darkly Jan 31, 2020
0f25a02
merge from public after release
LaunchDarklyCI Jan 31, 2020
9f9513a
merge from public after release
LaunchDarklyCI Jan 31, 2020
4f542e4
add ability to force a stream restart; improve tests so we can test this
eli-darkly Mar 14, 2020
7abb48b
revert whitespace change
eli-darkly Mar 14, 2020
685e03f
Merge branch '1.x' of github.com:launchdarkly/okhttp-eventsource into…
eli-darkly Mar 14, 2020
ce2509d
Merge branch '1.x' into eb/ch69336/restart-plus-tests-2.x
eli-darkly Mar 14, 2020
78fa088
Merge branch 'eb/ch69336/restart-stream-and-tests' into eb/ch69336/re…
eli-darkly Mar 14, 2020
c6d5b46
bump OkHttp version to latest Java 7-compatible version
eli-darkly Mar 20, 2020
2c2ca19
Merge pull request #30 from launchdarkly/eb/ch70366/okhttp-update
eli-darkly Mar 20, 2020
e5c3b3d
merge from public after release
LaunchDarklyCI Mar 20, 2020
bf60873
Merge branch '1.x'
eli-darkly Mar 20, 2020
a7e19ed
Merge branch '1.x' of github.com:launchdarkly/okhttp-eventsource into…
eli-darkly Mar 20, 2020
5c3c554
Merge branch '1.x'
eli-darkly Mar 20, 2020
48b0692
add ability to force a stream restart; improve tests so we can test t…
eli-darkly Mar 26, 2020
f5f6264
Merge branch '1.x' into eb/ch69336/restart-plus-tests-2.x
eli-darkly Mar 27, 2020
d2dad1c
Merge branch 'eb/ch69336/restart-plus-tests-2.x'
eli-darkly Mar 27, 2020
b96e581
merge from public after release
LaunchDarklyCI Mar 30, 2020
3f431f1
Merge branch '1.x' of github.com:launchdarkly/okhttp-eventsource into…
eli-darkly Apr 6, 2020
e5e7a5d
Merge branch '1.x'
eli-darkly Apr 6, 2020
c2a6bb5
update to okhttp 4.5.0
eli-darkly Apr 7, 2020
439b9ff
longer timeout for cleaner shutdown of test servers
eli-darkly Apr 7, 2020
3e72475
Merge pull request #31 from launchdarkly/eb/ch72725/okhttp-update
eli-darkly Apr 7, 2020
91ae82e
fix Gradle scopes
eli-darkly Apr 7, 2020
add38c0
merge from public after release
LaunchDarklyCI Apr 29, 2020
452e8bf
allow setting specific thread priority
eli-darkly May 7, 2020
24ef1ef
Merge pull request #33 from launchdarkly/eb/ch76124/thread-priority
eli-darkly May 8, 2020
42eaef1
remove misleading logging & unnecessary backoff, improve tests (#34)
eli-darkly May 8, 2020
fc45c58
known issue with onClose() - add comment, disable test assertions
eli-darkly May 8, 2020
c905979
Merge pull request #35 from launchdarkly/eb/ch76166/tests-hang-2
eli-darkly May 8, 2020
e0d4e84
merge from public after release
LaunchDarklyCI May 8, 2020
b0161a5
allow caller to specify a custom logger instead of SLF4J (#32)
eli-darkly May 8, 2020
259a866
add method for changing base name of SLF4J logger
eli-darkly May 26, 2020
9a70959
enable coverage reports in CI, improve CI to test all supported Java …
eli-darkly May 26, 2020
6ad34ee
rm inapplicable CI copy-paste
eli-darkly May 26, 2020
bbcee02
another CI fix
eli-darkly May 27, 2020
35b0dda
add checkstyle config
eli-darkly May 27, 2020
ade7f46
Merge pull request #36 from launchdarkly/eb/ch76113/logger-name
eli-darkly May 27, 2020
eb2731f
Merge pull request #37 from launchdarkly/eb/ch77594/coverage
eli-darkly May 27, 2020
ae5e25f
fix jitter calculation when upper bound is a power of 2
eli-darkly May 27, 2020
1cbcf8e
Merge pull request #38 from launchdarkly/eb/ch77825/random-jitter-calc
eli-darkly May 27, 2020
dadea3d
merge from public after release
LaunchDarklyCI May 27, 2020
30da690
Merge branch '1.x'
eli-darkly May 27, 2020
f69d180
misc coverage + test improvements, add CI enforcement of coverage (#39)
eli-darkly Jun 2, 2020
7ef1505
Merge branch 'master' of github.com:launchdarkly/okhttp-eventsource
eli-darkly Jun 2, 2020
d4143ca
fix shutdown state logic, simplify code paths (#40)
eli-darkly Jun 18, 2020
508d49a
merge from public after release
LaunchDarklyCI Jun 18, 2020
0b4709d
Fix Java 7 compatibility.
gwhelanLD Sep 23, 2020
1d95560
Merge pull request #41 from launchdarkly/gw/ch90426/fix-java-7-compat
gwhelanLD Sep 23, 2020
34a7b83
add OpenJDK 7 build + fix test race condition + javadoc fix (#42)
eli-darkly Sep 28, 2020
ed434fc
merge from public after release
LaunchDarklyCI Sep 28, 2020
d988279
Merge branch '1.x'
eli-darkly Sep 28, 2020
1dfc823
update Gradle to 6.8.3
eli-darkly May 6, 2021
4e158f2
Merge pull request #43 from launchdarkly/eb/ch104534/update-gradle
eli-darkly May 6, 2021
77f7378
Kotlinize build script
eli-darkly May 6, 2021
54fa96f
Merge pull request #44 from launchdarkly/eb/ch107687/gradle-kotlin
eli-darkly May 7, 2021
aea06fe
fix logic for shutting down after an unrecoverable error
eli-darkly Jun 24, 2021
989d4e6
Merge pull request #45 from launchdarkly/eb/ch112576/shutdown-on-error
eli-darkly Jun 24, 2021
235c965
merge from public after release
LaunchDarklyCI Jun 24, 2021
2bc9410
use newer HTTP test helpers
eli-darkly Jun 26, 2021
2d180ba
Merge pull request #46 from launchdarkly/eb/ch112118/http-test-helpers
eli-darkly Jun 26, 2021
ab44674
use Releaser v2 config + newer CI images (#47)
eli-darkly Sep 14, 2021
524a43c
use new stream-reading implementation to support CR-only line endings
eli-darkly Dec 31, 2021
28c2dc6
make buffer size configurable
eli-darkly Dec 31, 2021
a781b56
rm usage that's not allowed in Java 8
eli-darkly Dec 31, 2021
e51be5c
add Guava test dependency
eli-darkly Dec 31, 2021
7f23d3b
add code coverage ovverride
eli-darkly Dec 31, 2021
5110814
Merge pull request #49 from launchdarkly/eb/sc-131353/cr
eli-darkly Jan 6, 2022
c8a9888
implement contract tests (#48)
eli-darkly Jan 6, 2022
9a99372
merge from public after release
Jan 6, 2022
595b134
use Gradle 7
eli-darkly Jan 8, 2022
cea3f23
Bounded queues for the EventHandler thread (#58)
thomaslee Jan 10, 2022
97029fc
Merge branch 'contrib' of github.com:launchdarkly/okhttp-eventsource …
eli-darkly Jan 10, 2022
18cf216
update @since
eli-darkly Jan 10, 2022
6f935f7
Merge pull request #50 from launchdarkly/eb/sc-122485/gradle7
eli-darkly Jan 10, 2022
a723ca0
test Java 17 in CI (#51)
eli-darkly Jan 10, 2022
5eb858d
Merge branch 'eb/sc-137152/handler-queue'
eli-darkly Jan 10, 2022
78980a6
improve tests for AsyncEventHandler and EventSource.awaitClosed (#52)
eli-darkly Jan 13, 2022
1d771d7
merge from public after release
Jan 14, 2022
260f62a
add streaming data mode for very large events (#53)
eli-darkly Jun 28, 2022
a51a3cd
add option to ensure that expected fields are always read
eli-darkly Jun 29, 2022
189d3fb
Merge pull request #54 from launchdarkly/eb/sc-157338/streaming-requi…
eli-darkly Jun 29, 2022
58b7e6c
merge from public after release
Jun 29, 2022
f4cc7ba
add Gradle option to suppress kotlin-stdlib in our pom
eli-darkly Jun 29, 2022
d3ce2fa
Merge pull request #55 from launchdarkly/eb/sc-158486/kotlin-dependency
eli-darkly Jun 29, 2022
2714c17
merge from public after release
Jun 29, 2022
c520e4a
update okhttp to 4.9.3
eli-darkly Jul 26, 2022
d0a5c6d
Merge pull request #56 from launchdarkly/eb/sc-161764/okhttp-version
eli-darkly Jul 28, 2022
ccb3a72
merge from public after release
Jul 28, 2022
a7b1851
use LaunchDarkly logging facade
eli-darkly Jul 29, 2022
896cba6
rm unused
eli-darkly Jul 29, 2022
484baa3
misc fixes
eli-darkly Jul 29, 2022
483776b
improve javadoc links
eli-darkly Jul 29, 2022
306a8cd
remove SLF4J dependency, use only com.launchdarkly.logging
eli-darkly Aug 1, 2022
5b129d7
update com.launchdarkly.logging version
eli-darkly Aug 1, 2022
9e62168
consistently use placeholders instead of concatenation in log output
eli-darkly Aug 2, 2022
7d4d793
Merge pull request #57 from launchdarkly/eb/sc-138971/ld-logging
eli-darkly Aug 2, 2022
bce3a6e
merge from public after release
Aug 2, 2022
a01d2e3
update release metadata
eli-darkly Aug 2, 2022
0f987cc
Merge pull request #58 from launchdarkly/eb/sc-138971/ld-logging-only
eli-darkly Aug 2, 2022
ff8e68c
use SecureRandom instead of Random, just to make scanners happier
eli-darkly Aug 23, 2022
40537c0
Merge pull request #60 from launchdarkly/eb/sc-164297/secure-random
eli-darkly Aug 23, 2022
d15b511
use SecureRandom instead of Random, just to make scanners happier
eli-darkly Aug 23, 2022
af63a2d
Merge branch '2.x'
eli-darkly Aug 23, 2022
15e4864
use SecureRandom instead of Random, just to make scanners happier
eli-darkly Aug 23, 2022
e269eb7
Merge branch '1.x' into 2.x
eli-darkly Aug 23, 2022
7d02caa
Merge branch '2.x'
eli-darkly Aug 23, 2022
f442c93
merge from public after release
Aug 23, 2022
4563385
Merge branch '1.x' into 2.x
eli-darkly Aug 23, 2022
344afdb
Merge branch '2.x' of github.com:launchdarkly/okhttp-eventsource into…
eli-darkly Aug 23, 2022
3479aab
Merge branch '2.x'
eli-darkly Aug 23, 2022
631b8cc
merge from public after release
Aug 23, 2022
66e3228
Merge branch '2.x'
eli-darkly Aug 23, 2022
e3626ad
fix release metadata
eli-darkly Sep 28, 2022
b977dd3
remove usage of Duration for Android compatibility
eli-darkly Sep 28, 2022
5f2c209
Merge pull request #63 from launchdarkly/eb/sc-162830/no-duration-in-3.x
eli-darkly Oct 28, 2022
92966b7
merge from public after release
Dec 2, 2022
2c85161
new synchronous EventSource implementation (#64)
eli-darkly Dec 19, 2022
c197765
add async wrapper to emulate old EventSource (#65)
eli-darkly Dec 20, 2022
08593ee
Merge branch 'main' of github.com:launchdarkly/okhttp-eventsource
eli-darkly Dec 20, 2022
3dc7bec
update doc comments regarding thread behavior in Android
eli-darkly Dec 21, 2022
948c0f0
Merge pull request #66 from launchdarkly/eb/sc-91466/android-comment
eli-darkly Dec 21, 2022
0919605
update Gradle to 7.6 + fix snapshot releases
eli-darkly Dec 31, 2022
c9b1e11
Merge pull request #67 from launchdarkly/eb/sc-107787/gradle-update
eli-darkly Jan 3, 2023
09b5e0f
in streaming data mode, throw an exception if stream is closed during…
eli-darkly Jan 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ldrelease/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repo:

jobs:
- docker:
image: gradle:6.8.3-jdk11
image: gradle:7.6-jdk11
template:
name: gradle

Expand Down
7 changes: 6 additions & 1 deletion .ldrelease/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ set -ue

# Publish to Sonatype
echo "Publishing to Sonatype"
./gradlew publishToSonatype closeAndReleaseRepository || { echo "Gradle publish/release failed" >&2; exit 1; }
if [[ -n "${LD_RELEASE_IS_PRERELEASE}" ]]; then
./gradlew publishToSonatype || { echo "Gradle publish/release failed" >&2; exit 1; }
else
./gradlew publishToSonatype closeAndReleaseRepository || { echo "Gradle publish/release failed" >&2; exit 1; }
fi

1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ dependencies {
}

checkstyle {
toolVersion = "9.3"
configFile = file("${project.rootDir}/checkstyle.xml")
}

Expand Down
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<module name="Checker">
<module name="TreeWalker">
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="accessModifiers" value="public"/>
</module>
<module name="JavadocType">
<property name="scope" value="public"/>
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
257 changes: 153 additions & 104 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh

#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -17,67 +17,101 @@
#

##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################

# Attempt to set APP_HOME

# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0

# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum

warn () {
echo "$*"
}
} >&2

die () {
echo
echo "$*"
echo
exit 1
}
} >&2

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
Expand All @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Expand All @@ -98,88 +132,103 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.

# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

JAVACMD=`cygpath --unix "$JAVACMD"`

# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )

JAVACMD=$( cygpath --unix "$JAVACMD" )

# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option

if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
i=`expr $i + 1`
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi

# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'

exec "$JAVACMD" "$@"
Loading