anyline-ocr-react-native-module 43.0.0 → 44.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/.idea/modules.xml +8 -0
  2. package/.idea/plugin.iml +9 -0
  3. package/.idea/vcs.xml +6 -0
  4. package/android/.gradle/6.7/executionHistory/executionHistory.lock +0 -0
  5. package/android/.gradle/6.7/fileChanges/last-build.bin +0 -0
  6. package/android/.gradle/6.7/fileHashes/fileHashes.bin +0 -0
  7. package/android/.gradle/6.7/fileHashes/fileHashes.lock +0 -0
  8. package/android/.gradle/6.7/gc.properties +0 -0
  9. package/android/.gradle/7.0/dependencies-accessors/dependencies-accessors.lock +0 -0
  10. package/android/.gradle/7.0/dependencies-accessors/gc.properties +0 -0
  11. package/android/.gradle/7.0/executionHistory/executionHistory.lock +0 -0
  12. package/android/.gradle/7.0/fileChanges/last-build.bin +0 -0
  13. package/android/.gradle/7.0/fileHashes/fileHashes.bin +0 -0
  14. package/android/.gradle/7.0/fileHashes/fileHashes.lock +0 -0
  15. package/android/.gradle/7.0/gc.properties +0 -0
  16. package/android/.gradle/7.3/checksums/checksums.lock +0 -0
  17. package/android/.gradle/7.3/dependencies-accessors/dependencies-accessors.lock +0 -0
  18. package/android/.gradle/7.3/dependencies-accessors/gc.properties +0 -0
  19. package/android/.gradle/7.3/fileChanges/last-build.bin +0 -0
  20. package/android/.gradle/7.3/fileHashes/fileHashes.lock +0 -0
  21. package/android/.gradle/7.3/gc.properties +0 -0
  22. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  23. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  24. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  25. package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  26. package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
  27. package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
  28. package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
  29. package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
  30. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  31. package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
  32. package/android/.gradle/7.4/gc.properties +0 -0
  33. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  34. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  35. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  36. package/android/.gradle/checksums/checksums.lock +0 -0
  37. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  38. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  39. package/android/.gradle/configuration-cache/gc.properties +0 -0
  40. package/android/.gradle/vcs-1/gc.properties +0 -0
  41. package/android/.idea/compiler.xml +6 -0
  42. package/android/.idea/gradle.xml +19 -0
  43. package/android/.idea/jarRepositories.xml +40 -0
  44. package/android/.idea/misc.xml +10 -0
  45. package/android/.idea/vcs.xml +7 -0
  46. package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
  47. package/android/build.gradle +9 -1
  48. package/android/gradle/wrapper/gradle-wrapper.properties +2 -2
  49. package/android/gradlew +192 -108
  50. package/android/gradlew.bat +10 -7
  51. package/android/local.properties +8 -0
  52. package/android/src/main/assets/info_sound_TIN.wav +0 -0
  53. package/android/src/main/java/com/anyline/reactnative/AnylineSDKPlugin.java +16 -22
  54. package/android/src/main/java/com/anyline/reactnative/FeedbackConfig.java +58 -0
  55. package/android/src/main/java/com/anyline/reactnative/ImageTextConfig.java +48 -0
  56. package/android/src/main/java/com/anyline/reactnative/InstructionConfig.java +19 -0
  57. package/android/src/main/java/com/anyline/reactnative/ScanActivity.java +180 -1
  58. package/android/src/main/res/drawable/dot_overlay.png +0 -0
  59. package/android/src/main/res/drawable-hdpi/ic_flash_auto.png +0 -0
  60. package/android/src/main/res/drawable-hdpi/ic_flash_off.png +0 -0
  61. package/android/src/main/res/drawable-hdpi/ic_flash_on.png +0 -0
  62. package/android/src/main/res/drawable-hdpi/ic_move_back.png +0 -0
  63. package/android/src/main/res/drawable-hdpi/ic_move_closer.png +0 -0
  64. package/android/src/main/res/drawable-hdpi/ic_too_bright.png +0 -0
  65. package/android/src/main/res/drawable-hdpi/ic_too_dark.png +0 -0
  66. package/android/src/main/res/drawable-hdpi/ic_wrong_format.png +0 -0
  67. package/android/src/main/res/drawable-mdpi/ic_flash_auto.png +0 -0
  68. package/android/src/main/res/drawable-mdpi/ic_flash_off.png +0 -0
  69. package/android/src/main/res/drawable-mdpi/ic_flash_on.png +0 -0
  70. package/android/src/main/res/drawable-mdpi/ic_move_back.png +0 -0
  71. package/android/src/main/res/drawable-mdpi/ic_move_closer.png +0 -0
  72. package/android/src/main/res/drawable-mdpi/ic_too_bright.png +0 -0
  73. package/android/src/main/res/drawable-mdpi/ic_too_dark.png +0 -0
  74. package/android/src/main/res/drawable-mdpi/ic_wrong_format.png +0 -0
  75. package/android/src/main/res/drawable-xhdpi/ic_flash_auto.png +0 -0
  76. package/android/src/main/res/drawable-xhdpi/ic_flash_off.png +0 -0
  77. package/android/src/main/res/drawable-xhdpi/ic_flash_on.png +0 -0
  78. package/android/src/main/res/drawable-xhdpi/ic_move_back.png +0 -0
  79. package/android/src/main/res/drawable-xhdpi/ic_move_closer.png +0 -0
  80. package/android/src/main/res/drawable-xhdpi/ic_too_bright.png +0 -0
  81. package/android/src/main/res/drawable-xhdpi/ic_too_dark.png +0 -0
  82. package/android/src/main/res/drawable-xhdpi/ic_wrong_format.png +0 -0
  83. package/android/src/main/res/drawable-xxhdpi/ic_flash_auto.png +0 -0
  84. package/android/src/main/res/drawable-xxhdpi/ic_flash_off.png +0 -0
  85. package/android/src/main/res/drawable-xxhdpi/ic_flash_on.png +0 -0
  86. package/android/src/main/res/drawable-xxhdpi/ic_move_back.png +0 -0
  87. package/android/src/main/res/drawable-xxhdpi/ic_move_closer.png +0 -0
  88. package/android/src/main/res/drawable-xxhdpi/ic_too_bright.png +0 -0
  89. package/android/src/main/res/drawable-xxhdpi/ic_too_dark.png +0 -0
  90. package/android/src/main/res/drawable-xxhdpi/ic_wrong_format.png +0 -0
  91. package/android/src/main/res/drawable-xxxhdpi/ic_flash_auto.png +0 -0
  92. package/android/src/main/res/drawable-xxxhdpi/ic_flash_off.png +0 -0
  93. package/android/src/main/res/drawable-xxxhdpi/ic_flash_on.png +0 -0
  94. package/android/src/main/res/drawable-xxxhdpi/ic_move_back.png +0 -0
  95. package/android/src/main/res/drawable-xxxhdpi/ic_move_closer.png +0 -0
  96. package/android/src/main/res/drawable-xxxhdpi/ic_too_bright.png +0 -0
  97. package/android/src/main/res/drawable-xxxhdpi/ic_too_dark.png +0 -0
  98. package/android/src/main/res/drawable-xxxhdpi/ic_wrong_format.png +0 -0
  99. package/android/src/main/res/layout/activity_scan.xml +53 -2
  100. package/ios/ALJsonUIConfiguration.m +3 -1
  101. package/ios/ALNFCScanViewController.m +0 -10
  102. package/ios/ALPluginHelper.m +9 -23
  103. package/ios/ALPluginScanViewController.h +0 -2
  104. package/ios/ALPluginScanViewController.m +0 -1
  105. package/ios/AnylineReact.podspec +2 -2
  106. package/ios/AnylineSDKPlugin.m +1 -2
  107. package/package.json +8 -8
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/plugin.iml" filepath="$PROJECT_DIR$/.idea/plugin.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ </component>
9
+ </module>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
5
+ </component>
6
+ </project>
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ #Thu Jan 12 14:36:20 CET 2023
2
+ gradle.version=6.7
File without changes
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="CompilerConfiguration">
4
+ <bytecodeTargetLevel target="11" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GradleMigrationSettings" migrationVersion="1" />
4
+ <component name="GradleSettings">
5
+ <option name="linkedExternalProjectsSettings">
6
+ <GradleProjectSettings>
7
+ <option name="testRunner" value="GRADLE" />
8
+ <option name="distributionType" value="DEFAULT_WRAPPED" />
9
+ <option name="externalProjectPath" value="$PROJECT_DIR$" />
10
+ <option name="gradleJvm" value="Embedded JDK" />
11
+ <option name="modules">
12
+ <set>
13
+ <option value="$PROJECT_DIR$" />
14
+ </set>
15
+ </option>
16
+ </GradleProjectSettings>
17
+ </option>
18
+ </component>
19
+ </project>
@@ -0,0 +1,40 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="RemoteRepositoriesConfiguration">
4
+ <remote-repository>
5
+ <option name="id" value="central" />
6
+ <option name="name" value="Maven Central repository" />
7
+ <option name="url" value="https://repo1.maven.org/maven2" />
8
+ </remote-repository>
9
+ <remote-repository>
10
+ <option name="id" value="jboss.community" />
11
+ <option name="name" value="JBoss Community repository" />
12
+ <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
13
+ </remote-repository>
14
+ <remote-repository>
15
+ <option name="id" value="maven" />
16
+ <option name="name" value="maven" />
17
+ <option name="url" value="https://anylinesdk.blob.core.windows.net/testing/" />
18
+ </remote-repository>
19
+ <remote-repository>
20
+ <option name="id" value="BintrayJCenter" />
21
+ <option name="name" value="BintrayJCenter" />
22
+ <option name="url" value="https://jcenter.bintray.com/" />
23
+ </remote-repository>
24
+ <remote-repository>
25
+ <option name="id" value="Google" />
26
+ <option name="name" value="Google" />
27
+ <option name="url" value="https://dl.google.com/dl/android/maven2/" />
28
+ </remote-repository>
29
+ <remote-repository>
30
+ <option name="id" value="maven" />
31
+ <option name="name" value="maven" />
32
+ <option name="url" value="https://anylinesdk.blob.core.windows.net/maven/" />
33
+ </remote-repository>
34
+ <remote-repository>
35
+ <option name="id" value="MavenRepo" />
36
+ <option name="name" value="MavenRepo" />
37
+ <option name="url" value="https://repo.maven.apache.org/maven2/" />
38
+ </remote-repository>
39
+ </component>
40
+ </project>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ExternalStorageConfigurationManager" enabled="true" />
4
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
5
+ <output url="file://$PROJECT_DIR$/build/classes" />
6
+ </component>
7
+ <component name="ProjectType">
8
+ <option name="id" value="Android" />
9
+ </component>
10
+ </project>
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
5
+ <mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
6
+ </component>
7
+ </project>
@@ -0,0 +1,13 @@
1
+ arguments=
2
+ auto.sync=false
3
+ build.scans.enabled=false
4
+ connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
5
+ connection.project.dir=
6
+ eclipse.preferences.version=1
7
+ gradle.user.home=
8
+ java.home=/Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home
9
+ jvm.arguments=
10
+ offline.mode=false
11
+ override.workspace.settings=true
12
+ show.console.view=true
13
+ show.executions.view=true
@@ -69,8 +69,16 @@ repositories {
69
69
 
70
70
  dependencies {
71
71
  implementation fileTree(dir: "libs", include: ["*.jar"])
72
- implementation 'io.anyline:anylinesdk:43.1.0'
72
+ implementation 'io.anyline:anylinesdk:44.1.0'
73
73
  implementation "com.facebook.react:react-native:+" // from node_modules
74
74
  implementation("com.google.android.material:material:1.4.0-rc01")
75
75
  implementation 'androidx.multidex:multidex:2.0.1'
76
+ constraints {
77
+ implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
78
+ because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
79
+ }
80
+ implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
81
+ because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
82
+ }
83
+ }
76
84
  }
