@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows (CLEAN PATH VERSION)
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem DELETE conflicting variables from the process memory
set ANDROID_PREFS_ROOT=
set ANDROID_SDK_HOME=
set ANDROID_USER_HOME=
set GRADLE_USER_HOME=

@rem SET NEW SAFE PATHS
set ANDROID_USER_HOME=C:\Android\home
set GRADLE_USER_HOME=C:\Android\gradle
set ANDROID_SDK_ROOT=C:\Android\sdk
set USERPROFILE=C:\Android\home
set HOME=C:\Android\home

@rem FORCED JAVA PROPERTIES
set GRADLE_OPTS="-Dandroid.user.home=C:/Android/home" "-Dandroid.prefs.root=C:/Android/home" "-Duser.home=C:/Android/home" "-Dfile.encoding=UTF-8"

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
goto fail

:execute
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*

:end
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
