ironOS native ios app
at main 170 lines 5.1 kB view raw
1#!/bin/sh 2 3# 4# Copyright 2015-2024 the original author or 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 13############################################################################## 14# 15# Gradle start up script for POSIX generated by Gradle. 16# 17############################################################################## 18 19# Attempt to set APP_HOME 20 21# Resolve links: $0 may be a link 22app_path=$0 23 24# Need this for daisy-chained symlinks. 25while 26 APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 27 [ -h "$app_path" ] 28do 29 ls=$( ls -ld "$app_path" ) 30 link=${ls#*' -> '} 31 case $link in #( 32 /*) app_path=$link ;; #( 33 *) app_path=$APP_HOME$link ;; 34 esac 35done 36 37APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit 38 39# Use the maximum available, or set MAX_FD != -1 to use that value. 40MAX_FD=maximum 41 42warn () { 43 echo "$*" 44} >&2 45 46die () { 47 echo 48 echo "$*" 49 echo 50 exit 1 51} >&2 52 53# OS specific support (must be 'true' or 'false'). 54cygwin=false 55msys=false 56darwin=false 57nonstop=false 58case "$( uname )" in #( 59 CYGWIN* ) cygwin=true ;; #( 60 Darwin* ) darwin=true ;; #( 61 MSYS* | MINGW* ) msys=true ;; #( 62 NONSTOP* ) nonstop=true ;; 63esac 64 65CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 66 67 68# Determine the Java command to use to start the JVM. 69if [ -n "$JAVA_HOME" ] ; then 70 if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 71 # IBM's JDK on AIX uses strange locations for the executables 72 JAVACMD=$JAVA_HOME/jre/sh/java 73 else 74 JAVACMD=$JAVA_HOME/bin/java 75 fi 76 if [ ! -x "$JAVACMD" ] ; then 77 die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 78 79Please set the JAVA_HOME variable in your environment to match the 80location of your Java installation." 81 fi 82else 83 JAVACMD=java 84 which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 85 86Please set the JAVA_HOME variable in your environment to match the 87location of your Java installation." 88fi 89 90# Increase the maximum file descriptors if we can. 91if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 92 case $MAX_FD in #( 93 max*) 94 MAX_FD=$( ulimit -H -n ) || 95 warn "Could not query maximum file descriptor limit" 96 esac 97 case $MAX_FD in #( 98 '' | soft) :;; #( 99 *) 100 ulimit -n "$MAX_FD" || 101 warn "Could not set maximum file descriptor limit to $MAX_FD" 102 esac 103fi 104 105# Collect all arguments for the java command, stacking in reverse order: 106# * args from the command line 107# * the main class name 108# * -classpath 109# * -D...appname settings 110# * --module-path (only if needed) 111# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 112 113# For Cygwin or MSYS, switch paths to Windows format before running java 114if "$cygwin" || "$msys" ; then 115 APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 116 CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 117 118 JAVACMD=$( cygpath --unix "$JAVACMD" ) 119 120 # Now convert the arguments - kludge to limit ourselves to /bin/sh 121 for arg do 122 if 123 case $arg in #( 124 -*) false ;; # don't mess with options #( 125 /?*) t=${arg#)}; t=/${t%%/*} # looks like a POSIX filepath 126 [ -e "$t" ] ;; #( 127 *) false ;; 128 esac 129 then 130 arg=$( cygpath --path --ignore --mixed "$arg" ) 131 fi 132 # Roll the args list around exactly as many times as the number of 133 # temporary files were generated. 134 set -- "$@" "$arg" 135 shift 136 done 137fi 138 139 140# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 141DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 142 143# Collect all arguments for the java command: 144# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not:// having any whitespace:// * example:// having any whitespace 145set -- \ 146 "-Dorg.gradle.appname=$APP_BASE_NAME" \ 147 -classpath "$CLASSPATH" \ 148 org.gradle.wrapper.GradleWrapperMain \ 149 "$@" 150 151# Stop when "xargs" is not available. 152if ! command -v xargs >/dev/null 2>&1 153then 154 die "xargs is not available" 155fi 156 157# Use "xargs" to parse quoted args. 158# 159# With -n:// * "arg// "arg one two three" "arg" 160# ... would result in:// * "arg" "one two three" "arg" 161# 162# We need to respect:// * and then eval, for any shell// * The output is handled by the function:// *:// * The output is then read by xargs. 163eval "set -- $( 164 printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 165 xargs -n1 | 166 sed ' s~[`528"]~\\&~g; ' | 167 tr '\n' ' ' 168 )" '"$@"' 169 170exec "$JAVACMD" "$@"