mirror of https://github.com/axmolengine/axmol.git
Improve android setup tools
- Rename ANDROID_SDK to ANDROID_SDK_ROOT, refer to: https://developer.android.google.cn/studio/command-line/variables - CMake: Use ndk in sdk_root/ndk/xxx/
This commit is contained in:
parent
64ec0587a5
commit
714d814288
|
@ -103,15 +103,8 @@ class axistools {
|
||||||
ndkVer = ndkVer.substring(0, ndkVer.length() - 1)
|
ndkVer = ndkVer.substring(0, ndkVer.length() - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Collect ndk dirs */
|
|
||||||
def ndkRoot = Paths.get("${System.env.ANDROID_NDK}")
|
|
||||||
def ndkDirs = []
|
def ndkDirs = []
|
||||||
if (Files.exists(ndkRoot)) {
|
def sdkRoot = Paths.get("${System.env.ANDROID_SDK_ROOT}")
|
||||||
ndkRoot = ndkRoot.toAbsolutePath().toString()
|
|
||||||
ndkDirs.add(ndkRoot)
|
|
||||||
}
|
|
||||||
|
|
||||||
def sdkRoot = Paths.get("${System.env.ANDROID_SDK}")
|
|
||||||
if (Files.exists(sdkRoot)) {
|
if (Files.exists(sdkRoot)) {
|
||||||
File dir = new File(sdkRoot.toAbsolutePath().toString() + '/ndk')
|
File dir = new File(sdkRoot.toAbsolutePath().toString() + '/ndk')
|
||||||
if (dir.isDirectory()) {
|
if (dir.isDirectory()) {
|
||||||
|
@ -159,7 +152,7 @@ class axistools {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def sdkRoot = Paths.get("${System.env.ANDROID_SDK}")
|
def sdkRoot = Paths.get("${System.env.ANDROID_SDK_ROOT}")
|
||||||
|
|
||||||
if(Files.exists(sdkRoot)) {
|
if(Files.exists(sdkRoot)) {
|
||||||
def verList = []
|
def verList = []
|
||||||
|
|
|
@ -2267,23 +2267,24 @@ int lua_axis_3d_Mesh_draw(lua_State* tolua_S)
|
||||||
unsigned int arg4;
|
unsigned int arg4;
|
||||||
axis::Vec4 arg5;
|
axis::Vec4 arg5;
|
||||||
bool arg6;
|
bool arg6;
|
||||||
bool arg7;
|
bool arg7;
|
||||||
|
|
||||||
ok &= luaval_to_object<axis::Renderer>(tolua_S, 2, "ax.Renderer",&arg0, "ax.Mesh:draw");
|
ok &= luaval_to_object<axis::Renderer>(tolua_S, 2, "ax.Renderer",&arg0, "ax.Mesh:draw");
|
||||||
|
|
||||||
ok &= luaval_to_number(tolua_S, 3,&arg1, "ax.Mesh:draw");
|
ok &= luaval_to_number(tolua_S, 3, &arg1, "ax.Mesh:draw");
|
||||||
|
|
||||||
ok &= luaval_to_mat4(tolua_S, 4, &arg2, "ax.Mesh:draw");
|
ok &= luaval_to_mat4(tolua_S, 4, &arg2, "ax.Mesh:draw");
|
||||||
|
|
||||||
ok &= luaval_to_uint32(tolua_S, 5,&arg3, "ax.Mesh:draw");
|
ok &= luaval_to_uint32(tolua_S, 5, &arg3, "ax.Mesh:draw");
|
||||||
|
|
||||||
ok &= luaval_to_uint32(tolua_S, 6,&arg4, "ax.Mesh:draw");
|
ok &= luaval_to_uint32(tolua_S, 6, &arg4, "ax.Mesh:draw");
|
||||||
|
|
||||||
ok &= luaval_to_vec4(tolua_S, 7, &arg5, "ax.Mesh:draw");
|
ok &= luaval_to_vec4(tolua_S, 7, &arg5, "ax.Mesh:draw");
|
||||||
|
|
||||||
ok &= luaval_to_boolean(tolua_S, 8,&arg6, "ax.Mesh:draw");
|
ok &= luaval_to_boolean(tolua_S, 8, &arg6, "ax.Mesh:draw");
|
||||||
|
|
||||||
|
ok &= luaval_to_boolean(tolua_S, 9, &arg7, "ax.Mesh:draw");
|
||||||
|
|
||||||
ok &= luaval_to_boolean(tolua_S, 9,&arg7, "ax.Mesh:draw");
|
|
||||||
if(!ok)
|
if(!ok)
|
||||||
{
|
{
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_3d_Mesh_draw'", nullptr);
|
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_3d_Mesh_draw'", nullptr);
|
||||||
|
@ -2293,7 +2294,7 @@ int lua_axis_3d_Mesh_draw(lua_State* tolua_S)
|
||||||
lua_settop(tolua_S, 1);
|
lua_settop(tolua_S, 1);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Mesh:draw",argc, 8);
|
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Mesh:draw",argc, 7);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
#if AXIS_DEBUG >= 1
|
||||||
|
@ -2594,6 +2595,56 @@ int lua_axis_3d_Mesh_setBlendFunc(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int lua_axis_3d_Mesh_setForce2DQueue(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
axis::Mesh* cobj = nullptr;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if AXIS_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if AXIS_DEBUG >= 1
|
||||||
|
if (!tolua_isusertype(tolua_S,1,"ax.Mesh",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cobj = (axis::Mesh*)tolua_tousertype(tolua_S,1,0);
|
||||||
|
|
||||||
|
#if AXIS_DEBUG >= 1
|
||||||
|
if (!cobj)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_axis_3d_Mesh_setForce2DQueue'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S)-1;
|
||||||
|
if (argc == 1)
|
||||||
|
{
|
||||||
|
bool arg0;
|
||||||
|
|
||||||
|
ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ax.Mesh:setForce2DQueue");
|
||||||
|
if(!ok)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_3d_Mesh_setForce2DQueue'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
cobj->getMaterial()->setForce2DQueue(arg0);
|
||||||
|
lua_settop(tolua_S, 1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Mesh:setForce2DQueue",argc, 1);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if AXIS_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_axis_3d_Mesh_setForce2DQueue'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int lua_axis_3d_Mesh_setSkin(lua_State* tolua_S)
|
int lua_axis_3d_Mesh_setSkin(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -2806,6 +2857,7 @@ int lua_register_axis_3d_Mesh(lua_State* tolua_S)
|
||||||
tolua_function(tolua_S,"getProgramState",lua_axis_3d_Mesh_getProgramState);
|
tolua_function(tolua_S,"getProgramState",lua_axis_3d_Mesh_getProgramState);
|
||||||
tolua_function(tolua_S,"getMeshVertexAttribCount",lua_axis_3d_Mesh_getMeshVertexAttribCount);
|
tolua_function(tolua_S,"getMeshVertexAttribCount",lua_axis_3d_Mesh_getMeshVertexAttribCount);
|
||||||
tolua_function(tolua_S,"setBlendFunc",lua_axis_3d_Mesh_setBlendFunc);
|
tolua_function(tolua_S,"setBlendFunc",lua_axis_3d_Mesh_setBlendFunc);
|
||||||
|
tolua_function(tolua_S,"setForce2DQueue",lua_axis_3d_Mesh_setForce2DQueue);
|
||||||
tolua_function(tolua_S,"setSkin",lua_axis_3d_Mesh_setSkin);
|
tolua_function(tolua_S,"setSkin",lua_axis_3d_Mesh_setSkin);
|
||||||
tolua_function(tolua_S,"isVisible",lua_axis_3d_Mesh_isVisible);
|
tolua_function(tolua_S,"isVisible",lua_axis_3d_Mesh_isVisible);
|
||||||
tolua_function(tolua_S,"setVisible",lua_axis_3d_Mesh_setVisible);
|
tolua_function(tolua_S,"setVisible",lua_axis_3d_Mesh_setVisible);
|
||||||
|
@ -3781,17 +3833,6 @@ int lua_axis_3d_MeshRenderer_getMaterial(lua_State* tolua_S)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
argc = lua_gettop(tolua_S)-1;
|
||||||
if (argc == 0)
|
|
||||||
{
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_3d_MeshRenderer_getMaterial'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
axis::Material* ret = cobj->getMaterial();
|
|
||||||
object_to_luaval<axis::Material>(tolua_S, "ax.Material",(axis::Material*)ret);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
{
|
{
|
||||||
int arg0;
|
int arg0;
|
||||||
|
@ -3806,7 +3847,7 @@ int lua_axis_3d_MeshRenderer_getMaterial(lua_State* tolua_S)
|
||||||
object_to_luaval<axis::Material>(tolua_S, "ax.Material",(axis::Material*)ret);
|
object_to_luaval<axis::Material>(tolua_S, "ax.Material",(axis::Material*)ret);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.MeshRenderer:getMaterial",argc, 0);
|
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.MeshRenderer:getMaterial",argc, 1);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
#if AXIS_DEBUG >= 1
|
||||||
|
@ -3816,103 +3857,6 @@ int lua_axis_3d_MeshRenderer_getMaterial(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int lua_axis_3d_MeshRenderer_setWireframe(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
axis::MeshRenderer* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"ax.MeshRenderer",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cobj = (axis::MeshRenderer*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_axis_3d_MeshRenderer_setWireframe'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
|
||||||
if (argc == 1)
|
|
||||||
{
|
|
||||||
bool arg0;
|
|
||||||
|
|
||||||
ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ax.MeshRenderer:setWireframe");
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_3d_MeshRenderer_setWireframe'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cobj->setWireframe(arg0);
|
|
||||||
lua_settop(tolua_S, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.MeshRenderer:setWireframe",argc, 1);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_axis_3d_MeshRenderer_setWireframe'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_axis_3d_MeshRenderer_isWireframe(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
axis::MeshRenderer* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"ax.MeshRenderer",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cobj = (axis::MeshRenderer*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_axis_3d_MeshRenderer_isWireframe'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
|
||||||
if (argc == 0)
|
|
||||||
{
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_3d_MeshRenderer_isWireframe'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
bool ret = cobj->isWireframe();
|
|
||||||
tolua_pushboolean(tolua_S,(bool)ret);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.MeshRenderer:isWireframe",argc, 0);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_axis_3d_MeshRenderer_isWireframe'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_axis_3d_MeshRenderer_setCullFace(lua_State* tolua_S)
|
int lua_axis_3d_MeshRenderer_setCullFace(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -4504,6 +4448,56 @@ int lua_axis_3d_MeshRenderer_setBlendFunc(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
int lua_axis_3d_MeshRenderer_setForce2DQueue(lua_State* tolua_S)
|
||||||
|
{
|
||||||
|
int argc = 0;
|
||||||
|
axis::MeshRenderer* cobj = nullptr;
|
||||||
|
bool ok = true;
|
||||||
|
|
||||||
|
#if AXIS_DEBUG >= 1
|
||||||
|
tolua_Error tolua_err;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if AXIS_DEBUG >= 1
|
||||||
|
if (!tolua_isusertype(tolua_S,1,"ax.MeshRenderer",0,&tolua_err)) goto tolua_lerror;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
cobj = (axis::MeshRenderer*)tolua_tousertype(tolua_S,1,0);
|
||||||
|
|
||||||
|
#if AXIS_DEBUG >= 1
|
||||||
|
if (!cobj)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_axis_3d_MeshRenderer_setForce2DQueue'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
argc = lua_gettop(tolua_S)-1;
|
||||||
|
if (argc == 1)
|
||||||
|
{
|
||||||
|
bool arg0;
|
||||||
|
|
||||||
|
ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ax.MeshRenderer:setForce2DQueue");
|
||||||
|
if(!ok)
|
||||||
|
{
|
||||||
|
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_3d_MeshRenderer_setForce2DQueue'", nullptr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
cobj->getMaterial()->setForce2DQueue(arg0);
|
||||||
|
lua_settop(tolua_S, 1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.MeshRenderer:setForce2DQueue",argc, 1);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
#if AXIS_DEBUG >= 1
|
||||||
|
tolua_lerror:
|
||||||
|
tolua_error(tolua_S,"#ferror in function 'lua_axis_3d_MeshRenderer_setForce2DQueue'.",&tolua_err);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
int lua_axis_3d_MeshRenderer_genMaterial(lua_State* tolua_S)
|
int lua_axis_3d_MeshRenderer_genMaterial(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -4839,8 +4833,6 @@ int lua_register_axis_3d_MeshRenderer(lua_State* tolua_S)
|
||||||
tolua_function(tolua_S,"setTexture",lua_axis_3d_MeshRenderer_setTexture);
|
tolua_function(tolua_S,"setTexture",lua_axis_3d_MeshRenderer_setTexture);
|
||||||
tolua_function(tolua_S,"getLightMask",lua_axis_3d_MeshRenderer_getLightMask);
|
tolua_function(tolua_S,"getLightMask",lua_axis_3d_MeshRenderer_getLightMask);
|
||||||
tolua_function(tolua_S,"getMaterial",lua_axis_3d_MeshRenderer_getMaterial);
|
tolua_function(tolua_S,"getMaterial",lua_axis_3d_MeshRenderer_getMaterial);
|
||||||
tolua_function(tolua_S,"setWireframe",lua_axis_3d_MeshRenderer_setWireframe);
|
|
||||||
tolua_function(tolua_S,"isWireframe",lua_axis_3d_MeshRenderer_isWireframe);
|
|
||||||
tolua_function(tolua_S,"setCullFace",lua_axis_3d_MeshRenderer_setCullFace);
|
tolua_function(tolua_S,"setCullFace",lua_axis_3d_MeshRenderer_setCullFace);
|
||||||
tolua_function(tolua_S,"getMeshes",lua_axis_3d_MeshRenderer_getMeshes);
|
tolua_function(tolua_S,"getMeshes",lua_axis_3d_MeshRenderer_getMeshes);
|
||||||
tolua_function(tolua_S,"removeAllAttachNode",lua_axis_3d_MeshRenderer_removeAllAttachNode);
|
tolua_function(tolua_S,"removeAllAttachNode",lua_axis_3d_MeshRenderer_removeAllAttachNode);
|
||||||
|
@ -4853,6 +4845,7 @@ int lua_register_axis_3d_MeshRenderer(lua_State* tolua_S)
|
||||||
tolua_function(tolua_S,"setLightMask",lua_axis_3d_MeshRenderer_setLightMask);
|
tolua_function(tolua_S,"setLightMask",lua_axis_3d_MeshRenderer_setLightMask);
|
||||||
tolua_function(tolua_S,"getAttachNode",lua_axis_3d_MeshRenderer_getAttachNode);
|
tolua_function(tolua_S,"getAttachNode",lua_axis_3d_MeshRenderer_getAttachNode);
|
||||||
tolua_function(tolua_S,"setBlendFunc",lua_axis_3d_MeshRenderer_setBlendFunc);
|
tolua_function(tolua_S,"setBlendFunc",lua_axis_3d_MeshRenderer_setBlendFunc);
|
||||||
|
tolua_function(tolua_S,"setForce2DQueue",lua_axis_3d_MeshRenderer_setForce2DQueue);
|
||||||
tolua_function(tolua_S,"genMaterial",lua_axis_3d_MeshRenderer_genMaterial);
|
tolua_function(tolua_S,"genMaterial",lua_axis_3d_MeshRenderer_genMaterial);
|
||||||
tolua_function(tolua_S,"removeAttachNode",lua_axis_3d_MeshRenderer_removeAttachNode);
|
tolua_function(tolua_S,"removeAttachNode",lua_axis_3d_MeshRenderer_removeAttachNode);
|
||||||
tolua_function(tolua_S,"getSkeleton",lua_axis_3d_MeshRenderer_getSkeleton);
|
tolua_function(tolua_S,"getSkeleton",lua_axis_3d_MeshRenderer_getSkeleton);
|
||||||
|
|
|
@ -95431,100 +95431,6 @@ int lua_axis_base_Material_draw(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int lua_axis_base_Material_isTransparent(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
axis::Material* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"ax.Material",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cobj = (axis::Material*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_axis_base_Material_isTransparent'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
|
||||||
if (argc == 0)
|
|
||||||
{
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_base_Material_isTransparent'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
bool ret = cobj->isTransparent();
|
|
||||||
tolua_pushboolean(tolua_S,(bool)ret);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Material:isTransparent",argc, 0);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_axis_base_Material_isTransparent'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_axis_base_Material_isForce2DQueue(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
axis::Material* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"ax.Material",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cobj = (axis::Material*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_axis_base_Material_isForce2DQueue'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
|
||||||
if (argc == 0)
|
|
||||||
{
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_base_Material_isForce2DQueue'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
bool ret = cobj->isForce2DQueue();
|
|
||||||
tolua_pushboolean(tolua_S,(bool)ret);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Material:isForce2DQueue",argc, 0);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_axis_base_Material_isForce2DQueue'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_axis_base_Material_getRenderState(lua_State* tolua_S)
|
int lua_axis_base_Material_getRenderState(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -95622,56 +95528,6 @@ int lua_axis_base_Material_setName(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int lua_axis_base_Material_setForce2DQueue(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
axis::Material* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"ax.Material",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cobj = (axis::Material*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_axis_base_Material_setForce2DQueue'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
|
||||||
if (argc == 1)
|
|
||||||
{
|
|
||||||
bool arg0;
|
|
||||||
|
|
||||||
ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ax.Material:setForce2DQueue");
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_base_Material_setForce2DQueue'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cobj->setForce2DQueue(arg0);
|
|
||||||
lua_settop(tolua_S, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Material:setForce2DQueue",argc, 1);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_axis_base_Material_setForce2DQueue'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_axis_base_Material_getTechniqueByIndex(lua_State* tolua_S)
|
int lua_axis_base_Material_getTechniqueByIndex(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -96063,56 +95919,6 @@ int lua_axis_base_Material_addTechnique(lua_State* tolua_S)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
int lua_axis_base_Material_setTransparent(lua_State* tolua_S)
|
|
||||||
{
|
|
||||||
int argc = 0;
|
|
||||||
axis::Material* cobj = nullptr;
|
|
||||||
bool ok = true;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_Error tolua_err;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!tolua_isusertype(tolua_S,1,"ax.Material",0,&tolua_err)) goto tolua_lerror;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cobj = (axis::Material*)tolua_tousertype(tolua_S,1,0);
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
if (!cobj)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_axis_base_Material_setTransparent'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
argc = lua_gettop(tolua_S)-1;
|
|
||||||
if (argc == 1)
|
|
||||||
{
|
|
||||||
bool arg0;
|
|
||||||
|
|
||||||
ok &= luaval_to_boolean(tolua_S, 2,&arg0, "ax.Material:setTransparent");
|
|
||||||
if(!ok)
|
|
||||||
{
|
|
||||||
tolua_error(tolua_S,"invalid arguments in function 'lua_axis_base_Material_setTransparent'", nullptr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
cobj->setTransparent(arg0);
|
|
||||||
lua_settop(tolua_S, 1);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ax.Material:setTransparent",argc, 1);
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
#if AXIS_DEBUG >= 1
|
|
||||||
tolua_lerror:
|
|
||||||
tolua_error(tolua_S,"#ferror in function 'lua_axis_base_Material_setTransparent'.",&tolua_err);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
int lua_axis_base_Material_getPrimitiveType(lua_State* tolua_S)
|
int lua_axis_base_Material_getPrimitiveType(lua_State* tolua_S)
|
||||||
{
|
{
|
||||||
int argc = 0;
|
int argc = 0;
|
||||||
|
@ -96329,11 +96135,8 @@ int lua_register_axis_base_Material(lua_State* tolua_S)
|
||||||
tolua_beginmodule(tolua_S,"Material");
|
tolua_beginmodule(tolua_S,"Material");
|
||||||
tolua_function(tolua_S,"clone",lua_axis_base_Material_clone);
|
tolua_function(tolua_S,"clone",lua_axis_base_Material_clone);
|
||||||
tolua_function(tolua_S,"draw",lua_axis_base_Material_draw);
|
tolua_function(tolua_S,"draw",lua_axis_base_Material_draw);
|
||||||
tolua_function(tolua_S,"isTransparent",lua_axis_base_Material_isTransparent);
|
|
||||||
tolua_function(tolua_S,"isForce2DQueue",lua_axis_base_Material_isForce2DQueue);
|
|
||||||
tolua_function(tolua_S,"getRenderState",lua_axis_base_Material_getRenderState);
|
tolua_function(tolua_S,"getRenderState",lua_axis_base_Material_getRenderState);
|
||||||
tolua_function(tolua_S,"setName",lua_axis_base_Material_setName);
|
tolua_function(tolua_S,"setName",lua_axis_base_Material_setName);
|
||||||
tolua_function(tolua_S,"setForce2DQueue",lua_axis_base_Material_setForce2DQueue);
|
|
||||||
tolua_function(tolua_S,"getTechniqueByIndex",lua_axis_base_Material_getTechniqueByIndex);
|
tolua_function(tolua_S,"getTechniqueByIndex",lua_axis_base_Material_getTechniqueByIndex);
|
||||||
tolua_function(tolua_S,"getName",lua_axis_base_Material_getName);
|
tolua_function(tolua_S,"getName",lua_axis_base_Material_getName);
|
||||||
tolua_function(tolua_S,"getTechniques",lua_axis_base_Material_getTechniques);
|
tolua_function(tolua_S,"getTechniques",lua_axis_base_Material_getTechniques);
|
||||||
|
@ -96342,7 +96145,6 @@ int lua_register_axis_base_Material(lua_State* tolua_S)
|
||||||
tolua_function(tolua_S,"getTechniqueByName",lua_axis_base_Material_getTechniqueByName);
|
tolua_function(tolua_S,"getTechniqueByName",lua_axis_base_Material_getTechniqueByName);
|
||||||
tolua_function(tolua_S,"setPrimitiveType",lua_axis_base_Material_setPrimitiveType);
|
tolua_function(tolua_S,"setPrimitiveType",lua_axis_base_Material_setPrimitiveType);
|
||||||
tolua_function(tolua_S,"addTechnique",lua_axis_base_Material_addTechnique);
|
tolua_function(tolua_S,"addTechnique",lua_axis_base_Material_addTechnique);
|
||||||
tolua_function(tolua_S,"setTransparent",lua_axis_base_Material_setTransparent);
|
|
||||||
tolua_function(tolua_S,"getPrimitiveType",lua_axis_base_Material_getPrimitiveType);
|
tolua_function(tolua_S,"getPrimitiveType",lua_axis_base_Material_getPrimitiveType);
|
||||||
tolua_function(tolua_S,"getTechnique",lua_axis_base_Material_getTechnique);
|
tolua_function(tolua_S,"getTechnique",lua_axis_base_Material_getTechnique);
|
||||||
tolua_function(tolua_S,"createWithFilename", lua_axis_base_Material_createWithFilename);
|
tolua_function(tolua_S,"createWithFilename", lua_axis_base_Material_createWithFilename);
|
||||||
|
|
|
@ -2406,10 +2406,6 @@ int register_all_axis_base(lua_State* tolua_S);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
18
setup.py
18
setup.py
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
||||||
This script will install environment variables needed to by axis. It will set these envrironment variables:
|
This script will install environment variables needed to by axis. It will set these envrironment variables:
|
||||||
* AXIS_CONSOLE_ROOT: used to run axis console tools
|
* AXIS_CONSOLE_ROOT: used to run axis console tools
|
||||||
* ANDROID_NDK: used to build android native codes
|
* ANDROID_NDK: used to build android native codes
|
||||||
* ANDROID_SDK: used to generate applicatoin on Android through commands
|
* ANDROID_SDK_ROOT: used to generate applicatoin on Android through commands
|
||||||
* AXIS_ROOT: path where axis is installed
|
* AXIS_ROOT: path where axis is installed
|
||||||
|
|
||||||
On Max OS X, when start a shell, it will read these files and execute commands in sequence:
|
On Max OS X, when start a shell, it will read these files and execute commands in sequence:
|
||||||
|
@ -67,7 +67,7 @@ AXIS_ROOT = 'AXIS_ROOT'
|
||||||
AXIS_CONSOLE_ROOT = 'AXIS_CONSOLE_ROOT'
|
AXIS_CONSOLE_ROOT = 'AXIS_CONSOLE_ROOT'
|
||||||
|
|
||||||
ANDROID_NDK = 'ANDROID_NDK'
|
ANDROID_NDK = 'ANDROID_NDK'
|
||||||
ANDROID_SDK = 'ANDROID_SDK'
|
ANDROID_SDK_ROOT = 'ANDROID_SDK_ROOT'
|
||||||
|
|
||||||
def _check_python_version():
|
def _check_python_version():
|
||||||
major_ver = sys.version_info[0]
|
major_ver = sys.version_info[0]
|
||||||
|
@ -194,7 +194,7 @@ class SetEnvVar(object):
|
||||||
file.write('\n# Add environment variable %s for axis\n' % key)
|
file.write('\n# Add environment variable %s for axis\n' % key)
|
||||||
file.write('export %s="%s"\n' % (key, value))
|
file.write('export %s="%s"\n' % (key, value))
|
||||||
file.write('export PATH=$%s:$PATH\n' % key)
|
file.write('export PATH=$%s:$PATH\n' % key)
|
||||||
if key == ANDROID_SDK:
|
if key == ANDROID_SDK_ROOT:
|
||||||
file.write(
|
file.write(
|
||||||
'export PATH=$%s/tools:$%s/platform-tools:$PATH\n' % (key, key))
|
'export PATH=$%s/tools:$%s/platform-tools:$PATH\n' % (key, key))
|
||||||
file.close()
|
file.close()
|
||||||
|
@ -296,7 +296,7 @@ class SetEnvVar(object):
|
||||||
# if sys_var == ANDROID_NDK:
|
# if sys_var == ANDROID_NDK:
|
||||||
# root.wm_title('Set ANDROID_NDK')
|
# root.wm_title('Set ANDROID_NDK')
|
||||||
# else:
|
# else:
|
||||||
# root.wm_title('Set ANDROID_SDK')
|
# root.wm_title('Set ANDROID_SDK_ROOT')
|
||||||
|
|
||||||
# def callback():
|
# def callback():
|
||||||
# self.tmp_input_value = tkFileDialog.askdirectory()
|
# self.tmp_input_value = tkFileDialog.askdirectory()
|
||||||
|
@ -312,14 +312,14 @@ class SetEnvVar(object):
|
||||||
# You can safely skip this step now. You can set the ANDROID_NDK later.
|
# You can safely skip this step now. You can set the ANDROID_NDK later.
|
||||||
# """
|
# """
|
||||||
|
|
||||||
# if sys_var == ANDROID_SDK:
|
# if sys_var == ANDROID_SDK_ROOT:
|
||||||
# label_content = 'Select path for Android SDK'
|
# label_content = 'Select path for Android SDK'
|
||||||
# label_help = """
|
# label_help = """
|
||||||
# The Android SDK is needed to develop games for Android.
|
# The Android SDK is needed to develop games for Android.
|
||||||
# For further information, go to:
|
# For further information, go to:
|
||||||
# https://developer.android.com/tools/sdk/ndk/index.html.
|
# https://developer.android.com/tools/sdk/ndk/index.html.
|
||||||
|
|
||||||
# You can safely skip this step now. You can set the ANDROID_SDK later.
|
# You can safely skip this step now. You can set the ANDROID_SDK_ROOT later.
|
||||||
# """
|
# """
|
||||||
|
|
||||||
# Tkinter.Label(root, text=label_help).pack()
|
# Tkinter.Label(root, text=label_help).pack()
|
||||||
|
@ -346,7 +346,7 @@ class SetEnvVar(object):
|
||||||
ret = False
|
ret = False
|
||||||
if var_name == ANDROID_NDK:
|
if var_name == ANDROID_NDK:
|
||||||
ret = self._is_ndk_root_valid(value)
|
ret = self._is_ndk_root_valid(value)
|
||||||
elif var_name == ANDROID_SDK:
|
elif var_name == ANDROID_SDK_ROOT:
|
||||||
ret = self._is_android_sdk_root_valid(value)
|
ret = self._is_android_sdk_root_valid(value)
|
||||||
else:
|
else:
|
||||||
ret = False
|
ret = False
|
||||||
|
@ -583,7 +583,7 @@ class SetEnvVar(object):
|
||||||
def _find_value_from_sys(self, var_name):
|
def _find_value_from_sys(self, var_name):
|
||||||
if var_name == ANDROID_NDK:
|
if var_name == ANDROID_NDK:
|
||||||
return self._get_ndkbuild_path()
|
return self._get_ndkbuild_path()
|
||||||
elif var_name == ANDROID_SDK:
|
elif var_name == ANDROID_SDK_ROOT:
|
||||||
return self._get_androidsdk_path()
|
return self._get_androidsdk_path()
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
@ -656,7 +656,7 @@ class SetEnvVar(object):
|
||||||
self.file_used_for_setup)
|
self.file_used_for_setup)
|
||||||
if(quiet) :
|
if(quiet) :
|
||||||
ndk_ret = self.set_variable(ANDROID_NDK, ndk_root)
|
ndk_ret = self.set_variable(ANDROID_NDK, ndk_root)
|
||||||
sdk_ret = self.set_variable(ANDROID_SDK, android_sdk_root)
|
sdk_ret = self.set_variable(ANDROID_SDK_ROOT, android_sdk_root)
|
||||||
|
|
||||||
# tip the backup file
|
# tip the backup file
|
||||||
if (self.backup_file is not None) and (os.path.exists(self.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
|
self.build_type = build_type
|
||||||
|
|
||||||
# check environment variable
|
# check environment variable
|
||||||
self.sdk_root = axis.check_environment_variable('ANDROID_SDK')
|
self.sdk_root = axis.check_environment_variable('ANDROID_SDK_ROOT')
|
||||||
self.ant_root = None
|
self.ant_root = None
|
||||||
if os.path.exists(os.path.join(self.app_android_root, "gradle.properties")):
|
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")
|
self.sign_prop_file = os.path.join(self.app_android_root, "gradle.properties")
|
||||||
|
|
|
@ -160,7 +160,7 @@ class CCPluginDeploy(axis.CCPlugin):
|
||||||
self.package = compile_dep.android_package
|
self.package = compile_dep.android_package
|
||||||
self.activity = compile_dep.android_activity
|
self.activity = compile_dep.android_activity
|
||||||
apk_path = compile_dep.apk_path
|
apk_path = compile_dep.apk_path
|
||||||
sdk_root = axis.check_environment_variable('ANDROID_SDK')
|
sdk_root = axis.check_environment_variable('ANDROID_SDK_ROOT')
|
||||||
adb_path = axis.CMDRunner.convert_path_to_cmd(os.path.join(sdk_root, 'platform-tools', 'adb'))
|
adb_path = axis.CMDRunner.convert_path_to_cmd(os.path.join(sdk_root, 'platform-tools', 'adb'))
|
||||||
|
|
||||||
if not self._no_uninstall:
|
if not self._no_uninstall:
|
||||||
|
|
|
@ -238,7 +238,7 @@ class CCPluginRun(axis.CCPlugin):
|
||||||
if not self._platforms.is_android_active():
|
if not self._platforms.is_android_active():
|
||||||
return
|
return
|
||||||
|
|
||||||
sdk_root = axis.check_environment_variable('ANDROID_SDK')
|
sdk_root = axis.check_environment_variable('ANDROID_SDK_ROOT')
|
||||||
adb_path = axis.CMDRunner.convert_path_to_cmd(os.path.join(sdk_root, 'platform-tools', 'adb'))
|
adb_path = axis.CMDRunner.convert_path_to_cmd(os.path.join(sdk_root, 'platform-tools', 'adb'))
|
||||||
deploy_dep = dependencies['deploy']
|
deploy_dep = dependencies['deploy']
|
||||||
startapp = "%s shell am start -n \"%s/%s\"" % (adb_path, deploy_dep.package, deploy_dep.activity)
|
startapp = "%s shell am start -n \"%s/%s\"" % (adb_path, deploy_dep.package, deploy_dep.activity)
|
||||||
|
|
|
@ -33,8 +33,8 @@ CMDLINETOOLS_REV = "8512546"
|
||||||
NDK_VER = "23.2.8568313" # "r23c LTS"
|
NDK_VER = "23.2.8568313" # "r23c LTS"
|
||||||
|
|
||||||
# ANDROID_NDK = os.path.join(ROOT_DIR, "android-ndk-" + NDK_VER)
|
# ANDROID_NDK = os.path.join(ROOT_DIR, "android-ndk-" + NDK_VER)
|
||||||
ANDROID_SDK = os.path.join(ROOT_DIR, "android-sdk")
|
ANDROID_SDK_ROOT = os.path.join(ROOT_DIR, "android-sdk")
|
||||||
ANDROID_NDK = os.path.join(ANDROID_SDK, "ndk/" + NDK_VER)
|
ANDROID_NDK = os.path.join(ANDROID_SDK_ROOT, "ndk/" + NDK_VER)
|
||||||
SDK_MANAGER = os.path.join(ROOT_DIR, "cmdline-tools/bin/sdkmanager")
|
SDK_MANAGER = os.path.join(ROOT_DIR, "cmdline-tools/bin/sdkmanager")
|
||||||
SYSTEM = platform.system().lower()
|
SYSTEM = platform.system().lower()
|
||||||
if SYSTEM == "windows":
|
if SYSTEM == "windows":
|
||||||
|
@ -95,9 +95,9 @@ def install_android_cmdline_tools():
|
||||||
@retry(Exception, tries=5, delay=1, backoff=1)
|
@retry(Exception, tries=5, delay=1, backoff=1)
|
||||||
def install_android_sdk():
|
def install_android_sdk():
|
||||||
# list packages
|
# list packages
|
||||||
run_with_yes(SDK_MANAGER + " --list --sdk_root=" + ANDROID_SDK)
|
run_with_yes(SDK_MANAGER + " --list --sdk_root=" + ANDROID_SDK_ROOT)
|
||||||
|
|
||||||
switches = " --verbose --sdk_root=" + ANDROID_SDK + " "
|
switches = " --verbose --sdk_root=" + ANDROID_SDK_ROOT + " "
|
||||||
cmd_base = SDK_MANAGER + switches
|
cmd_base = SDK_MANAGER + switches
|
||||||
packages = [
|
packages = [
|
||||||
'platform-tools',
|
'platform-tools',
|
||||||
|
@ -115,17 +115,13 @@ def install_android_sdk():
|
||||||
def export_environment(ndk_only):
|
def export_environment(ndk_only):
|
||||||
with open(os.path.join(ROOT_DIR, "environment.sh"), "a") as myfile:
|
with open(os.path.join(ROOT_DIR, "environment.sh"), "a") as myfile:
|
||||||
if not ndk_only:
|
if not ndk_only:
|
||||||
myfile.write("export ANDROID_SDK=" + ANDROID_SDK + "\n")
|
myfile.write("export ANDROID_SDK_ROOT=" + ANDROID_SDK_ROOT + "\n") # refer to: https://developer.android.google.cn/studio/command-line/variables
|
||||||
myfile.write("export ANDROID_HOME=" + ANDROID_SDK + "\n")
|
myfile.write("export ANDROID_NDK=" + ANDROID_NDK + "\n") # for lua binding generator
|
||||||
myfile.write("export ANDROID_SDK_ROOT=" + ANDROID_SDK + "\n")
|
|
||||||
myfile.write("export ANDROID_NDK=" + ANDROID_NDK + "\n")
|
|
||||||
|
|
||||||
with open(os.path.join(ROOT_DIR, "environment.ps1"), "a") as myfile:
|
with open(os.path.join(ROOT_DIR, "environment.ps1"), "a") as myfile:
|
||||||
if not ndk_only:
|
if not ndk_only:
|
||||||
myfile.write("$env:ANDROID_SDK=\"" + ANDROID_SDK + "\"\n")
|
myfile.write("$env:ANDROID_SDK_ROOT=\"" + ANDROID_SDK_ROOT + "\"\n")
|
||||||
myfile.write("$env:ANDROID_HOME=\"" + ANDROID_SDK + "\"\n")
|
myfile.write("$env:ANDROID_NDK=\"" + ANDROID_NDK + "\"\n") # for lua binding generator
|
||||||
myfile.write("$env:ANDROID_SDK_ROOT=\"" + ANDROID_SDK + "\"\n")
|
|
||||||
myfile.write("$env:ANDROID_NDK=\"" + ANDROID_NDK + "\"\n")
|
|
||||||
|
|
||||||
def main(ndk_only):
|
def main(ndk_only):
|
||||||
install_android_cmdline_tools()
|
install_android_cmdline_tools()
|
||||||
|
|
Loading…
Reference in New Issue