genbindings_wawagame.py

这是一个用于生成Lua绑定胶水代码的Python脚本,主要用于Android平台。脚本检查并使用环境变量NDK_ROOT和PYTHON_BIN,定位到Android NDK和Python解释器,并根据平台设置路径。它还包含了错误处理和配置文件生成,以供后续的代码生成步骤使用。
摘要由CSDN通过智能技术生成
#!/usr/bin/python


# This script is used to generate luabinding glue codes.
# Android ndk version must be ndk-r9b.




import sys
import os, os.path
import shutil
import ConfigParser
import subprocess
import re
from contextlib import contextmanager




def _check_ndk_root_env():
    ''' Checking the environment NDK_ROOT, which will be used for building
    '''


    try:
        NDK_ROOT = os.environ['NDK_ROOT']
    except Exception:
        print "NDK_ROOT not defined. Please define NDK_ROOT in your environment."
        sys.exit(1)


    return NDK_ROOT


def _check_python_bin_env():
    ''' Checking the environment PYTHON_BIN, which will be used for building
    '''


    try:
        PYTHON_BIN = os.environ['PYTHON_BIN']
    except Exception:
        print "PYTHON_BIN not defined, use current python."
        PYTHON_BIN = sys.executable


    return PYTHON_BIN




class CmdError(Exception):
    pass




@contextmanager
def _pushd(newDir):
    previousDir = os.get
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值