@@ -1,6 +1,6 @@
1
- #Thu Aug 17 14:31:23 CEST 2017
2
1
  distributionBase=GRADLE_USER_HOME
3
2
  distributionPath=wrapper/dists
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
4
+ networkTimeout=10000
4
5
  zipStoreBase=GRADLE_USER_HOME
5
6
  zipStorePath=wrapper/dists
6
- distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
package/android/gradlew CHANGED
@@ -1,74 +1,129 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
+
3
+ #
4
+ # Copyright © 2015-2021 the original authors.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # https://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
2
18
 
3
19
  ##############################################################################
4
- ##
5
- ## Gradle start up script for UN*X
6
- ##
20
+ #
21
+ # Gradle start up script for POSIX generated by Gradle.
22
+ #
23
+ # Important for running:
24
+ #
25
+ # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
26
+ # noncompliant, but you have some other compliant shell such as ksh or
27
+ # bash, then to run this script, type that shell name before the whole
28
+ # command line, like:
29
+ #
30
+ # ksh Gradle
31
+ #
32
+ # Busybox and similar reduced shells will NOT work, because this script
33
+ # requires all of these POSIX shell features:
34
+ # * functions;
35
+ # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36
+ # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37
+ # * compound commands having a testable exit status, especially «case»;
38
+ # * various built-in commands including «command», «set», and «ulimit».
39
+ #
40
+ # Important for patching:
41
+ #
42
+ # (2) This script targets any POSIX shell, so it avoids extensions provided
43
+ # by Bash, Ksh, etc; in particular arrays are avoided.
44
+ #
45
+ # The "traditional" practice of packing multiple parameters into a
46
+ # space-separated string is a well documented source of bugs and security
47
+ # problems, so this is (mostly) avoided, by progressively accumulating
48
+ # options in "$@", and eventually passing that to Java.
49
+ #
50
+ # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
51
+ # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
52
+ # see the in-line comments for details.
53
+ #
54
+ # There are tweaks for specific operating systems such as AIX, CygWin,
55
+ # Darwin, MinGW, and NonStop.
56
+ #
57
+ # (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
59
+ # within the Gradle project.
60
+ #
61
+ # You can find Gradle at https://github.com/gradle/gradle/.
62
+ #
7
63
  ##############################################################################
