Skip to content

Commit 5497df2

Browse files
committed
Try undo other half
1 parent a599b16 commit 5497df2

File tree

3 files changed

+24
-43
lines changed

3 files changed

+24
-43
lines changed

example/android/gradlew

+13-22
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,11 +80,13 @@ do
8080
esac
8181
done
8282

83-
# This is normally unused
84-
# shellcheck disable=SC2034
83+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84+
85+
APP_NAME="Gradle"
8586
APP_BASE_NAME=${0##*/}
86-
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
87+
88+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum
@@ -131,29 +133,22 @@ location of your Java installation."
131133
fi
132134
else
133135
JAVACMD=java
134-
if ! command -v java >/dev/null 2>&1
135-
then
136-
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
136+
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137137
138138
Please set the JAVA_HOME variable in your environment to match the
139139
location of your Java installation."
140-
fi
141140
fi
142141

143142
# Increase the maximum file descriptors if we can.
144143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
145144
case $MAX_FD in #(
146145
max*)
147-
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148-
# shellcheck disable=SC2039,SC3045
149146
MAX_FD=$( ulimit -H -n ) ||
150147
warn "Could not query maximum file descriptor limit"
151148
esac
152149
case $MAX_FD in #(
153150
'' | soft) :;; #(
154151
*)
155-
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156-
# shellcheck disable=SC2039,SC3045
157152
ulimit -n "$MAX_FD" ||
158153
warn "Could not set maximum file descriptor limit to $MAX_FD"
159154
esac
@@ -198,15 +193,11 @@ if "$cygwin" || "$msys" ; then
198193
done
199194
fi
200195

201-
202-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204-
205-
# Collect all arguments for the java command:
206-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207-
# and any embedded shellness will be escaped.
208-
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209-
# treated as '${Hostname}' itself on the command line.
196+
# Collect all arguments for the java command;
197+
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198+
# shell script including quotes and variable substitutions, so put them in
199+
# double quotes to make sure that they get re-expanded; and
200+
# * put everything else in single quotes, so that it's not re-expanded.
210201

211202
set -- \
212203
"-Dorg.gradle.appname=$APP_BASE_NAME" \

example/android/gradlew.bat

+10-11
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29-
@rem This is normally unused
3029
set APP_BASE_NAME=%~n0
3130
set APP_HOME=%DIRNAME%
3231

@@ -43,11 +42,11 @@ set JAVA_EXE=java.exe
4342
%JAVA_EXE% -version >NUL 2>&1
4443
if %ERRORLEVEL% equ 0 goto execute
4544

46-
echo. 1>&2
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48-
echo. 1>&2
49-
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50-
echo location of your Java installation. 1>&2
45+
echo.
46+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47+
echo.
48+
echo Please set the JAVA_HOME variable in your environment to match the
49+
echo location of your Java installation.
5150

5251
goto fail
5352

@@ -57,11 +56,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5756

5857
if exist "%JAVA_EXE%" goto execute
5958

60-
echo. 1>&2
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62-
echo. 1>&2
63-
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64-
echo location of your Java installation. 1>&2
59+
echo.
60+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61+
echo.
62+
echo Please set the JAVA_HOME variable in your environment to match the
63+
echo location of your Java installation.
6564

6665
goto fail
6766

example/android/settings.gradle

+1-10
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,5 @@ pluginManagement {
88

99
rootProject.name = "date-time-picker-example"
1010

11-
apply(from: {
12-
def searchDir = rootDir.toPath()
13-
do {
14-
def p = searchDir.resolve("node_modules/react-native-test-app/test-app.gradle")
15-
if (p.toFile().exists()) {
16-
return p.toRealPath().toString()
17-
}
18-
} while (searchDir = searchDir.getParent())
19-
throw new GradleException("Could not find `react-native-test-app`");
20-
}())
11+
apply(from: "../../node_modules/react-native-test-app/test-app.gradle")
2112
applyTestAppSettings(settings)

0 commit comments

Comments
 (0)