mirror of https://github.com/axmolengine/axmol.git
ANDROID_SDK_ROOT -> ANDROID_HOME (#1009)
* Update setup.py * ANDROID_SDK_ROOT -> ANDROID_HOME
This commit is contained in:
parent
28eb9e1886
commit
b5cde53994
|
@ -105,9 +105,9 @@ class axutils {
|
|||
}
|
||||
|
||||
if (sdkRoot == null || !new File(sdkRoot).isDirectory()) {
|
||||
sdkRoot = Paths.get("${System.env.ANDROID_SDK_ROOT}").toAbsolutePath().toString()
|
||||
sdkRoot = Paths.get("${System.env.ANDROID_HOME}").toAbsolutePath().toString()
|
||||
if (!new File(sdkRoot).isDirectory()) {
|
||||
throw new Exception('android sdk not specified properly in local.properties or system env ANDROID_SDK_ROOT')
|
||||
throw new Exception('android sdk not specified properly in local.properties or system env ANDROID_HOME')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
12
setup.py
12
setup.py
|
@ -28,7 +28,7 @@ THE SOFTWARE.
|
|||
'''
|
||||
This script will install environment variables needed to by axmol. It will set these envrironment variables:
|
||||
* AX_CONSOLE_ROOT: used to run axmol console tools
|
||||
* ANDROID_SDK_ROOT: used to generate applicatoin on Android through commands
|
||||
* ANDROID_HOME: used to generate applicatoin on Android through commands
|
||||
* AX_ROOT: path where axmol is installed
|
||||
|
||||
On Max OS X, when start a shell, it will read these files and execute commands in sequence:
|
||||
|
@ -65,7 +65,7 @@ from os.path import dirname
|
|||
AX_ROOT = 'AX_ROOT'
|
||||
AX_CONSOLE_ROOT = 'AX_CONSOLE_ROOT'
|
||||
|
||||
ANDROID_SDK_ROOT = 'ANDROID_SDK_ROOT'
|
||||
ANDROID_HOME = 'ANDROID_HOME'
|
||||
|
||||
def _check_python_version():
|
||||
major_ver = sys.version_info[0]
|
||||
|
@ -192,7 +192,7 @@ class SetEnvVar(object):
|
|||
file.write('\n# Add environment variable %s for axmol\n' % key)
|
||||
file.write('export %s="%s"\n' % (key, value))
|
||||
file.write('export PATH=$%s:$PATH\n' % key)
|
||||
if key == ANDROID_SDK_ROOT:
|
||||
if key == ANDROID_HOME:
|
||||
file.write(
|
||||
'export PATH=$%s/tools:$%s/platform-tools:$PATH\n' % (key, key))
|
||||
file.close()
|
||||
|
@ -281,7 +281,7 @@ class SetEnvVar(object):
|
|||
|
||||
def _check_valid(self, var_name, value):
|
||||
ret = False
|
||||
if var_name == ANDROID_SDK_ROOT:
|
||||
if var_name == ANDROID_HOME:
|
||||
ret = self._is_android_sdk_root_valid(value)
|
||||
else:
|
||||
ret = False
|
||||
|
@ -499,7 +499,7 @@ class SetEnvVar(object):
|
|||
return ret
|
||||
|
||||
def _find_value_from_sys(self, var_name):
|
||||
if var_name == ANDROID_SDK_ROOT:
|
||||
if var_name == ANDROID_HOME:
|
||||
return self._get_androidsdk_path()
|
||||
else:
|
||||
return None
|
||||
|
@ -571,7 +571,7 @@ class SetEnvVar(object):
|
|||
print('->Configuration for Android platform only, you can also skip and manually edit "%s"\n' %
|
||||
self.file_used_for_setup)
|
||||
if(quiet) :
|
||||
sdk_ret = self.set_variable(ANDROID_SDK_ROOT, android_sdk_root)
|
||||
sdk_ret = self.set_variable(ANDROID_HOME, android_sdk_root)
|
||||
|
||||
# tip the backup file
|
||||
if (self.backup_file is not None) and (os.path.exists(self.backup_file)):
|
||||
|
|
|
@ -53,7 +53,7 @@ class AndroidBuilder(object):
|
|||
self.build_type = build_type
|
||||
|
||||
# check environment variable
|
||||
self.sdk_root = axmol.check_environment_variable('ANDROID_SDK_ROOT')
|
||||
self.sdk_root = axmol.check_environment_variable('ANDROID_HOME')
|
||||
self.ant_root = None
|
||||
if os.path.exists(os.path.join(self.app_android_root, "gradle.properties")):
|
||||
self.sign_prop_file = os.path.join(self.app_android_root, "gradle.properties")
|
||||
|
|
|
@ -168,7 +168,7 @@ class CCPluginDeploy(axmol.CCPlugin):
|
|||
self.package = compile_dep.android_package
|
||||
self.activity = compile_dep.android_activity
|
||||
apk_path = compile_dep.apk_path
|
||||
sdk_root = axmol.check_environment_variable('ANDROID_SDK_ROOT')
|
||||
sdk_root = axmol.check_environment_variable('ANDROID_HOME')
|
||||
adb_path = axmol.CMDRunner.convert_path_to_cmd(os.path.join(sdk_root, 'platform-tools', 'adb'))
|
||||
|
||||
if not self._no_uninstall:
|
||||
|
|
|
@ -340,7 +340,7 @@ class CCPluginRun(axmol.CCPlugin):
|
|||
if not self._platforms.is_android_active():
|
||||
return
|
||||
|
||||
sdk_root = axmol.check_environment_variable('ANDROID_SDK_ROOT')
|
||||
sdk_root = axmol.check_environment_variable('ANDROID_HOME')
|
||||
adb_path = axmol.CMDRunner.convert_path_to_cmd(os.path.join(sdk_root, 'platform-tools', 'adb'))
|
||||
deploy_dep = dependencies['deploy']
|
||||
startapp = "%s shell am start -n \"%s/%s\"" % (adb_path, deploy_dep.package, deploy_dep.activity)
|
||||
|
|
|
@ -47,14 +47,14 @@ The json files will be generated in the path `/mnt/sdcard/PerfTest`. So you can
|
|||
|
||||
Run the command in cmd:
|
||||
```
|
||||
%ANDROID_SDK_ROOT%\platform-tools\adb pull /mnt/sdcard/PerfTest C:\Users\USER_NAME\MY_LOG_FOLDER
|
||||
%ANDROID_HOME%\platform-tools\adb pull /mnt/sdcard/PerfTest C:\Users\USER_NAME\MY_LOG_FOLDER
|
||||
```
|
||||
|
||||
* Mac System
|
||||
|
||||
Run the command in terminal:
|
||||
```
|
||||
$ANDROID_SDK_ROOT/platform-tools/adb pull /mnt/sdcard/PerfTest ~/MY_LOG_FOLDER
|
||||
$ANDROID_HOME/platform-tools/adb pull /mnt/sdcard/PerfTest ~/MY_LOG_FOLDER
|
||||
```
|
||||
|
||||
### From Mac devices
|
||||
|
|
|
@ -22,7 +22,7 @@ def _check_ndk_root_env():
|
|||
|
||||
ANDROID_NDK = None
|
||||
|
||||
sdkRoot = os.environ.get('ANDROID_SDK_ROOT', None)
|
||||
sdkRoot = os.environ.get('ANDROID_HOME', None)
|
||||
for _, ndkVers, _ in os.walk("{0}{1}ndk".format(sdkRoot, os.path.sep)):
|
||||
for ndkVer in ndkVers:
|
||||
if (ndkVer == '19.2.5345600'):
|
||||
|
|
Loading…
Reference in New Issue