8
64
 
9
- # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10
- DEFAULT_JVM_OPTS=""
65
+ # Attempt to set APP_HOME
66
+
67
+ # Resolve links: $0 may be a link
68
+ app_path=$0
69
+
70
+ # Need this for daisy-chained symlinks.
71
+ while
72
+ APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
73
+ [ -h "$app_path" ]
74
+ do
75
+ ls=$( ls -ld "$app_path" )
76
+ link=${ls#*' -> '}
77
+ case $link in #(
78
+ /*) app_path=$link ;; #(
79
+ *) app_path=$APP_HOME$link ;;
80
+ esac
81
+ done
82
+
83
+ # This is normally unused
84
+ # shellcheck disable=SC2034
85
+ APP_BASE_NAME=${0##*/}
86
+ APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
11
87
 
12
- APP_NAME="Gradle"
13
- APP_BASE_NAME=`basename "$0"`
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"'
14
90
 
15
91
  # Use the maximum available, or set MAX_FD != -1 to use that value.
16
- MAX_FD="maximum"
92
+ MAX_FD=maximum
17
93
 
18
- warn ( ) {
94
+ warn () {
19
95
  echo "$*"
20
- }
96
+ } >&2
21
97
 
22
- die ( ) {
98
+ die () {
23
99
  echo
24
100
  echo "$*"
25
101
  echo
26
102
  exit 1
27
- }
103
+ } >&2
28
104
 
