@ECHO OFF
SETLOCAL

CD /D %~dp0
PATH %PATH%;C:\Program Files\Android\Android Studio\jre\bin
SET JAVA_HOME=
SET PROPERTIES_FILE=%~dp0local.properties
IF NOT EXIST "%PROPERTIES_FILE%" (
		ECHO Creating local.properties file...
	IF EXIST "%USERPROFILE%\AppData\Local\Android\Sdk" (
		ECHO sdk.dir=C\:\\Users\\%USERNAME%\\AppData\\Local\\Android\\Sdk> "%PROPERTIES_FILE%"
		ECHO ndk.dir=C\:\\Users\\%USERNAME%\\AppData\\Local\\Android\\Sdk\\ndk-bundle>> "%PROPERTIES_FILE%"
	) ELSE (
		ECHO sdk.dir=C\:\\Users\\jenkins\\AppData\\Local\\Android\\Sdk> "%PROPERTIES_FILE%"
		ECHO ndk.dir=C\:\\Users\\jenkins\\AppData\\Local\\Android\\Sdk\\ndk-bundle>> "%PROPERTIES_FILE%"
	)
)

CALL gradlew.bat assembleRelease