29
105
  # OS specific support (must be 'true' or 'false').
30
106
  cygwin=false
31
107
  msys=false
32
108
  darwin=false
33
- case "`uname`" in
34
- CYGWIN* )
35
- cygwin=true
36
- ;;
37
- Darwin* )
38
- darwin=true
39
- ;;
40
- MINGW* )
41
- msys=true
42
- ;;
109
+ nonstop=false
110
+ case "$( uname )" in #(
111
+ CYGWIN* ) cygwin=true ;; #(
112
+ Darwin* ) darwin=true ;; #(
113
+ MSYS* | MINGW* ) msys=true ;; #(
114
+ NONSTOP* ) nonstop=true ;;
43
115
  esac
44
116
 
45
- # Attempt to set APP_HOME
46
- # Resolve links: $0 may be a link
47
- PRG="$0"
48
- # Need this for relative symlinks.
49
- while [ -h "$PRG" ] ; do
50
- ls=`ls -ld "$PRG"`
51
- link=`expr "$ls" : '.*-> \(.*\)$'`
52
- if expr "$link" : '/.*' > /dev/null; then
53
- PRG="$link"
54
- else
55
- PRG=`dirname "$PRG"`"/$link"
56
- fi
57
- done
58
- SAVED="`pwd`"
59
- cd "`dirname \"$PRG\"`/" >/dev/null
60
- APP_HOME="`pwd -P`"
61
- cd "$SAVED" >/dev/null
62
-
63
117
  CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64
118
 
119
+
65
120
  # Determine the Java command to use to start the JVM.
66
121
  if [ -n "$JAVA_HOME" ] ; then
67
122
  if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68
123
  # IBM's JDK on AIX uses strange locations for the executables
69
- JAVACMD="$JAVA_HOME/jre/sh/java"
124
+ JAVACMD=$JAVA_HOME/jre/sh/java
70
125
  else
71
- JAVACMD="$JAVA_HOME/bin/java"
126
+ JAVACMD=$JAVA_HOME/bin/java
72
127
  fi
73
128
  if [ ! -x "$JAVACMD" ] ; then
74
129
  die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -77,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
77
132
  location of your Java installation."
78
133
  fi
79
134
  else
80
- JAVACMD="java"
135
+ JAVACMD=java
81
136
  which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82
137
 
83
138
  Please set the JAVA_HOME variable in your environment to match the
@@ -85,76 +140,105 @@ location of your Java installation."
85
140
  fi
86
141
 
87
142
  # Increase the maximum file descriptors if we can.
88
- if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89
- MAX_FD_LIMIT=`ulimit -H -n`
90
- if [ $? -eq 0 ] ; then
91
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92
- MAX_FD="$MAX_FD_LIMIT"
93
- fi
94
- ulimit -n $MAX_FD
95
- if [ $? -ne 0 ] ; then
96
- warn "Could not set maximum file descriptor limit: $MAX_FD"
97
- fi
98
- else
99
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100
- fi
143
+ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144
+ case $MAX_FD in #(
145
+ max*)
146
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147
+ # shellcheck disable=SC3045
148
+ MAX_FD=$( ulimit -H -n ) ||
149
+ warn "Could not query maximum file descriptor limit"
150
+ esac
151
+ case $MAX_FD in #(
152
+ '' | soft) :;; #(
153
+ *)
154
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155
+ # shellcheck disable=SC3045
156
+ ulimit -n "$MAX_FD" ||
157
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
158
+ esac
101
159
  fi
102
160
 
103
- # For Darwin, add options to specify how the application appears in the dock
104
- if $darwin; then
105
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106
- fi
161
+ # Collect all arguments for the java command, stacking in reverse order:
162
+ # * args from the command line
163
+ # * the main class name
164
+ # * -classpath
165
+ # * -D...appname settings
166
+ # * --module-path (only if needed)
167
+ # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
168
+
169
+ # For Cygwin or MSYS, switch paths to Windows format before running java
170
+ if "$cygwin" || "$msys" ; then
171
+ APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
172
+ CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
173
+
174
+ JAVACMD=$( cygpath --unix "$JAVACMD" )
107
175
 
108
- # For Cygwin, switch paths to Windows format before running java
109
- if $cygwin ; then
110
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112
- JAVACMD=`cygpath --unix "$JAVACMD"`
113
-
114
- # We build the pattern for arguments to be converted via cygpath
115
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116
- SEP=""
117
- for dir in $ROOTDIRSRAW ; do
118
- ROOTDIRS="$ROOTDIRS$SEP$dir"
119
- SEP="|"
120
- done
121
- OURCYGPATTERN="(^($ROOTDIRS))"
122
- # Add a user-defined pattern to the cygpath arguments
123
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125
- fi
126
176
  # Now convert the arguments - kludge to limit ourselves to /bin/sh
127
- i=0
128
- for arg in "$@" ; do
129
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131
-
132
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134
- else
135
- eval `echo args$i`="\"$arg\""
177
+ for arg do
178
+ if
179
+ case $arg in #(
180
+ -*) false ;; # don't mess with options #(
181
+ /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
182
+ [ -e "$t" ] ;; #(
183
+ *) false ;;
184
+ esac
185
+ then
186
+ arg=$( cygpath --path --ignore --mixed "$arg" )
136
187
  fi
137
- i=$((i+1))
188
+ # Roll the args list around exactly as many times as the number of
189
+ # args, so each arg winds up back in the position where it started, but
190
+ # possibly modified.
191
+ #
192
+ # NB: a `for` loop captures its iteration list before it begins, so
193
+ # changing the positional parameters here affects neither the number of
194
+ # iterations, nor the values presented in `arg`.
195
+ shift # remove old arg
196
+ set -- "$@" "$arg" # push replacement arg
138
197
  done
139
- case $i in
140
- (0) set -- ;;
141
- (1) set -- "$args0" ;;
142
- (2) set -- "$args0" "$args1" ;;
143
- (3) set -- "$args0" "$args1" "$args2" ;;
144
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150
- esac
151
198
  fi
152
199
 
153
- # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154
- function splitJvmOpts() {
155
- JVM_OPTS=("$@")
156
- }
157
- eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158
- JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
200
+ # Collect all arguments for the java command;
201
+ # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202
+ # shell script including quotes and variable substitutions, so put them in
203
+ # double quotes to make sure that they get re-expanded; and
204
+ # * put everything else in single quotes, so that it's not re-expanded.
205
+
206
+ set -- \
207
+ "-Dorg.gradle.appname=$APP_BASE_NAME" \
208
+ -classpath "$CLASSPATH" \
209
+ org.gradle.wrapper.GradleWrapperMain \
210
+ "$@"
211
+
212
+ # Stop when "xargs" is not available.
213
+ if ! command -v xargs >/dev/null 2>&1
214
+ then
215
+ die "xargs is not available"
216
+ fi
159
217
 
160
- exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
218
+ # Use "xargs" to parse quoted args.
219
+ #
220
+ # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
221
+ #
222
+ # In Bash we could simply go:
223
+ #
224
+ # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
225
+ # set -- "${ARGS[@]}" "$@"
226
+ #
227
+ # but POSIX shell has neither arrays nor command substitution, so instead we
228
+ # post-process each arg (as a line of input to sed) to backslash-escape any
229
+ # character that might be a shell metacharacter, then use eval to reverse
230
+ # that process (while maintaining the separation between arguments), and wrap
231
+ # the whole thing up as a single "set" statement.
232
+ #
233
+ # This will of course break if any of these variables contains a newline or
234
+ # an unmatched quote.
235
+ #
236
+
237
+ eval "set -- $(
238
+ printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
239
+ xargs -n1 |
240
+ sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
241
+ tr '\n' ' '
242
+ )" '"$@"'
243
+
244
+ exec "$JAVACMD" "$@"